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. More...
 

Public Attributes

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

Detailed Description

Mocked account.

Definition at line 50 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 68 of file mocked_host.hpp.

69 {
71 for (std::size_t i = 0; i < sizeof(x); ++i)
72 balance.bytes[sizeof(balance) - 1 - i] = static_cast<uint8_t>(x >> (8 * i));
73 }
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:62
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 62 of file mocked_host.hpp.

◆ code

bytes evmc::MockedAccount::code

The account code.

Definition at line 56 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 59 of file mocked_host.hpp.

◆ nonce

int evmc::MockedAccount::nonce = 0

The account nonce.

Definition at line 53 of file mocked_host.hpp.

◆ storage

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

The account storage map.

Definition at line 65 of file mocked_host.hpp.


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