Module utils

Module utils 

Source

Modules§

min_heap

Structs§

DisplayOption
A wrapper around Option that provides native Display trait. Simplifies propagating automatic Display trait on parent structs.
MaybeValidated
A data structure for tagging data as already being validated to prevent redundant work.
Serializable

Functions§

account_is_valid
From unc-account-id version 0.7.2, is_valid returns true for ETH-implicit accounts. This function is a wrapper for is_valid method so that we can easily differentiate its behavior based on whether ETH-implicit accounts are enabled.
create_action_hash
Creates a new action_hash from a given receipt, a block hash and an action index. This method is backward compatible, so it takes the current protocol version.
create_data_id
Creates a new data_id from a given action hash, a block hash and a data index. This method is backward compatible, so it takes the current protocol version.
create_random_seed
Creates a unique random seed to be provided to VMContext from a give action_hash and a given random_seed. This method is backward compatible, so it takes the current protocol version.
create_receipt_id_from_receipt
Creates a new Receipt ID from a given receipt, a block hash and a new receipt index. This method is backward compatible, so it takes the current protocol version.
create_receipt_id_from_transaction
Creates a new Receipt ID from a given signed transaction and a block hash. This method is backward compatible, so it takes the current protocol version.
derive_eth_implicit_account_id
Returns ‘0x’ + keccak256(public_key)[12:32].hex(). This is an ETH-implicit account ID which can be controlled by the corresponding Secp256K1 private key.
derive_unc_account_id
Returns hex-encoded copy of the public key. This is a unc-implicit account ID which can be controlled by the corresponding ED25519 private key.
from_timestamp
Converts timestamp in ns into DateTime UTC time.
generate_random_string
Generate random string of given length
get_block_shard_id
get_block_shard_id_rev
get_num_seats_per_shard
Compute number of seats per shard for given total number of seats and number of shards.
get_outcome_id_block_hash
get_outcome_id_block_hash_rev
index_to_bytes
ser
Wrap an object that implements Serialize into another object that implements Display. When used display in this object it shows its json representation. It is used to display complex objects using tracing.
to_timestamp
Converts DateTime UTC time into timestamp in ns.