evm.rlp package¶
Submodules¶
evm.rlp.accounts module¶
-
class
evm.rlp.accounts.Account(nonce=0, balance=0, storage_root=b'Vxe8x1fx17x1bxccUxa6xffx83Exe6x92xc0xf8n[Hxe0x1bx99lxadxc0x01b/xb5xe3cxb4!', code_hash=b"xc5xd2Fx01x86xf7#<x92~}xb2xdcxc7x03xc0xe5x00xb6Sxcax82';{xfaxd8x04]x85xa4p", **kwargs)¶ Bases:
rlp.sedes.lists.SerializableRLP object for accounts.
-
fields= [('nonce', <rlp.sedes.big_endian_int.BigEndianInt object>), ('balance', <rlp.sedes.big_endian_int.BigEndianInt object>), ('storage_root', <rlp.sedes.binary.Binary object>), ('code_hash', <rlp.sedes.binary.Binary object>)]¶
-
evm.rlp.blocks module¶
-
class
evm.rlp.blocks.BaseBlock(*args, **kwargs)¶ Bases:
rlp.sedes.lists.Serializable-
add_transaction(transaction, computation)¶ Adds the given transaction to the current block.
-
classmethod
configure(**overrides)¶
-
db= None¶
-
classmethod
from_header(header, db)¶ Returns the block denoted by the given block header.
-
get_parent_header()¶ Returns the header for the parent block.
-
classmethod
get_sedes()¶
-
classmethod
get_transaction_class()¶
-
hash¶
-
is_genesis¶
-
mine(*args, **kwargs)¶ Mines the block.
-
number¶
-
transaction_class= None¶
-
validate()¶
-
evm.rlp.headers module¶
-
class
evm.rlp.headers.BlockHeader(difficulty, block_number, gas_limit, timestamp=None, coinbase=b'x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00', parent_hash=b'x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00', uncles_hash=b'x1dxccMxe8xdexc7]zxabx85xb5gxb6xccxd4x1axd3x12Ex1bx94x8atx13xf0xa1Bxfd@xd4x93G', state_root=b'Vxe8x1fx17x1bxccUxa6xffx83Exe6x92xc0xf8n[Hxe0x1bx99lxadxc0x01b/xb5xe3cxb4!', transaction_root=b'Vxe8x1fx17x1bxccUxa6xffx83Exe6x92xc0xf8n[Hxe0x1bx99lxadxc0x01b/xb5xe3cxb4!', receipt_root=b'Vxe8x1fx17x1bxccUxa6xffx83Exe6x92xc0xf8n[Hxe0x1bx99lxadxc0x01b/xb5xe3cxb4!', bloom=0, gas_used=0, extra_data=b'', mix_hash=b'x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00', nonce=b'x00x00x00x00x00x00x00B')¶ Bases:
rlp.sedes.lists.Serializable-
fields= [('parent_hash', <rlp.sedes.binary.Binary object>), ('uncles_hash', <rlp.sedes.binary.Binary object>), ('coinbase', <rlp.sedes.binary.Binary object>), ('state_root', <rlp.sedes.binary.Binary object>), ('transaction_root', <rlp.sedes.binary.Binary object>), ('receipt_root', <rlp.sedes.binary.Binary object>), ('bloom', <rlp.sedes.big_endian_int.BigEndianInt object>), ('difficulty', <rlp.sedes.big_endian_int.BigEndianInt object>), ('block_number', <rlp.sedes.big_endian_int.BigEndianInt object>), ('gas_limit', <rlp.sedes.big_endian_int.BigEndianInt object>), ('gas_used', <rlp.sedes.big_endian_int.BigEndianInt object>), ('timestamp', <rlp.sedes.big_endian_int.BigEndianInt object>), ('extra_data', <rlp.sedes.binary.Binary object>), ('mix_hash', <rlp.sedes.binary.Binary object>), ('nonce', <rlp.sedes.binary.Binary object>)]¶
-
classmethod
from_parent(parent, gas_limit, difficulty, timestamp, coinbase=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', nonce=None, extra_data=None)¶ Initialize a new block header with the parent header as the block’s parent hash.
-
hash¶
-
hex_hash¶
-
mining_hash¶
-
evm.rlp.logs module¶
evm.rlp.receipts module¶
-
class
evm.rlp.receipts.Receipt(state_root, gas_used, logs, bloom=None)¶ Bases:
rlp.sedes.lists.Serializable-
bloom_filter¶
-
fields= [('state_root', <rlp.sedes.binary.Binary object>), ('gas_used', <rlp.sedes.big_endian_int.BigEndianInt object>), ('bloom', <rlp.sedes.big_endian_int.BigEndianInt object>), ('logs', <rlp.sedes.lists.CountableList object>)]¶
-
evm.rlp.sedes module¶
evm.rlp.transactions module¶
-
class
evm.rlp.transactions.BaseTransaction(*args, **kwargs)¶ Bases:
rlp.sedes.lists.Serializable-
check_signature_validity()¶ Checks signature validity, raising a ValidationError if the signature is invalid.
-
classmethod
create_unsigned_transaction(*args, **kwargs)¶ Create an unsigned transaction.
-
fields= [('nonce', <rlp.sedes.big_endian_int.BigEndianInt object>), ('gas_price', <rlp.sedes.big_endian_int.BigEndianInt object>), ('gas', <rlp.sedes.big_endian_int.BigEndianInt object>), ('to', <rlp.sedes.binary.Binary object>), ('value', <rlp.sedes.big_endian_int.BigEndianInt object>), ('data', <rlp.sedes.binary.Binary object>), ('v', <rlp.sedes.big_endian_int.BigEndianInt object>), ('r', <rlp.sedes.big_endian_int.BigEndianInt object>), ('s', <rlp.sedes.big_endian_int.BigEndianInt object>)]¶
-
get_intrensic_gas()¶ Compute the baseline gas cost for this transaction. This is the amount of gas needed to send this transaction (but that is not actually used for computation).
-
get_message_for_signing()¶ Return the bytestring that should be signed in order to create a signed transactions
-
get_sender()¶ Get the 20-byte address which sent this transaction.
-
hash¶
-
intrensic_gas¶ Convenience property for the return value of get_intrensic_gas
-
is_signature_valid¶
-
sender¶ Convenience property for the return value of get_sender
-
validate()¶ Hook called during instantiation to ensure that all transaction parameters pass validation rules.
-
-
class
evm.rlp.transactions.BaseUnsignedTransaction(*args, **kwargs)¶ Bases:
rlp.sedes.lists.Serializable-
as_signed_transaction(private_key)¶ Return a version of this transaction which has been signed using the provided private_key
-
fields= [('nonce', <rlp.sedes.big_endian_int.BigEndianInt object>), ('gas_price', <rlp.sedes.big_endian_int.BigEndianInt object>), ('gas', <rlp.sedes.big_endian_int.BigEndianInt object>), ('to', <rlp.sedes.binary.Binary object>), ('value', <rlp.sedes.big_endian_int.BigEndianInt object>), ('data', <rlp.sedes.binary.Binary object>)]¶
-
validate()¶ Hook called during instantiation to ensure that all transaction parameters pass validation rules.
-