6#ifndef OPENCBDC_TX_SRC_PARSEC_AGENT_RUNNERS_EVM_SERIALIZATION_H_
7#define OPENCBDC_TX_SRC_PARSEC_AGENT_RUNNERS_EVM_SERIALIZATION_H_
16#include <evmc/evmc.hpp>
17#include <evmc/hex.hpp>
21#include <secp256k1_extrakeys.h>
22#include <secp256k1_recovery.h>
25 static constexpr uint64_t eip155_v_offset = 35;
26 static constexpr uint64_t pre_eip155_v_offset = 27;
35 uint64_t chain_id = opencbdc_chain_id,
47 const std::shared_ptr<logging::log>& logger,
48 uint64_t chain_id = opencbdc_chain_id)
49 -> std::optional<std::shared_ptr<cbdc::parsec::agent::runner::evm_tx>>;
57 -> std::optional<std::shared_ptr<cbdc::parsec::agent::runner::evm_tx>>;
67 uint64_t chain_id = opencbdc_chain_id)
68 -> std::optional<std::shared_ptr<cbdc::parsec::agent::runner::evm_tx>>;
78 uint64_t chain_id = opencbdc_chain_id)
80 std::shared_ptr<cbdc::parsec::agent::runner::evm_dryrun_tx>>;
88 -> std::optional<evmc::address>;
96 -> std::optional<evmc::uint256be>;
105 -> std::optional<cbdc::buffer>;
126 const std::shared_ptr<secp256k1_context>& ctx)
136 const std::shared_ptr<secp256k1_context>& ctx)
Buffer to store and retrieve byte data.
parsec::ticket_machine::ticket_number_type ticket_number_type
Type alias for a ticket number.
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 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 address_from_json(const Json::Value &addr) -> std::optional< evmc::address >
Converts a given Json::Value to an evmc::address.
auto tx_encode(const cbdc::parsec::agent::runner::evm_tx &tx, uint64_t chain_id, bool for_sighash) -> cbdc::buffer
Converts the given transaction to an RLP encoded buffer conforming to Ethereums conventions.
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 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::Val...
auto buffer_from_json(const Json::Value &val) -> std::optional< cbdc::buffer >
Converts a given Json::Value to a cbdc::buffer.
auto dryrun_tx_from_json(const Json::Value &json, uint64_t 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 tx_from_json(const Json::Value &json, uint64_t) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > >
Converts a given Json::Value to an evm_tx.
auto uint256be_from_json(const Json::Value &val) -> std::optional< evmc::uint256be >
Converts a given Json::Value to an evmc::uint256be.
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 tx_decode(const cbdc::buffer &buf, const std::shared_ptr< logging::log > &logger, uint64_t chain_id) -> std::optional< std::shared_ptr< cbdc::parsec::agent::runner::evm_tx > >
Converts a given buffer to an evm_tx.
std::vector< evm_access_tuple > evm_access_list
Type alias for a list of storage key accesses.
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 decode...
auto tx_id(const cbdc::parsec::agent::runner::evm_tx &tx, uint64_t chain_id) -> cbdc::hash_t
Calculate ethereum-compatible txid.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
@ buffer
A singular RLP value (byte array)
EVM transaction receipt type.