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::Displayandstd::str::FromStrviaFormat.
Structs§
- BTree
Set - An ordered set based on a B-Tree.
- Batched
Tx - 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.
- CtxPost
Storage Read - Read access to the posterior storage (state after tx execution) via
StorageRead. - CtxPre
Storage Read - 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.
- KeyVal
Iterator - Storage key-val pair iterator
- Tx
- A Namada transaction is represented as a header followed by a series of sections providing additional details.
- Verify
SigGadget - Utility to minimize signature verification ops.
Enums§
- Address
- An account’s address
- Decode
Error - 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§
- Borsh
Deserialize - A data-structure that can be de-serialized from binary format by NBOR.
- Borsh
Serialize - A data-structure that can be serialized into binary format by NBOR.
- Borsh
Serialize Ext - Extensions to types implementing
BorshSerialize. - Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
- Option
Ext - An extension to
Optionto allow turningNonecase to an Error from a static string (handy for WASM). - Result
Ext - Result extension to easily wrap custom errors into
Error. - Storage
Read - Common storage read interface
- VpEnv
- Validity predicate’s environment is available for native VPs and WASM VPs
- VpError
ExtResult - 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.
- VpEnv
Result - Result of
VpEnvornamada_storage::StorageReadmethod call - VpResult
- Validity predicate result
Attribute Macros§
- validity_
predicate - Generate WASM binding for validity predicate main entrypoint function.