Crate namada_vp_prelude

Crate namada_vp_prelude 

Source
Expand description

This crate contains library code for validity predicate WASM. Most of the code is re-exported from the namada_vm_env crate.

Re-exports§

pub use namada_account as account;
pub use namada_parameters as parameters;
pub use namada_proof_of_stake as proof_of_stake;
pub use namada_token as token;
pub use namada_tx as tx;

Modules§

address
Implements transparent addresses as described in Accounts Addresses.
arith
Arithmetics helpers
booleans
Boolean related functionality.
borsh
Borsh binary encoding (re-exported) from official crate with custom ext.
bytes
Bytes hex formatting
chain
Chain related data types
collection_validation
Storage change validation helpers
collections
Re-exports of collection types.
dec
A non-negative fixed precision decimal type.
eth_abi
This module defines encoding methods compatible with Ethereum smart contracts.
eth_bridge_pool
The necessary type definitions for the contents of the Ethereum bridge pool
ethereum_events
Types representing data intended for Namada via Ethereum events
ethereum_structs
Ethereum bridge struct re-exports and types to do with ethereum.
gov_storage
governance storage Governance storage
hash
Types for working with 32 bytes hashes.
hints
Compiler hints, to improve the performance of certain operations.
ibc
IBC events and storage keys.
internal
Shared internal types between the host env and guest (wasm).
keccak
This module is for hashing Namada types using the keccak256 hash function in a way that is compatible with smart contracts on Ethereum.
key
Cryptographic keys
masp
MASP types
masp_primitives
General MASP primitives.
pgf_storage
PGF storage Pgf
storage
Storage types
string_encoding
Namada’s standard string encoding for public types.
tendermint
Re-export of tendermint v0.37
tendermint_proto
Re-export of tendermint-proto v0.37
time
Types for dealing with time and durations.
uint
An unsigned 256 integer type. Used for, among other things, the backing type of token amounts.
validity_predicate
Types that are used in validity predicates.
voting_power
This module contains types related with validator voting power calculations.

Macros§

debug_log
Format and log a string in a debug build.
impl_display_and_from_str_via_format
Implement std::fmt::Display and std::str::FromStr via Format.

Structs§

BTreeSet
An ordered set based on a B-Tree.
BatchedTx
A transaction with the commitment to a specific inner transaction of the batch
Ctx
VP execution context provides access to storage prior and posterior to the transaction execution and host environment functions.
CtxPostStorageRead
Read access to the posterior storage (state after tx execution) via StorageRead.
CtxPreStorageRead
Read access to the prior storage (state before tx execution) via StorageRead.
HashSet
A hash set where the iteration order of the values is independent of their hash values.
KeyValIterator
Storage key-val pair iterator
Tx
A Namada transaction is represented as a header followed by a series of sections providing additional details.
VerifySigGadget
Utility to minimize signature verification ops.

Enums§

Address
An account’s address
DecodeError
Error
Section
A section of a transaction. Carries an independent piece of information necessary for the processing of a transaction.
VpError
Error result returned by validity predicates.

Traits§

BorshDeserialize
A data-structure that can be de-serialized from binary format by NBOR.
BorshSerialize
A data-structure that can be serialized into binary format by NBOR.
BorshSerializeExt
Extensions to types implementing BorshSerialize.
Digest
Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
OptionExt
An extension to Option to allow turning None case to an Error from a static string (handy for WASM).
ResultExt
Result extension to easily wrap custom errors into Error.
StorageRead
Common storage read interface
VpEnv
Validity predicate’s environment is available for native VPs and WASM VPs
VpErrorExtResult
Helper trait for converting between result types.

Functions§

accept
Accept a transaction
consensus_version
Get the current consensus version
decode
Decode a value with borsh
encode
Encode a value with borsh
is_proposal_accepted
Checks if a proposal id is being executed
iter_prefix
Iterate Borsh encoded items matching the given prefix, ordered by the storage keys.
iter_prefix_bytes
Iterate items matching the given prefix, ordered by the storage keys.
log_string
Log a string. The message will be printed at the tracing::Level::Info.
reject
Reject a transaction
sha256
SHA-256 hash of given bytes

Type Aliases§

Sha256
SHA-256 hasher.
Sha384
SHA-384 hasher.
Sha512
SHA-512 hasher.
VpEnvResult
Result of VpEnv or namada_storage::StorageRead method call
VpResult
Validity predicate result

Attribute Macros§

validity_predicate
Generate WASM binding for validity predicate main entrypoint function.

Derive Macros§

BorshDeserialize

BorshSerialize