Module near_primitives::utils[][src]

Structs

DisplayOption

A wrapper around Option that provides native Display trait. Simplifies propagating automatic Display trait on parent structs.

Serializable

Enums

MaybeValidated

A data structure for tagging data as already being validated to prevent redundant work.

Functions

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.

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.

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.

system_account

This is duplicate of near_runtime_utils::system_account. TODO: code that uses this system_account should be moved into runtime and depend on it.

to_timestamp

Converts DateTime UTC time into timestamp in ns.