OpenCBDC Transaction Processor
|
Data Structures | |
struct | code_key |
struct | evm_access_tuple |
Type for tracking storage key accesses between accounts. More... | |
struct | evm_account |
EVM account type. More... | |
struct | evm_dryrun_tx |
Dry-run EVM transaction type. More... | |
class | evm_host |
Implementation of the evmc::Host interface using PARSEC as the backend database. More... | |
struct | evm_log |
EVM log output type. More... | |
struct | evm_log_index |
Index data for evm logs. More... | |
struct | evm_log_query |
Describes the parameters of a query on EVM logs - used to transfer these parameters from the getLogs API method to the runner. More... | |
struct | evm_pretend_block |
EVM pretend block is a pairing of the blocknumber (equal to the ticket number) and the transactions (currently always a single one) "inside
the block" (executed by that ticket) More... | |
class | evm_runner |
Executes EVM transactions, implementing the runner interface. More... | |
struct | evm_sig |
EVM signature type. More... | |
struct | evm_tx |
EVM transaction type. More... | |
struct | evm_tx_receipt |
EVM transaction receipt type. More... | |
class | factory |
Runner factory for agents to intiantiate new runners of a particular type while only worrying about the runner interface. More... | |
class | interface |
Interface for a contract runner. More... | |
class | lua_runner |
Lua function executor. More... | |
struct | storage_key |
Type for account storage keys. More... | |
Typedefs | |
using | evm_account_code = std::vector<uint8_t> |
Type alias for EVM account code. | |
using | evm_access_list = std::vector<evm_access_tuple> |
Type alias for a list of storage key accesses. | |
Enumerations | |
enum class | evm_runner_function : uint8_t { execute_transaction , read_account , dryrun_transaction , read_account_code , get_transaction , get_transaction_receipt , get_block_number , get_block , get_logs , read_account_storage } |
Commands accepted by the EVM contract runner. More... | |
enum class | evm_tx_type : uint8_t { legacy = 0 , access_list = 1 , dynamic_fee = 2 } |
EVM transaction types. More... | |
Functions | |
auto | contract_address (const evmc::address &sender, const evmc::uint256be &nonce) -> evmc::address |
Calculates a contract address for the CREATE call keccak256(rlp([sender,nonce])) | |
auto | contract_address2 (const evmc::address &sender, const evmc::bytes32 &salt, const cbdc::hash_t &bytecode_hash) -> evmc::address |
Calculates a contract address for the CREATE2 call keccak256(0xFF | sender | salt | keccak256(bytecode)) | |
auto | eth_addr (const std::unique_ptr< secp256k1_pubkey > &pk, const std::shared_ptr< secp256k1_context > &ctx) -> evmc::address |
Calculates an eth address from a public key. | |
auto | eth_addr (const cbdc::privkey_t &key, const std::shared_ptr< secp256k1_context > &ctx) -> evmc::address |
Calculates an eth address from a private key. | |
auto | operator+ (const evmc::uint256be &lhs, const evmc::uint256be &rhs) -> evmc::uint256be |
Adds two uint256be values. | |
auto | operator- (const evmc::uint256be &lhs, const evmc::uint256be &rhs) -> evmc::uint256be |
Subtracts two uint256be values. | |
auto | operator* (const evmc::uint256be &lhs, const evmc::uint256be &rhs) -> evmc::uint256be |
Multiplies two uint256be values. | |
auto | operator<< (const evmc::uint256be &lhs, size_t count) -> evmc::uint256be |
Left shifts a uint256be value by a given number of bytes. | |
auto | tx_id (const cbdc::parsec::agent::runner::evm_tx &tx, uint64_t chain_id=opencbdc_chain_id) -> cbdc::hash_t |
Calculate ethereum-compatible txid. | |
auto | is_valid_rlp_tx (evm_tx_type type, const rlp_value &rlp_tx) -> bool |
auto | check_tx_decode (const cbdc::buffer &buf, const std::shared_ptr< logging::log > &logger, const std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > &tx) -> std::optional< rlp_value > |
auto | tx_decode (const cbdc::buffer &buf, const std::shared_ptr< logging::log > &logger, uint64_t chain_id=opencbdc_chain_id) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > > |
Converts a given buffer to an evm_tx. | |
auto | tx_encode (const cbdc::parsec::agent::runner::evm_tx &tx, uint64_t chain_id=opencbdc_chain_id, bool for_sighash=false) -> cbdc::buffer |
Converts the given transaction to an RLP encoded buffer conforming to Ethereums conventions. | |
auto | dryrun_tx_from_json (const Json::Value &json, uint64_t chain_id=opencbdc_chain_id) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_dryrun_tx > > |
Converts a given Json::Value to an evm_dryrun_tx. | |
auto | address_from_json (const Json::Value &addr) -> std::optional< evmc::address > |
Converts a given Json::Value to an evmc::address. | |
auto | uint256be_from_json (const Json::Value &val) -> std::optional< evmc::uint256be > |
Converts a given Json::Value to an evmc::uint256be. | |
auto | buffer_from_json (const Json::Value &val) -> std::optional< cbdc::buffer > |
Converts a given Json::Value to a cbdc::buffer. | |
auto | uint256be_or_default (const Json::Value &val, evmc::uint256be def) -> evmc::uint256be |
Converts a given Json::Value to an evmc::uint256be, returning a default value if none could be decoded. | |
auto | raw_tx_from_json (const Json::Value ¶m) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > > |
Converts a given Json::Value to an evm_tx. | |
auto | tx_from_json (const Json::Value &json, uint64_t chain_id=opencbdc_chain_id) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > > |
Converts a given Json::Value to an evm_tx. | |
auto | tx_to_json (cbdc::parsec::agent::runner::evm_tx &tx, const std::shared_ptr< secp256k1_context > &ctx) -> Json::Value |
Encodes the given transaction into a eth-RPC compatible representation in JSON - as Json::Value. | |
auto | tx_receipt_to_json (cbdc::parsec::agent::runner::evm_tx_receipt &rcpt, const std::shared_ptr< secp256k1_context > &ctx) -> Json::Value |
Encodes the given transaction receipt into a eth-RPC compatible representation in JSON - as Json::Value. | |
auto | tx_log_to_json (cbdc::parsec::agent::runner::evm_log &log, interface::ticket_number_type tn, cbdc::hash_t txid) -> Json::Value |
Encodes the given transaction log into a eth-RPC compatible representation in JSON - as Json::Value. | |
auto | access_list_to_json (cbdc::parsec::agent::runner::evm_access_list &al) -> Json::Value |
Encodes the given access list into a eth-RPC compatible representation in JSON - as Json::Value. | |
auto | secp256k1_ecdsa_recoverable_signature_to_evm_sig (secp256k1_ecdsa_recoverable_signature &sig, evm_tx_type type, uint64_t chain_id) -> evm_sig |
auto | evm_sig_to_secp256k1_ecdsa_recoverable_signature (const evm_sig &esig, evm_tx_type type, uint64_t chain_id) -> std::optional< secp256k1_ecdsa_recoverable_signature > |
auto | eth_sign (const privkey_t &key, hash_t &hash, evm_tx_type type, const std::shared_ptr< secp256k1_context > &ctx, uint64_t chain_id=opencbdc_chain_id) -> evm_sig |
Signs a hash using a privkey_t using ecdsa and produces an evm_sig struct Used primarily in unit tests for signature checking. | |
auto | check_signature (const cbdc::parsec::agent::runner::evm_tx &tx, const std::shared_ptr< secp256k1_context > &ctx, uint64_t chain_id=opencbdc_chain_id) -> std::optional< evmc::address > |
Checks the signature of an EVM transaction. | |
auto | sig_hash (const cbdc::parsec::agent::runner::evm_tx &tx, uint64_t chain_id=opencbdc_chain_id) -> hash_t |
Calculates the hash for creating / validating the signature. | |
auto | to_uint64 (const evmc::uint256be &v) -> uint64_t |
Converts an uint256be to a uint64_t, ignoring higher order bits. | |
auto | to_hex (const evmc::address &addr) -> std::string |
auto | to_hex (const evmc::bytes32 &b) -> std::string |
auto | to_hex_trimmed (const evmc::bytes32 &b, const std::string &prefix) -> std::string |
void | add_to_bloom (cbdc::buffer &bloom, const cbdc::buffer &entry) |
Adds an entry to a bloom value. | |
auto | uint256be_from_hex (const std::string &hex) -> std::optional< evmc::uint256be > |
Generates a uint256be from a hex string. | |
auto | mint_initial_accounts (const std::shared_ptr< logging::log > &log, const std::shared_ptr< parsec::broker::interface > &broker) -> bool |
Mints a set of initial accounts with funds, bypassing the agent. | |
template<typename T > | |
auto | to_hex (const T &v) -> std::string |
Converts a bytes-like object to a hex string. | |
template<typename T > | |
auto | from_hex (const std::string &hex) -> typename std::enable_if_t< std::is_same< T, evmc::bytes32 >::value||std::is_same< T, evmc::address >::value, std::optional< T > > |
Parses hexadecimal representation in string format to T. | |
using cbdc::parsec::agent::runner::evm_access_list = std::vector<evm_access_tuple> |
Type alias for a list of storage key accesses.
Definition at line 56 of file parsec/agent/runners/evm/messages.hpp.
using cbdc::parsec::agent::runner::evm_account_code = std::vector<uint8_t> |
Type alias for EVM account code.
Definition at line 36 of file parsec/agent/runners/evm/messages.hpp.
|
strong |
Commands accepted by the EVM contract runner.
Definition at line 19 of file agent/runners/evm/impl.hpp.
|
strong |
EVM transaction types.
Enumerator | |
---|---|
legacy | |
access_list | |
dynamic_fee |
Definition at line 59 of file parsec/agent/runners/evm/messages.hpp.
auto cbdc::parsec::agent::runner::access_list_to_json | ( | cbdc::parsec::agent::runner::evm_access_list & | al | ) | -> Json::Value |
Encodes the given access list into a eth-RPC compatible representation in JSON - as Json::Value.
al | The access list to represent as json |
Definition at line 464 of file parsec/agent/runners/evm/serialization.cpp.
References to_hex().
Referenced by tx_to_json().
void cbdc::parsec::agent::runner::add_to_bloom | ( | cbdc::buffer & | bloom, |
const cbdc::buffer & | entry ) |
Adds an entry to a bloom value.
bloom | the existing bloom value |
entry | the entry to add |
Definition at line 58 of file agent/runners/evm/util.cpp.
References cbdc::buffer, cbdc::buffer::data(), cbdc::buffer::data_at(), cbdc::from_buffer(), cbdc::keccak_data(), cbdc::make_buffer(), and cbdc::buffer::size().
Referenced by tx_receipt_to_json().
auto cbdc::parsec::agent::runner::address_from_json | ( | const Json::Value & | addr | ) | -> std::optional< evmc::address > |
Converts a given Json::Value to an evmc::address.
addr | Json::Value containing the address to decode. Is expected to be a string in 0x... format |
Definition at line 226 of file parsec/agent/runners/evm/serialization.cpp.
References cbdc::from_buffer(), and cbdc::buffer::from_hex().
Referenced by dryrun_tx_from_json(), and tx_from_json().
auto cbdc::parsec::agent::runner::buffer_from_json | ( | const Json::Value & | val | ) | -> std::optional< cbdc::buffer > |
Converts a given Json::Value to a cbdc::buffer.
val | Json::Value containing the buffer to decode. Is expected to be a string in 0x... format containing valid hexadecimal representation of the buffer |
Definition at line 258 of file parsec/agent/runners/evm/serialization.cpp.
References cbdc::buffer::from_hex().
Referenced by tx_from_json(), and uint256be_from_json().
auto cbdc::parsec::agent::runner::check_signature | ( | const cbdc::parsec::agent::runner::evm_tx & | tx, |
const std::shared_ptr< secp256k1_context > & | ctx, | ||
uint64_t | chain_id = opencbdc_chain_id ) -> std::optional< evmc::address > |
Checks the signature of an EVM transaction.
tx | transaction to check signature for |
chain_id | chain_id for which the transaction is meant |
ctx | secp256k1 context to use |
Definition at line 104 of file signature.cpp.
References eth_addr(), evm_sig_to_secp256k1_ecdsa_recoverable_signature(), and sig_hash().
Referenced by tx_to_json().
auto cbdc::parsec::agent::runner::check_tx_decode | ( | const cbdc::buffer & | buf, |
const std::shared_ptr< logging::log > & | logger, | ||
const std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > & | tx ) -> std::optional<rlp_value> |
Definition at line 47 of file parsec/agent/runners/evm/serialization.cpp.
References cbdc::buffer, cbdc::from_buffer(), and is_valid_rlp_tx().
Referenced by tx_decode().
auto cbdc::parsec::agent::runner::contract_address | ( | const evmc::address & | sender, |
const evmc::uint256be & | nonce ) -> evmc::address |
Calculates a contract address for the CREATE call keccak256(rlp([sender,nonce]))
sender | the sender account creating the contract |
nonce | the account nonce of the sender at the time of creation |
Definition at line 20 of file address.cpp.
References cbdc::keccak_data(), cbdc::make_buffer(), cbdc::make_rlp_array(), and cbdc::make_rlp_value().
auto cbdc::parsec::agent::runner::contract_address2 | ( | const evmc::address & | sender, |
const evmc::bytes32 & | salt, | ||
const cbdc::hash_t & | bytecode_hash ) -> evmc::address |
Calculates a contract address for the CREATE2 call keccak256(0xFF | sender | salt | keccak256(bytecode))
sender | the sender account creating the contract |
salt | the salt value |
bytecode_hash | the keccak256 hash of the bytecode of the contract |
Definition at line 33 of file address.cpp.
References cbdc::buffer, and cbdc::keccak_data().
auto cbdc::parsec::agent::runner::dryrun_tx_from_json | ( | const Json::Value & | json, |
uint64_t | chain_id = opencbdc_chain_id ) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_dryrun_tx > > |
Converts a given Json::Value to an evm_dryrun_tx.
json | Json::Value containing the transaction to decode |
chain_id | the expected chain ID for the transaction. If the transaction contains a different chain ID this method will return std::nullopt |
Definition at line 208 of file parsec/agent/runners/evm/serialization.cpp.
References address_from_json(), and tx_from_json().
auto cbdc::parsec::agent::runner::eth_addr | ( | const cbdc::privkey_t & | key, |
const std::shared_ptr< secp256k1_context > & | ctx ) -> evmc::address |
Calculates an eth address from a private key.
key | key to calculate the address for |
ctx | secp256k1 context to use |
Definition at line 87 of file address.cpp.
References eth_addr().
auto cbdc::parsec::agent::runner::eth_addr | ( | const std::unique_ptr< secp256k1_pubkey > & | pk, |
const std::shared_ptr< secp256k1_context > & | ctx ) -> evmc::address |
Calculates an eth address from a public key.
pk | key to calculate the address for |
ctx | secp256k1 context to use |
Definition at line 56 of file address.cpp.
References cbdc::buffer, and cbdc::keccak_data().
Referenced by check_signature(), and eth_addr().
auto cbdc::parsec::agent::runner::eth_sign | ( | const privkey_t & | key, |
hash_t & | hash, | ||
evm_tx_type | type, | ||
const std::shared_ptr< secp256k1_context > & | ctx, | ||
uint64_t | chain_id = opencbdc_chain_id ) -> evm_sig |
Signs a hash using a privkey_t using ecdsa and produces an evm_sig struct Used primarily in unit tests for signature checking.
key | key to sign with |
hash | hash to sign |
type | the transaction type |
ctx | secp256k1 context to use |
chain_id | the chain_id we are signing for (defaults to opencbdc) |
Definition at line 85 of file signature.cpp.
References secp256k1_ecdsa_recoverable_signature_to_evm_sig().
auto cbdc::parsec::agent::runner::evm_sig_to_secp256k1_ecdsa_recoverable_signature | ( | const evm_sig & | esig, |
evm_tx_type | type, | ||
uint64_t | chain_id ) -> std::optional<secp256k1_ecdsa_recoverable_signature> |
Definition at line 54 of file signature.cpp.
References legacy, and to_uint64().
Referenced by check_signature().
auto cbdc::parsec::agent::runner::from_hex | ( | const std::string & | hex | ) | -> typename std::enable_if_t<std::is_same<T, evmc::bytes32>::value || std::is_same<T, evmc::address>::value, std::optional<T>> |
Parses hexadecimal representation in string format to T.
T | type to convert from hex to. |
hex | hex string to parse. May be prefixed with 0x |
Definition at line 54 of file parsec/agent/runners/evm/util.hpp.
References cbdc::buffer::from_hex_prefixed().
auto cbdc::parsec::agent::runner::is_valid_rlp_tx | ( | evm_tx_type | type, |
const rlp_value & | rlp_tx ) -> bool |
Definition at line 27 of file parsec/agent/runners/evm/serialization.cpp.
References access_list, dynamic_fee, and legacy.
Referenced by check_tx_decode().
auto cbdc::parsec::agent::runner::mint_initial_accounts | ( | const std::shared_ptr< logging::log > & | log, |
const std::shared_ptr< parsec::broker::interface > & | broker ) -> bool |
Mints a set of initial accounts with funds, bypassing the agent.
log | logger instance. |
broker | broker instance to mint with. |
Definition at line 101 of file agent/runners/evm/util.cpp.
References cbdc::buffer::from_hex(), cbdc::parsec::agent::init_addresses_for_testing, cbdc::make_buffer(), and cbdc::parsec::put_row().
Referenced by main().
auto cbdc::parsec::agent::runner::operator* | ( | const evmc::uint256be & | lhs, |
const evmc::uint256be & | rhs ) -> evmc::uint256be |
auto cbdc::parsec::agent::runner::operator+ | ( | const evmc::uint256be & | lhs, |
const evmc::uint256be & | rhs ) -> evmc::uint256be |
auto cbdc::parsec::agent::runner::operator- | ( | const evmc::uint256be & | lhs, |
const evmc::uint256be & | rhs ) -> evmc::uint256be |
auto cbdc::parsec::agent::runner::operator<< | ( | const evmc::uint256be & | lhs, |
size_t | count ) -> evmc::uint256be |
auto cbdc::parsec::agent::runner::raw_tx_from_json | ( | const Json::Value & | param | ) | -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > > |
Converts a given Json::Value to an evm_tx.
param | Json::Value containing the raw transaction to decode in (0x prefixed) hexadecimal format |
Definition at line 278 of file parsec/agent/runners/evm/serialization.cpp.
References cbdc::buffer::from_hex(), and tx_decode().
auto cbdc::parsec::agent::runner::secp256k1_ecdsa_recoverable_signature_to_evm_sig | ( | secp256k1_ecdsa_recoverable_signature & | sig, |
evm_tx_type | type, | ||
uint64_t | chain_id ) -> evm_sig |
auto cbdc::parsec::agent::runner::sig_hash | ( | const cbdc::parsec::agent::runner::evm_tx & | tx, |
uint64_t | chain_id = opencbdc_chain_id ) -> hash_t |
Calculates the hash for creating / validating the signature.
tx | transaction to calculate the sighash for |
chain_id | unique chain ID, defaults to 0xcbdc. |
Definition at line 134 of file signature.cpp.
References cbdc::keccak_data(), and tx_encode().
Referenced by check_signature().
auto cbdc::parsec::agent::runner::to_hex | ( | const evmc::address & | addr | ) | -> std::string |
Definition at line 27 of file agent/runners/evm/util.cpp.
Referenced by cbdc::parsec::agent::runner::evm_host::access_account(), access_list_to_json(), cbdc::parsec::agent::runner::evm_host::access_storage(), cbdc::parsec::agent::runner::evm_host::account_exists(), cbdc::parsec::agent::runner::evm_host::call(), cbdc::parsec::agent::runner::evm_host::copy_code(), cbdc::parsec::agent::runner::evm_host::get_balance(), cbdc::parsec::agent::runner::evm_host::get_code_hash(), cbdc::parsec::agent::runner::evm_host::get_code_size(), cbdc::parsec::agent::runner::evm_host::get_storage(), cbdc::parsec::agent::runner::evm_host::selfdestruct(), cbdc::parsec::agent::runner::evm_host::set_storage(), tx_log_to_json(), tx_receipt_to_json(), and tx_to_json().
auto cbdc::parsec::agent::runner::to_hex | ( | const evmc::bytes32 & | b | ) | -> std::string |
Definition at line 31 of file agent/runners/evm/util.cpp.
auto cbdc::parsec::agent::runner::to_hex | ( | const T & | v | ) | -> std::string |
Converts a bytes-like object to a hex string.
T | type to convert from. |
v | value to convert. |
Definition at line 34 of file parsec/agent/runners/evm/util.hpp.
auto cbdc::parsec::agent::runner::to_hex_trimmed | ( | const evmc::bytes32 & | b, |
const std::string & | prefix ) -> std::string |
Definition at line 35 of file agent/runners/evm/util.cpp.
Referenced by tx_log_to_json(), tx_receipt_to_json(), and tx_to_json().
auto cbdc::parsec::agent::runner::to_uint64 | ( | const evmc::uint256be & | v | ) | -> uint64_t |
Converts an uint256be to a uint64_t, ignoring higher order bits.
v | bignum to convert. |
Definition at line 23 of file agent/runners/evm/util.cpp.
Referenced by evm_sig_to_secp256k1_ecdsa_recoverable_signature(), and tx_decode().
auto cbdc::parsec::agent::runner::tx_decode | ( | const cbdc::buffer & | buf, |
const std::shared_ptr< logging::log > & | logger, | ||
uint64_t | chain_id = opencbdc_chain_id ) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > > |
Converts a given buffer to an evm_tx.
buf | buffer containing the transaction to decode |
logger | logger to output any parsing errors to |
chain_id | the expected chain ID for the transaction. If the transaction contains a different chain ID this method will return std::nullopt |
Definition at line 78 of file parsec/agent/runners/evm/serialization.cpp.
References access_list, check_tx_decode(), dynamic_fee, legacy, cbdc::rlp_decode_access_list(), and to_uint64().
Referenced by raw_tx_from_json().
auto cbdc::parsec::agent::runner::tx_encode | ( | const cbdc::parsec::agent::runner::evm_tx & | tx, |
uint64_t | chain_id = opencbdc_chain_id, | ||
bool | for_sighash = false ) -> cbdc::buffer |
Converts the given transaction to an RLP encoded buffer conforming to Ethereums conventions.
tx | transaction to encode |
chain_id | the chain ID for which to encode the transaction |
for_sighash | use the formatting needed to calculate the sighash |
Definition at line 155 of file parsec/agent/runners/evm/serialization.cpp.
References access_list, cbdc::array, cbdc::buffer, dynamic_fee, legacy, cbdc::make_rlp_value(), and cbdc::rlp_encode_access_list().
Referenced by sig_hash(), and tx_id().
auto cbdc::parsec::agent::runner::tx_from_json | ( | const Json::Value & | json, |
uint64_t | chain_id = opencbdc_chain_id ) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > > |
Converts a given Json::Value to an evm_tx.
json | Json::Value containing the transaction to decode |
chain_id | the expected chain ID for the transaction. If the transaction contains a different chain ID this method will return std::nullopt |
Definition at line 293 of file parsec/agent/runners/evm/serialization.cpp.
References address_from_json(), buffer_from_json(), legacy, and uint256be_or_default().
Referenced by dryrun_tx_from_json().
auto cbdc::parsec::agent::runner::tx_id | ( | const cbdc::parsec::agent::runner::evm_tx & | tx, |
uint64_t | chain_id = opencbdc_chain_id ) -> cbdc::hash_t |
Calculate ethereum-compatible txid.
tx | transaction to calculate ID for |
chain_id | unique chain ID, defaults to 0xcbdc. |
Definition at line 21 of file parsec/agent/runners/evm/serialization.cpp.
References cbdc::keccak_data(), and tx_encode().
Referenced by cbdc::parsec::agent::runner::evm_host::get_state_updates(), tx_receipt_to_json(), and tx_to_json().
auto cbdc::parsec::agent::runner::tx_log_to_json | ( | cbdc::parsec::agent::runner::evm_log & | log, |
interface::ticket_number_type | tn, | ||
cbdc::hash_t | txid ) -> Json::Value |
Encodes the given transaction log into a eth-RPC compatible representation in JSON - as Json::Value.
log | The transaction log to represent as json |
tn | The ticket number this log was emitted by. Used to generate a pretend blockhash. The evm_log does not contain this data - so it has to be passed in. |
txid | The transaction ID this log was emitted by. The evm_log does not contain this data - so it has to be passed in. |
Definition at line 436 of file parsec/agent/runners/evm/serialization.cpp.
References cbdc::buffer, to_hex(), to_hex_trimmed(), and cbdc::to_string().
Referenced by tx_receipt_to_json().
auto cbdc::parsec::agent::runner::tx_receipt_to_json | ( | cbdc::parsec::agent::runner::evm_tx_receipt & | rcpt, |
const std::shared_ptr< secp256k1_context > & | ctx ) -> Json::Value |
Encodes the given transaction receipt into a eth-RPC compatible representation in JSON - as Json::Value.
rcpt | The transaction receipt to represent as json |
ctx | The secp256k1 context to use for deriving the from address |
Definition at line 386 of file parsec/agent/runners/evm/serialization.cpp.
References add_to_bloom(), cbdc::buffer, cbdc::make_buffer(), to_hex(), to_hex_trimmed(), cbdc::to_string(), tx_id(), tx_log_to_json(), and tx_to_json().
auto cbdc::parsec::agent::runner::tx_to_json | ( | cbdc::parsec::agent::runner::evm_tx & | tx, |
const std::shared_ptr< secp256k1_context > & | ctx ) -> Json::Value |
Encodes the given transaction into a eth-RPC compatible representation in JSON - as Json::Value.
tx | The transaction to represent as json |
ctx | The secp256k1 context to use for deriving the from address |
Definition at line 337 of file parsec/agent/runners/evm/serialization.cpp.
References access_list_to_json(), cbdc::buffer, check_signature(), dynamic_fee, legacy, to_hex(), to_hex_trimmed(), cbdc::to_string(), and tx_id().
Referenced by tx_receipt_to_json().
auto cbdc::parsec::agent::runner::uint256be_from_hex | ( | const std::string & | hex | ) | -> std::optional< evmc::uint256be > |
Generates a uint256be from a hex string.
hex | string to parse. |
Definition at line 81 of file agent/runners/evm/util.cpp.
References cbdc::buffer, and cbdc::buffer::from_hex_prefixed().
auto cbdc::parsec::agent::runner::uint256be_from_json | ( | const Json::Value & | val | ) | -> std::optional< evmc::uint256be > |
Converts a given Json::Value to an evmc::uint256be.
val | Json::Value containing the uint256be to decode. Is expected to be a string in 0x... format |
Definition at line 245 of file parsec/agent/runners/evm/serialization.cpp.
References buffer_from_json(), and cbdc::from_buffer().
Referenced by uint256be_or_default().
auto cbdc::parsec::agent::runner::uint256be_or_default | ( | const Json::Value & | val, |
evmc::uint256be | def ) -> evmc::uint256be |
Converts a given Json::Value to an evmc::uint256be, returning a default value if none could be decoded.
val | Json::Value containing the buffer to decode. Is expected to be a string in 0x... format containing valid hexadecimal representation of the buffer |
def | The value to return if no valid value could be decoded from val |
Definition at line 269 of file parsec/agent/runners/evm/serialization.cpp.
References uint256be_from_json().
Referenced by tx_from_json().