Michelson REPL

Interpreter

class pytezos.michelson.repl.Interpreter(debug=True)[source]

Michelson interpreter reimplemented in Python. Based on the following reference: https://tezos.gitlab.io/michelson-reference/

static run_code(parameter, storage, script, entrypoint='default', output_mode='readable', amount=None, chain_id=None, source=None, sender=None, balance=None, block_id=None, **kwargs) → Tuple[List[dict], Any, List[dict], List[str], Optional[Exception]][source]
static run_view(entrypoint, parameter, storage, context: pytezos.context.impl.ExecutionContext) → Tuple[Any, List[str], Optional[Exception]][source]

Execution context

class pytezos.context.impl.ExecutionContext(amount=None, chain_id=None, source=None, sender=None, balance=None, block_id=None, now=None, level=None, voting_power=None, total_voting_power=None, key=None, shell=None, address=None, counter=None, script=None, mode=None)[source]
get_amount() → int[source]
get_balance() → int[source]
get_big_map_diff(ptr: int) → Tuple[Optional[int], int, str][source]
get_big_map_value(ptr: int, key_hash: str)[source]
get_chain_id() → str[source]
get_code_expr()[source]
get_counter() → int[source]
get_dummy_address() → str[source]
get_dummy_chain_id() → str[source]
get_dummy_key_hash() → str[source]
get_dummy_lambda()[source]
get_dummy_public_key() → str[source]
get_dummy_signature() → str[source]
get_level() → int[source]
get_now() → int[source]
get_originated_address() → str[source]
get_parameter_expr(address=None) → Optional[source]
get_sapling_state_diff(offset_commitment=0, offset_nullifier=0) → Tuple[int, list][source]
get_self_address() → str[source]
get_sender() → str[source]
get_source() → str[source]
get_storage_expr()[source]
get_tmp_big_map_id() → int[source]
get_tmp_sapling_state_id() → int[source]
get_total_voting_power() → int[source]
get_voting_power(address: str) → int[source]
register_big_map(ptr: int, copy=False) → int[source]
register_sapling_state(ptr: int)[source]
reset()[source]
property script
set_code_expr(expr)[source]
set_counter(counter: int)[source]
set_parameter_expr(expr)[source]
set_storage_expr(expr)[source]
set_total_voting_power(total_voting_power: int)[source]
set_voting_power(address: str, voting_power: int)[source]
spend_balance(amount: int)[source]