Open iglosiggio opened 1 year ago
These changes add a global_state field to DryRunTransactionPrams.
global_state
DryRunTransactionPrams
Example code showing a possible usage:
from graviton.blackbox import DryRunExecutor, ExecutionMode, DryRunTransactionParams from tests.clients import get_algod teal = """ #pragma version 8 byte "value" app_global_get btoi return """ algod = get_algod() executor = DryRunExecutor(algod, ExecutionMode.Application, teal) txn_params = DryRunTransactionParams.for_app(global_state={"value": b"\xff"}) run = executor.run_one((), txn_params=txn_params) print(run.tabulate(500)) print("Cost:", run.cost())
Output:
step | PC# | L# | Teal | Scratch | Stack --------+-------+------+-----------------------------------+-----------+---------------- 1 | 1 | 1 | #pragma version 8 | | [] 2 | 8 | 2 | pushbytes 0x76616c7565 // "value" | | [0x76616c7565] 3 | 9 | 3 | app_global_get | | [0xff] 4 | 10 | 4 | btoi | | [255] 5 | 11 | 5 | return | | [255] Cost: 4
All committers have signed the CLA.
These changes add a
global_state
field toDryRunTransactionPrams
.Example code showing a possible usage:
Output: