CuEVM
Namespaces | Macros | Functions | Variables
python_utils.h File Reference
#include <Python.h>
#include <CuEVM/evm.cuh>
#include <CuEVM/utils/opcodes.cuh>
#include <unordered_set>
Include dependency graph for python_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 DefaultBlock
 
 python_utils
 

Macros

#define GET_STR_FROM_DICT_WITH_DEFAULT(dict, key, default_value)    (PyDict_GetItemString(dict, key) ? PyUnicode_AsUTF8(PyDict_GetItemString(dict, key)) : default_value)
 

Functions

void copy_dict_recursive (PyObject *read_root, PyObject *write_root)
 
CuEVM::block_info_t * python_utils::getBlockDataFromPyObject (PyObject *data)
 
void python_utils::print_dict_recursive (PyObject *dict, int indent_level)
 
CuEVM::evm_transaction_t * python_utils::getTransactionDataFromListofPyObject (PyObject *read_roots)
 
CuEVM::state_t * python_utils::getStateDataFromPyObject (PyObject *data)
 
void python_utils::get_evm_instances_from_PyObject (CuEVM::evm_instance_t *&evm_instances, PyObject *read_roots, uint32_t &num_instances)
 
PyObject * python_utils::pyobject_from_serialized_state (CuEVM::serialized_worldstate_data *serialized_worldstate_instance)
 
PyObject * python_utils::pyobject_from_evm_instances (CuEVM::evm_instance_t *instances, uint32_t num_instances)
 

Variables

constexpr char DefaultBlock::BaseFee [] = "0x0a"
 
constexpr char DefaultBlock::CoinBase [] = "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
 
constexpr char DefaultBlock::Difficulty [] = "0x020000"
 
constexpr char DefaultBlock::BlockNumber [] = "0x01"
 
constexpr char DefaultBlock::GasLimit [] = "0x05f5e100"
 
constexpr char DefaultBlock::TimeStamp [] = "0x03e8"
 
constexpr char DefaultBlock::PreviousHash [] = "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
 
std::unordered_set< int > const python_utils::bug_opcodes = {OP_ADD, OP_MUL, OP_SUB, OP_MOD, OP_EXP, OP_SELFDESTRUCT, OP_ORIGIN}
 
std::unordered_set< int > const python_utils::call_opcodes = {OP_CALL, OP_CALLCODE, OP_DELEGATECALL}
 
std::unordered_set< int > const python_utils::comparison_opcodes = {OP_LT, OP_GT, OP_SLT, OP_SGT, OP_EQ}
 
std::unordered_set< int > const python_utils::revert_opcodes = {OP_REVERT, OP_INVALID}
 

Macro Definition Documentation

◆ GET_STR_FROM_DICT_WITH_DEFAULT

#define GET_STR_FROM_DICT_WITH_DEFAULT (   dict,
  key,
  default_value 
)     (PyDict_GetItemString(dict, key) ? PyUnicode_AsUTF8(PyDict_GetItemString(dict, key)) : default_value)

Function Documentation

◆ copy_dict_recursive()

void copy_dict_recursive ( PyObject *  read_root,
PyObject *  write_root 
)