Expand description
Types used to allow creation of Wasm contracts and tests for use on the Casper Platform.
Re-exports§
pub use crypto::*;
Modules§
- account
- Contains types and constants associated with user accounts.
- api_
error - Contains
ApiErrorand associated helper functions. - bytesrepr
- Contains serialization and deserialization code for types used throughout the system.
- checksummed_
hex - Checksummed hex encoding following an EIP-55-like scheme.
- contracts
- Data types for supporting contract headers feature.
- crypto
- Cryptographic types and operations on them
- runtime_
args - Home of RuntimeArgs for calling contracts
- system
- System modules, formerly known as “system contracts”
Macros§
- runtime_
args - Macro that makes it easier to construct named arguments.
Structs§
- Access
Rights - A struct which behaves like a set of bitflags to define access rights associated with a
URef. - Block
Time - A newtype wrapping a
u64which represents the block time. - CLType
Mismatch - Error while converting a
CLValueinto a given type. - CLValue
- A Casper value, i.e. a value which can be stored and manipulated by smart contracts.
- Context
Access Rights - Access rights for a given runtime context.
- Contract
- Methods and type signatures supported by a contract.
- Contract
Hash - A newtype wrapping a
HashAddrwhich references aContractin the global state. - Contract
Package - Contract definition, metadata, and security container.
- Contract
Package Hash - A newtype wrapping a
HashAddrwhich references aContractPackagein the global state. - Contract
Version Key - Major element of
ProtocolVersioncombined withContractVersion. - Contract
Wasm - A container for contract’s WASM bytes.
- Contract
Wasm Hash - A newtype wrapping a
HashAddrwhich is the raw bytes of the ContractWasmHash - Deploy
Hash - A newtype wrapping a
[u8; DEPLOY_HASH_LENGTH]which is the raw bytes of the deploy hash. - Deploy
Info - Information relating to the given Deploy.
- Entry
Point - Type signature of a method. Order of arguments matter since can be referenced by index as well as name.
- Entry
Points - Collection of named entry points
- EraId
- Era ID newtype.
- Execution
Effect - The journal of execution transforms from a single deploy.
- Gas
- The
Gasstruct represents aU512amount of gas. - Group
- A (labelled) “user group”. Each method of a versioned contract may be associated with one or more user groups which are allowed to call it.
- Motes
- A struct representing a number of
Motes. - Named
Arg - Named arguments to a contract.
- Named
Key - A named key.
- Operation
- An operation performed while executing a deploy.
- Parameter
- Parameter to a method
- Protocol
Version - A newtype wrapping a
SemVerwhich represents a Casper Platform protocol version. - Runtime
Args - Represents a collection of arguments passed to a smart contract.
- SemVer
- A struct for semantic versioning.
- Stored
Value Type Mismatch - An error struct representing a type mismatch in
StoredValueoperations. - Time
Diff - A time difference between two timestamps.
- Timestamp
- A timestamp type, representing a concrete moment in time.
- Transfer
- Represents a transfer from one purse to another
- Transfer
Addr - A newtype wrapping a
[u8; TRANSFER_ADDR_LENGTH]which is the raw bytes of the transfer address. - Transform
Entry - A transformation performed while executing a deploy.
- U128
- Little-endian large integer type
- U256
- Little-endian large integer type
- U512
- Little-endian large integer type
- URef
- Represents an unforgeable reference, containing an address in the network’s global storage and
the
AccessRightsof the reference.
Enums§
- ApiError
- Errors which can be encountered while running a smart contract.
- CLType
- Casper types, i.e. types which can be stored and manipulated by smart contracts.
- CLValue
Error - Error relating to
CLValueoperations. - Entry
Point Access - Enum describing the possible access control options for a contract entry point (method).
- Entry
Point Type - Context of method execution
- Execution
Result - The result of executing a single deploy.
- Granted
Access - Used to indicate if a granted
URefwas already held by the context. - Key
- The type under which data (e.g.
CLValues, smart contracts, user accounts) are indexed on the network. - KeyFrom
StrError - Errors produced when converting a
Stringinto aKey. - KeyTag
- OpKind
- The type of operation performed while executing a deploy.
- Parse
SemVer Error - Parsing error when creating a SemVer.
- Phase
- The phase in which a given contract is executing.
- Stored
Value - StoredValue represents all possible variants of values stored in Global State.
- Transfer
From StrError - Error returned when decoding a
TransferAddrfrom a formatted string. - Transferred
To - The result of a successful transfer between purses.
- Transform
- The actual transformation performed while executing a deploy.
- UInt
Parse Error - Error type for parsing
U128,U256,U512from a string. - URef
From StrError - Error while parsing a URef from a formatted string.
- Version
Check Result - The result of
ProtocolVersion::check_next_version.
Constants§
- ACCESS_
RIGHTS_ SERIALIZED_ LENGTH - The number of bytes in a serialized
AccessRights. - BLAK
E2B_ DIGEST_ LENGTH - The number of bytes in a Blake2b hash
- BLOCKTIME_
SERIALIZED_ LENGTH - The number of bytes in a serialized
BlockTime. - DEPLOY_
HASH_ LENGTH - The length of a deploy hash.
- DICTIONARY_
ITEM_ KEY_ MAX_ LENGTH - The maximum length for a
dictionary_item_key. - KEY_
DICTIONARY_ LENGTH - The number of bytes in a
Key::Dictionary. - KEY_
HASH_ LENGTH - The number of bytes in a
Key::Hash. - PHASE_
SERIALIZED_ LENGTH - The number of bytes in a serialized
Phase. - SEM_
VER_ SERIALIZED_ LENGTH - Length of SemVer when serialized
- TRANSFER_
ADDR_ LENGTH - The length of a transfer address.
- UREF_
ADDR_ LENGTH - The number of bytes in a
URefaddress. - UREF_
SERIALIZED_ LENGTH - The number of bytes in a serialized
URefwhere theAccessRightsare notNone.
Traits§
Functions§
- json_
pretty_ print - Serializes the given data structure as a pretty-printed
Stringof JSON usingserde_json::to_string_pretty(), but after first reducing any large hex-string values. - named_
key_ type - Returns the
CLTypedescribing a “named key” on the system, i.e. a(String, Key).
Type Aliases§
- Contract
Version - Automatically incremented value for a contract version within a major
ProtocolVersion. - Dictionary
Addr - An alias for
Keys dictionary variant. - Hash
Addr - An alias for
Keys hash variant. - Transfer
Result - The result of an attempt to transfer between purses.
- URef
Addr - The address of a
URef(unforgeable reference) on the network.