Crate unc_workspaces

Source
Expand description

§UNC Workspaces

A library for automating workflows and writing tests for UNC smart contracts. This software is not final, and will likely change.

Re-exports§

pub use network::pick_unused_port;
pub use result::Result;
pub use types::AccessKey;
pub use types::BlockHeight;
pub use types::CryptoHash;
pub use types::InMemorySigner;
pub use unc_abi_client;

Modules§

error
All errors that can occur within workspaces, including but not limited to the following: IO, RPC, Execution, Sandbox, DataConversion errors.
network
All builtin network types and traits.
operations
All operation types that are generated/used when making transactions or view calls.
prelude
All traits that are essential to the ease of use of workspaces.
result
Result and execution types from results of RPC calls to the network.
rpc
types
Types used in the workspaces crate. A lot of these are types are copied over from unc_primitives since those APIs are not yet stable. Once they are, we can directly reference them here, so no changes on the library consumer side is needed. Just keep using these types defined here as-is.

Structs§

Account
Account is directly associated to an account in the network provided by the Worker that creates it. This type offers methods to interact with any network, such as creating transactions and calling into contract functions.
AccountDetailsPatch
Details of an Account or Contract. This is an non-exhaustive list of items that the account stores in the blockchain state.
AccountId
Utility Account Identifier.
Block
Struct containing information on block coming from the network
Chunk
Contract
Contract is directly associated to a contract in the network provided by the Worker that creates it. This type offers methods to interact with any network, such as creating transactions and calling into contract functions.
Worker
The Worker type allows us to interact with any UNC related networks, such as mainnet and testnet. This controls where the environment the worker is running on top of it. Refer to this for all network related actions such as deploying a contract, or interacting with transactions.

Traits§

DevNetwork
DevNetwork is a Network that can call into dev_create and dev_deploy to create developer accounts.
Network
Network trait specifies the functionality of a network type such as mainnet, testnet or any other networks that are not specified in this library.

Functions§

compile_project
Builds the cargo project located at project_path and returns the generated wasm file contents.
custom
Connect to a custom network, and grab a Worker that can interact with it.
mainnet
Connect to the mainnet network, and grab a Worker that can interact with it.
mainnet_archival
Connect to the mainnet archival network, and grab a Worker that can interact with it.
sandbox
Spin up a new sandbox instance, and grab a Worker that interacts with it.
sandbox_with_version
Spin up a new sandbox instance, and grab a Worker that interacts with it.
testnet
Connect to the testnet network, and grab a Worker that can interact with it.
testnet_archival
Connect to the testnet archival network, and grab a Worker that can interact with it.
with_custom
with_mainnet
Run a locally scoped task where a mainnet instanced Worker is supplied.
with_mainnet_archival
Run a locally scoped task where a mainnet_archival instanced Worker is supplied.
with_sandbox
Run a locally scoped task where a sandbox instanced Worker is supplied.
with_testnet
Run a locally scoped task where a testnet instanced Worker is supplied.
with_testnet_archival
Run a locally scoped task where a testnet_archival instanced Worker is supplied.