Crate casper_types

Source
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 ApiError and 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§

AccessRights
A struct which behaves like a set of bitflags to define access rights associated with a URef.
BlockTime
A newtype wrapping a u64 which represents the block time.
CLTypeMismatch
Error while converting a CLValue into a given type.
CLValue
A Casper value, i.e. a value which can be stored and manipulated by smart contracts.
ContextAccessRights
Access rights for a given runtime context.
Contract
Methods and type signatures supported by a contract.
ContractHash
A newtype wrapping a HashAddr which references a Contract in the global state.
ContractPackage
Contract definition, metadata, and security container.
ContractPackageHash
A newtype wrapping a HashAddr which references a ContractPackage in the global state.
ContractVersionKey
Major element of ProtocolVersion combined with ContractVersion.
ContractWasm
A container for contract’s WASM bytes.
ContractWasmHash
A newtype wrapping a HashAddr which is the raw bytes of the ContractWasmHash
DeployHash
A newtype wrapping a [u8; DEPLOY_HASH_LENGTH] which is the raw bytes of the deploy hash.
DeployInfo
Information relating to the given Deploy.
EntryPoint
Type signature of a method. Order of arguments matter since can be referenced by index as well as name.
EntryPoints
Collection of named entry points
EraId
Era ID newtype.
ExecutionEffect
The journal of execution transforms from a single deploy.
Gas
The Gas struct represents a U512 amount 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.
NamedArg
Named arguments to a contract.
NamedKey
A named key.
Operation
An operation performed while executing a deploy.
Parameter
Parameter to a method
ProtocolVersion
A newtype wrapping a SemVer which represents a Casper Platform protocol version.
RuntimeArgs
Represents a collection of arguments passed to a smart contract.
SemVer
A struct for semantic versioning.
StoredValueTypeMismatch
An error struct representing a type mismatch in StoredValue operations.
TimeDiff
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
TransferAddr
A newtype wrapping a [u8; TRANSFER_ADDR_LENGTH] which is the raw bytes of the transfer address.
TransformEntry
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 AccessRights of 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.
CLValueError
Error relating to CLValue operations.
EntryPointAccess
Enum describing the possible access control options for a contract entry point (method).
EntryPointType
Context of method execution
ExecutionResult
The result of executing a single deploy.
GrantedAccess
Used to indicate if a granted URef was already held by the context.
Key
The type under which data (e.g. CLValues, smart contracts, user accounts) are indexed on the network.
KeyFromStrError
Errors produced when converting a String into a Key.
KeyTag
OpKind
The type of operation performed while executing a deploy.
ParseSemVerError
Parsing error when creating a SemVer.
Phase
The phase in which a given contract is executing.
StoredValue
StoredValue represents all possible variants of values stored in Global State.
TransferFromStrError
Error returned when decoding a TransferAddr from a formatted string.
TransferredTo
The result of a successful transfer between purses.
Transform
The actual transformation performed while executing a deploy.
UIntParseError
Error type for parsing U128, U256, U512 from a string.
URefFromStrError
Error while parsing a URef from a formatted string.
VersionCheckResult
The result of ProtocolVersion::check_next_version.

Constants§

ACCESS_RIGHTS_SERIALIZED_LENGTH
The number of bytes in a serialized AccessRights.
BLAKE2B_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 URef address.
UREF_SERIALIZED_LENGTH
The number of bytes in a serialized URef where the AccessRights are not None.

Traits§

CLTyped
A type which can be described as a CLType.
Tagged
The quality of having a tag

Functions§

json_pretty_print
Serializes the given data structure as a pretty-printed String of JSON using serde_json::to_string_pretty(), but after first reducing any large hex-string values.
named_key_type
Returns the CLType describing a “named key” on the system, i.e. a (String, Key).

Type Aliases§

ContractVersion
Automatically incremented value for a contract version within a major ProtocolVersion.
DictionaryAddr
An alias for Keys dictionary variant.
HashAddr
An alias for Keys hash variant.
TransferResult
The result of an attempt to transfer between purses.
URefAddr
The address of a URef (unforgeable reference) on the network.