EVMC
evmc::MockedAccount Struct Reference

Mocked account. More...

#include <mocked_host.hpp>

Public Member Functions

void set_balance (uint64_t x) noexcept
 Helper method for setting balance by numeric type.
 

Public Attributes

int nonce = 0
 The account nonce.
 
bytes code
 The account code.
 
bytes32 codehash
 The code hash. Can be a value not related to the actual code.
 
uint256be balance
 The account balance.
 
std::unordered_map< bytes32, StorageValuestorage
 The account storage map.
 
std::unordered_map< bytes32, bytes32transient_storage
 The account transient storage.
 

Detailed Description

Mocked account.

Definition at line 48 of file mocked_host.hpp.

Member Function Documentation

◆ set_balance()

void evmc::MockedAccount::set_balance ( uint64_t  x)
inlinenoexcept

Helper method for setting balance by numeric type.

Definition at line 69 of file mocked_host.hpp.

70 {
72 for (std::size_t i = 0; i < sizeof(x); ++i)
73 balance.bytes[sizeof(balance) - 1 - i] = static_cast<uint8_t>(x >> (8 * i));
74 }
bytes32 uint256be
The alias for evmc::bytes32 to represent a big-endian 256-bit integer.
Definition: evmc.hpp:127
uint256be balance
The account balance.
Definition: mocked_host.hpp:60
uint8_t bytes[32]
The 32 bytes.
Definition: evmc.h:59

Member Data Documentation

◆ balance

uint256be evmc::MockedAccount::balance

The account balance.

Definition at line 60 of file mocked_host.hpp.

◆ code

bytes evmc::MockedAccount::code

The account code.

Definition at line 54 of file mocked_host.hpp.

◆ codehash

bytes32 evmc::MockedAccount::codehash

The code hash. Can be a value not related to the actual code.

Definition at line 57 of file mocked_host.hpp.

◆ nonce

int evmc::MockedAccount::nonce = 0

The account nonce.

Definition at line 51 of file mocked_host.hpp.

◆ storage

std::unordered_map<bytes32, StorageValue> evmc::MockedAccount::storage

The account storage map.

Definition at line 63 of file mocked_host.hpp.

◆ transient_storage

std::unordered_map<bytes32, bytes32> evmc::MockedAccount::transient_storage

The account transient storage.

Definition at line 66 of file mocked_host.hpp.


The documentation for this struct was generated from the following file: