You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to implement functionality to parse and load the stack output from transaction script executions into a Rust data structure. This will make stack values accessible and manipulable as Rust entities.
This feature might be already existing.I would appreciate if you can provide any documentation/code, that might help solve this.
Current behavior
Currently, when executing a transaction script like:
use.oracle_component::oracle_module
use.std::sys
begin
push.{pair}
call.oracle_module::get_median
debug.stack
exec.sys::truncate_stack
end
The get_median function returns a price value that is pushed onto the stack. The debug.stack output shows a 20-element stack with the price value (98179860000) at index 0, followed by zeros:
Stack state before step 7234:
├── 0: 98179860000
├── 1: 0
[...]
└── 19: 0
Why is this feature needed?
Implement functionality to:
Parse the stack output into a Rust data structure (e.g., Vec or similar appropriate type)
Preserve the order and values of stack elements
Make the stack data easily accessible for further processing in Rust
The text was updated successfully, but these errors were encountered:
Thank you for such a detailed description! I do have a couple of clarifying questions:
use.oracle_component::oracle_module
use.std::sys
begin
push.{pair}
call.oracle_module::get_median
debug.stack
exec.sys::truncate_stack
end
Transaction scripts are usually meant to be execute as a part of a transaction to update account state, create notes etc. The above script (as currently written) just reads the account state and puts the data on the stack - so, it won't really have a meaningful effect on a transaction. So, I'm curious if you are planning to execute it as a part of a transaction or as a "stand-alone" program.
If the intent is to run it as a stand-alone program, is this mostly for testing/debugging purposes? Or is the result meant to be used for something meaningful?
Feature description
We need to implement functionality to parse and load the stack output from transaction script executions into a Rust data structure. This will make stack values accessible and manipulable as Rust entities.
This feature might be already existing.I would appreciate if you can provide any documentation/code, that might help solve this.
Current behavior
Currently, when executing a transaction script like:
The get_median function returns a price value that is pushed onto the stack. The debug.stack output shows a 20-element stack with the price value (98179860000) at index 0, followed by zeros:
Stack state before step 7234:
Why is this feature needed?
Implement functionality to:
The text was updated successfully, but these errors were encountered: