[][src]Crate casper_types

Types used to allow creation of Wasm contracts and tests for use on the Casper Platform.

no_std

By default, the library is no_std, however you can enable full std functionality by enabling the crate's std feature.

Re-exports

pub use contracts::Contract;
pub use contracts::ContractPackage;
pub use contracts::ContractVersion;
pub use contracts::ContractVersionKey;
pub use contracts::EntryPoint;
pub use contracts::EntryPointAccess;
pub use contracts::EntryPointType;
pub use contracts::EntryPoints;
pub use contracts::Group;
pub use contracts::Parameter;
pub use runtime_args::NamedArg;
pub use runtime_args::RuntimeArgs;
pub use system_contract_type::SystemContractType;

Modules

account

Contains types and constants associated with user accounts.

api_error

Contains ApiError and associated helper functions.

auction

Contains implementation of a Auction contract functionality.

bytesrepr

Contains serialization and deserialization code for types used throughout the system.

contracts

Data types for supporting contract headers feature.

mint

Contains implementation of a Mint contract functionality.

proof_of_stake

Contains implementation of a Proof Of Stake contract functionality.

runtime_args

Home of RuntimeArgs for calling contracts

standard_payment

Contains implementation of a standard payment contract implementation.

system_contract_errors

Home of error types returned by system contracts.

system_contract_type

Home of system contract type enum.

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.

ContractWasm

A container for contract's WASM bytes.

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.

ExecutionEffect

The effect of executing a single deploy.

NamedKey

A named key.

Operation

An operation performed while executing a deploy.

ProtocolVersion

A newtype wrapping a SemVer which represents a Casper Platform protocol version.

Secp256k1Bytes

Represents the bytes of a secp256k1 public key.

SemVer

A struct for semantic versioning.

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.

ExecutionResult

The result of executing a single deploy.

Key

The type under which data (e.g. CLValues, smart contracts, user accounts) are indexed on the network.

OpKind

The type of operation performed while executing a deploy.

Phase

The phase in which a given contract is executing.

PublicKey

Simplified raw data type

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.

ED25519_PUBLIC_KEY_LENGTH

Length of a ED25519 PublicKey.

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.

Functions

named_key_type

Returns the CLType describing a "named key" on the system, i.e. a (String, Key).

Type Definitions

ContractHash

An alias for Keys hash variant.

ContractPackageHash

An alias for Keys hash variant.

ContractWasmHash

An alias for Keys hash variant.

HashAddr

An alias for Keys hash variant.

TransferResult

The result of an attempt to transfer between purses.