Expand description
Types used to allow creation of Wasm contracts and tests for use on the Casper Platform.
Re-exports§
pub use account::Account;pub use global_state::Pointer;pub use runtime_footprint::RuntimeFootprint;pub use crypto::*;
Modules§
- Contains types and constants associated with user accounts.
- Data types for supporting contract headers feature.
- Contains
ApiErrorand associated helper functions. - Collection of helper functions and structures to reason about amorphic RuntimeArgs.
- Contains serialization and deserialization code for types used throughout the system.
- Checksummed hex encoding following an EIP-55-like scheme.
- Data types for interacting with contract level messages.
- Data types for supporting contract headers feature.
- Cryptographic types and operations on them
- Types related to execution of deploys.
- file_
utils std-fs-ioUtilities for handling reading from and writing to files. - gens
testingorgensContains functions for generating arbitrary values for use byProptest. - Types for global state.
- A module for the
[serde(with = serde_option_time_diff)]attribute, to serialize and deserializeOption<TimeDiff>treatingNoneas 0. - System modules, formerly known as “system contracts”
- testing
testingAn RNG for testing purposes.
Macros§
- Macro that makes it easier to construct named arguments.
Structs§
- A struct which behaves like a set of bitflags to define access rights associated with a
URef. - Configuration of an individial account in accounts.toml
- Configuration values associated with accounts.toml
- Methods and type signatures supported by a contract.
- A newtype wrapping a
HashAddrwhich references anAddressableEntityin the global state. - Special account in the system that is useful only for some private chains.
- A struct containing a signature of a transaction hash and the public key of the signer.
- The cryptographic hash of the bytesrepr-encoded set of approvals for a single [``].
- Auction
Costs stdDescription of the costs of calling auction entrypoints. - Data structure summarizing auction contract data.
- An unbroken, inclusive range of blocks.
- The body portion of a block. Version 1.
- The body portion of a block. Version 2.
- The cryptographic hash of a
Block. - The block hash and height of a given block.
- The header portion of a block.
- The header portion of a block.
- A collection of signatures for a single block, along with the associated block’s hash and era ID.
- A collection of signatures for a single block, along with the associated block’s hash and era ID.
- The status of syncing an individual block.
- The status of the block synchronizer.
- A newtype wrapping a
u64which represents the block time. - A block after execution, with the resulting global state root hash. This is the core component of the Casper linear blockchain. Version 1.
- A block after execution, with the resulting global state root hash. This is the core component of the Casper linear blockchain. Version 2.
- BrTable
Cost stdDefinition of a cost table for a Wasmbr_tableopcode. - A container for contract’s Wasm bytes.
- A newtype wrapping a
HashAddrwhich is the raw bytes of the ByteCodeHash - Error while converting a
CLValueinto a given type. - A Casper value, i.e. a value which can be stored and manipulated by smart contracts.
- Wraps a
CLValuefor storage in a dictionary. - A cryptographic hash of a chain name.
- Chainspec
stdA collection of configuration settings describing the state of the system at genesis and after upgrades to basic system functionality occurring after genesis. - The raw bytes of the chainspec.toml, genesis accounts.toml, and global_state.toml files.
- The chainspec registry.
- The checksum registry.
- Represents a chunk of data with attached proof.
- Access rights for a given runtime context.
- Methods and type signatures supported by a contract.
- A container for contract’s WASM bytes.
- A newtype wrapping a
HashAddrwhich is the raw bytes of the ContractWasmHash - Definition of a cost table for a Wasm control flow opcodes.
- Core
Config stdConfiguration values associated with the core protocol. - Configuration values related to a delegator.
- A signed smart contract.
- A builder for constructing a
Deploy. - Deploy
Config stdConfiguration values associated with deploys. - Error returned when a Deploy is too large.
- The cryptographic hash of a
Deploy. - The header portion of a
Deploy. - Information relating to the given Deploy.
- The output of the hash function.
- A helper to allow
Displayprinting the items of an iterator with a comma and space between each. - Major element of
ProtocolVersioncombined withEntityVersion. - Collection of entity versions.
- Type signature of a method. Order of arguments matter since can be referenced by index as well as name.
- Collection of named entry points.
- Information related to the end of an era, and validator weights for the following era.
- Information related to the end of an era, and validator weights for the following era.
- Era ID newtype.
- Equivocation, reward and validator inactivity information.
- The block hash and height in which a given deploy was executed, along with the execution result if known.
- An identifier for a
FinalitySignature. - A validator’s signature of a block, confirming it is finalized.
- A validator’s signature of a block, confirming it is finalized.
- The
Gasstruct represents aU512amount of gas. - Represents the details of a genesis process.
- A builder for an
GenesisConfig. - Represents details about genesis account’s validator status.
- Type storing the information about modifications to be applied to the global state.
- Type storing global state update entries.
- 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.
- Collection of named groups.
- Description of the costs of calling
handle_paymententrypoints. - Configuration values relevant to Highway consensus.
- Holds epoch type.
- Host
Function stdRepresentation of a host function cost. - Definition of a host function cost table.
- A Merkle proof of the given chunk.
- Json
Block With Signatures stdandjson-schemaA JSON-friendly representation of a block and the signatures for that block. - The validators for the given era.
- A validator’s weight.
- Configuration for messages limits.
- Mint
Costs stdDescription of the costs of calling mint entry points. - A struct representing a number of
Motes. - Named arguments to a contract.
- A collection of named keys.
- Configuration values associated with the network.
- Next
Upgrade stdInformation about the next protocol upgrade. - Opcode
Costs stdDefinition of a cost table for Wasm opcodes. - Entity definition, metadata, and security container.
- A newtype wrapping a
HashAddrwhich references aPackagein the global state. - Parameter to a method
- Node peer entry.
- Map of peer IDs to network addresses.
- Configuration values associated with the protocol.
- Represents the configuration of a protocol upgrade.
- A newtype wrapping a
SemVerwhich represents a Casper Platform protocol version. - Describes finality signatures that will be rewarded in a block. Consists of a vector of
SingleBlockRewardedSignatures, each of which describes signatures for a single ancestor block. The first entry represents the signatures for the parent block, the second for the parent of the parent, and so on. - Represents a collection of arguments passed to a smart contract.
- A struct for semantic versioning.
- A block and signatures for that block.
- A block header and collection of signatures of a given block.
- List of identifiers for finality signatures for a particular past block.
- Description of the costs of calling standard payment entry points.
- Storage
Costs stdRepresents a cost table for storage costs. - An error struct representing a type mismatch in
StoredValueoperations. - System
Config stdDefinition of costs in the system. - The system entity registry.
- Test
Block Builder stdandtestingA helper to build the blocks with various properties required for tests. - Test
Block V1Builder stdandtestingA helper to build the blocks with various properties required for tests. - A time difference between two timestamps.
- A timestamp type, representing a concrete moment in time.
- Configuration values associated with Transactions.
- Structured limits imposed on a transaction lane
- A unit of work sent by a client to the network, which when executed can cause global state to be altered.
- A builder for constructing
TransactionV1instances with various configuration options. - Configuration values associated with V1 Transactions.
- Error returned when a transaction is too large.
- The cryptographic hash of a
TransactionV1. - A newtype wrapping a
[u8; TRANSFER_ADDR_LENGTH]which is the raw bytes of the transfer address. - Represents a version 1 transfer from one purse to another.
- Represents a version 2 transfer from one purse to another.
- Little-endian large integer type
- Little-endian large integer type
- Little-endian large integer type
- Represents an unforgeable reference, containing an address in the network’s global storage and the
AccessRightsof the reference. - The configuration to determine gas price based on block vacancy.
- Validator account configuration.
- Wasm
Config stdConfiguration of the Wasm execution environment. - Wasm
V1Config stdConfiguration of the Wasm execution environment for V1 execution machine.
Enums§
- The first era to which the associated protocol version applies.
- Identifier for the contract object within a
TransactionTarget::Storedor anExecutableDeployItem. - Errors which can be encountered while running a smart contract.
- A block after execution.
- The versioned body portion of a block. It encapsulates different variants of the BlockBody struct.
- Address for singleton values associated to specific block. These are values which are calculated or set during the execution of a block such as the block timestamp, or the total count of messages emitted during the execution of the block, and so on.
- Serialization tag for BlockGlobalAddr variants.
- The versioned header portion of a block. It encapsulates different variants of the BlockHeader struct.
- Identifier for possible ways to retrieve a block.
- A collection of signatures for a single block, along with the associated block’s hash and era ID.
- An error returned during an attempt to merge two incompatible
BlockSignaturesV1. - An error that can arise when validating a block’s cryptographic integrity using its hashes.
- An address for ByteCode records stored in global state.
- The type of Byte code.
- Casper types, i.e. types which can be stored and manipulated by smart contracts.
- Error relating to
CLValueoperations. - Error validating a chunk with proof.
- Consensus protocol name.
- Errors returned while building a
Deployusing aDeployBuilder. - Error while decoding a
Deployfrom JSON. - Errors other than validation failures relating to
Deploys. - Possible hashing errors.
- The address for an AddressableEntity which contains the 32 bytes and tagging information.
- The type of Package.
- Enum describing the possible access control options for a contract entry point (method).
- The entry point address.
- An enum specifying who pays for the invocation and execution of the entrypoint.
- Context of method execution
- The encaspulated representation of entrypoints.
- The versioned era end of a block, storing the data for a switch block. It encapsulates different variants of the EraEnd struct.
- The executable component of a
Deploy. - Identifier for an
ExecutableDeployItem. - FeeHandling
stdDefines how fees are handled in the system. - A validator’s signature of a block, confirming it is finalized.
- This enum represents possible states of a genesis account.
- Identifier for possible ways to query Global State
- Error loading global state update file.
- Used to indicate if a granted
URefwas already held by the context. - Defines how a given network handles holds when calculating available balances. There may be multiple types of holds (such as Processing and Gas currently, and potentially other kinds in the future), and each type of hold can differ on how it applies to available balance calculation.
- The address of the initiator of a
crate::Transaction. - A representation of the way in which a deploy failed validation checks.
- A representation of the way in which a transaction failed validation checks.
- Returned when a
TransactionV1fails validation. - The key under which data (e.g.
CLValues, smart contracts, user accounts) are stored in global state. - Errors produced when converting a
Stringinto aKey. - Which finality a legacy block needs during a fast sync.
- Error during the construction of a Merkle proof.
- Error validating a Merkle proof of a chunk.
- Identifier for the package object within a
TransactionTarget::Storedor anExecutableDeployItem. - A enum to determine the lock status of the package.
- Parsing error when creating a SemVer.
- The phase in which a given contract is executing.
- Defines what pricing mode a network allows. Correlates to the PricingMode of a
crate::Transaction. Nodes will not accept transactions whose pricing mode does not match. - The pricing mode of a
Transaction. - Errors that can occur when calling PricingMode functions
- Defines how refunds are calculated.
- Rewards distributed to validators.
- An error which can result from validating a
SignedBlockHeader. - A value stored in Global State.
- Tag used to discriminate between different variants of
StoredValue. - A versioned wrapper for a transaction or deploy.
- The arguments of a transaction, which can be either a named set of runtime arguments or a chunked bytes.
- The entry point of a
crate::Transaction. - A versioned wrapper for a transaction hash or deploy hash.
- The identifier of a
crate::TransactionTarget::Stored. - The runtime used to execute a
Transaction. - The scheduling mode of a
crate::Transaction. - The execution target of a
crate::Transaction. - Errors returned while building a
TransactionV1using aTransactionV1Builder. - Error while decoding a
TransactionV1from JSON. - Errors other than validation failures relating to Transactions.
- A versioned wrapper for a transfer.
- Error returned when decoding a
TransferAddrfrom a formatted string. - The various types which can be used as the
targetruntime argument of a native transfer. - The result of a successful transfer between purses.
- Error while parsing a URef from a formatted string.
- A change to a validator’s status between two eras.
- The result of
ProtocolVersion::check_next_version.
Constants§
- The number of bytes in a serialized
AccessRights. - The lane identifier for the native auction interaction.
- The number of bytes in a Blake2b hash
- The number of bytes in a serialized
BlockTime. - DEFAULT_
ADD_ BID_ COST stdandtestingDefault cost of theadd_bidauction entry point. - DEFAULT_
ADD_ COST stdandtestingDefault cost of theaddWasm opcode. - DEFAULT_
BIT_ COST stdandtestingDefault cost of thebitWasm opcode. - DEFAULT_
CONST_ COST stdandtestingDefault cost of theconstWasm opcode. - DEFAULT_
CONTROL_ FLOW_ BLOCK_ OPCODE stdandtestingDefault cost of theblockWasm opcode. - DEFAULT_
CONTROL_ FLOW_ BR_ IF_ OPCODE stdandtestingDefault cost of thebr_ifWasm opcode. - DEFAULT_
CONTROL_ FLOW_ BR_ OPCODE stdandtestingDefault cost of thebrWasm opcode. - DEFAULT_
CONTROL_ FLOW_ BR_ TABLE_ MULTIPLIER stdandtestingDefault multiplier for the size of targets inbr_tableWasm opcode. - DEFAULT_
CONTROL_ FLOW_ BR_ TABLE_ OPCODE stdandtestingDefault fixed cost of thebr_tableWasm opcode. - DEFAULT_
CONTROL_ FLOW_ CALL_ INDIRECT_ OPCODE stdandtestingDefault cost of thecall_indirectWasm opcode. - DEFAULT_
CONTROL_ FLOW_ CALL_ OPCODE stdandtestingDefault cost of thecallWasm opcode. - DEFAULT_
CONTROL_ FLOW_ DROP_ OPCODE stdandtestingDefault cost of thedropWasm opcode. - DEFAULT_
CONTROL_ FLOW_ ELSE_ OPCODE stdandtestingDefault cost of theelseWasm opcode. - DEFAULT_
CONTROL_ FLOW_ END_ OPCODE stdandtestingDefault cost of theendWasm opcode. - DEFAULT_
CONTROL_ FLOW_ IF_ OPCODE stdandtestingDefault cost of theifWasm opcode. - DEFAULT_
CONTROL_ FLOW_ LOOP_ OPCODE stdandtestingDefault cost of theloopWasm opcode. - DEFAULT_
CONTROL_ FLOW_ RETURN_ OPCODE stdandtestingDefault cost of thereturnWasm opcode. - DEFAULT_
CONTROL_ FLOW_ SELECT_ OPCODE stdandtestingDefault cost of theselectWasm opcode. - DEFAULT_
CONVERSION_ COST stdandtestingDefault cost of theconversionWasm opcode. - DEFAULT_
CURRENT_ MEMORY_ COST stdandtestingDefault cost of thecurrent_memoryWasm opcode. - DEFAULT_
DELEGATE_ COST stdandtestingDefault cost of thedelegateauction entry point. - DEFAULT_
DIV_ COST stdandtestingDefault cost of thedivWasm opcode. - Default name for an entry point.
- DEFAULT_
FEE_ HANDLING stdandtestingDefault fee handling. - Default gas hold interval.
- DEFAULT_
GLOBAL_ COST stdandtestingDefault cost of theglobalWasm opcode. - DEFAULT_
GROW_ MEMORY_ COST stdandtestingDefault cost of thegrow_memoryWasm opcode. - Host function cost unit for a new dictionary.
- DEFAULT_
INTEGER_ COMPARISON_ COST stdandtestingDefault cost of theinteger_comparisonWasm opcode. - DEFAULT_
LARGE_ TRANSACTION_ GAS_ LIMIT stdandtestingDefault gas limit of standard transactions - DEFAULT_
LOAD_ COST stdandtestingDefault cost of theloadWasm opcode. - DEFAULT_
LOCAL_ COST stdandtestingDefault cost of thelocalWasm opcode. - DEFAULT_
MAX_ PAYMENT_ MOTES stdandtestingThe default maximum number of motes that payment code execution can cost. - Default value for minimum bid amount in motes.
- DEFAULT_
MIN_ TRANSFER_ MOTES stdandtestingThe default minimum number of motes that can be transferred. - DEFAULT_
MUL_ COST stdandtestingDefault cost of themulWasm opcode. - DEFAULT_
NEW_ DICTIONARY_ COST stdandtestingDefault cost for a new dictionary. - DEFAULT_
NOP_ COST stdandtestingDefault cost of thenopWasm opcode. - Default refund handling.
- DEFAULT_
STORE_ COST stdandtestingDefault cost of thestoreWasm opcode. - DEFAULT_
TRANSFER_ COST stdandtestingDefault cost of thetransfermint entry point. - DEFAULT_
UNREACHABLE_ COST stdandtestingDefault cost of theunreachableWasm opcode. - DEFAULT_
V1_ MAX_ STACK_ HEIGHT stdandtestingDefault maximum stack height. - DEFAULT_
V1_ WASM_ MAX_ MEMORY stdandtestingDefault maximum number of pages of the Wasm memory. - The maximum length for a
dictionary_item_key. - Within each discrete major
ProtocolVersion, entity version resets to this value. - The lane identifier for the install/upgrade auction interaction.
- The number of bytes in a
Key::Dictionary. - The number of bytes in a
Key::Hash. - The lane identifier for large wasms.
- The lane identifier for medium wasms.
- The lane identifier for the native mint interaction.
- The number of bytes in a serialized
Phase. - Length of SemVer when serialized
- The lane identifier for small wasms.
- The length of a version 1 transfer address.
- The number of bytes in a
URefaddress.
Statics§
- OS_
PAGE_ SIZE stdOS page size.
Traits§
- A type which can be described as a
CLType. - GasLimited
stdCalculates gas limit. - The quality of having a tag
Functions§
- cl_
value_ to_ json json-schemaReturns a best-effort attempt to convert theCLValueinto a meaningful JSON value. - Inspects
keyargument whether it contains a dictionary variant, and checks ifstored_valuecontains aCLValue, then it will attempt a conversion from the held clvalue intoDictionaryValueand returns the realCLValueheld by it. - json_
pretty_ print json-schemaSerializes the given data structure as a pretty-printedStringof JSON usingserde_json::to_string_pretty(), but after first reducing any large hex-string values. - Returns the
CLTypedescribing a “named key” on the system, i.e. a(String, Key).
Type Aliases§
- An alias for
Keys dictionary variant. - Automatically incremented value for a contract version within a major
ProtocolVersion. - An alias for
Keys hash variant. - Representation of argument’s cost.
- An alias for
Keys package variant. - Collection of entry point parameters.
- The result of an attempt to transfer between purses.
- The address of a
URef(unforgeable reference) on the network.