Struct near_chain::test_utils::KeyValueRuntime[][src]

pub struct KeyValueRuntime { /* fields omitted */ }
Expand description

Simple key value runtime for tests.

Implementations

Trait Implementations

Get store and genesis state roots

Returns trie. Since shard layout may change from epoch to epoch, shard_id itself is not enough to identify the trie. prev_hash is used to identify the epoch the given shard_id is at. Read more

Returns trie with view cache

Verify validator signature for the given epoch. Note: doesnt’t account for slashed accounts within given epoch. USE WITH CAUTION. Read more

Verify header signature.

Verify aggregated bls signature

Epoch block producers ordered by their order in the proposals. Returns error if height is outside of known boundaries. Read more

Block producers for given height for the main block. Return error if outside of known boundaries.

Chunk producer for given height for given shard. Return error if outside of known boundaries.

Get current number of shards.

Get shard layout given hash of previous block.

Account Id to Shard Id mapping, given current number of shards.

Returns account_id that suppose to have the part_id of all chunks given previous block hash.

Whether the client cares about some shard right now. Read more

Whether the client cares about some shard in the next epoch. Read more

Validates a given signed transaction. If the state root is given, then the verification will use the account. Otherwise it will only validate the transaction math, limits and signatures. Returns an option of InvalidTxError, it contains Some(InvalidTxError) if there is a validation error, or None in case the transaction succeeded. Throws an Error with ErrorKind::StorageError in case the runtime throws RuntimeError::StorageError. Read more

Returns an ordered list of valid transactions from the pool up the given limits. Pulls transactions from the given pool iterators one by one. Validates each transaction against the given chain_validate closure and runtime’s transaction verifier. If the transaction is valid for both, it’s added to the result and the temporary state update is preserved for validation of next transactions. Throws an Error with ErrorKind::StorageError in case the runtime throws RuntimeError::StorageError. Read more

Epoch Manager init procedure that is necessary after Epoch Sync.

Add proposals for validators.

Query runtime with given path and data.

Get the part of the state from given state root. block_hash is a block whose prev_state_root is state_root Read more

Validate state part that expected to be given state root with provided data. Returns false if the resulting part doesn’t match the expected one. Read more

Should be executed after accepting all the parts to set up a new state.

Returns StateRootNode of a state. block_hash is a block whose prev_state_root is state_root Panics if requested hash is not in storage. Never returns Error Read more

Validate StateRootNode of a state.

Returns true, if given hash is last block in it’s epoch.

Get epoch id given hash of previous block.

Get next epoch id given hash of previous block.

Get epoch start for given block hash.

Get the block height for which garbage collection should not go over

Check if epoch exists.

Amount of tokens minted in given epoch.

Data that is necessary for prove Epochs in Epoch Sync.

Hash that is necessary for prove Epochs in Epoch Sync.

Epoch active protocol version.

Verify signature for validator or fisherman. Used for validating challenges.

Get previous epoch id by hash of previous block.

Returns true if the shard layout will change in the next epoch Current epoch is the epoch of the block after parent_hash Read more

Verify chunk header signature.

Apply transactions to given state root and return store update and new state root. Also returns transaction result for each transaction and new receipts. Read more

Build receipts hashes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more