-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): add cannon trace
command
#455
Conversation
implements `cannon trace`, which allows for the generation of a **stack trace** of *any* transaction on chain, or a specified transaction code offchain. the cannon trace command works similar to the `cannon decode` command. Simply supply a package name and hex string. can be used to decode any transaction already on chain by submitting the transaction has as the hex string. The exact parameters under which the original transaction executed will be accomodated in the simulation to ensure that the result is exactly the same as its original circumstance (individual fields, such as `from` or `block`, can be overridden if desired) alternatively, if the transaction isnt submitted on-chain or you want to trace a *read-only* call, supply the exact call data of the transaction you want to execute. Cannon will auto-detect the contract to send the call to and submit the transaction automatically. To override the destination contract (as well as other options such as `value` or `from`), those values can be supplied as needed.
cannon trace
commandcannon trace
command
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 6c4664d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
a good example of simulating a transaction which is not on chain (ex. a view function call) is |
@noahlitvin wondering if it would be better to make the transaction output look more colorful? |
@@ -410,7 +410,6 @@ program | |||
.option('-c --chain-id <chainId>', 'Chain ID of the variant to inspect', '13370') | |||
.option('-p --preset <preset>', 'Preset of the variant to inspect', 'main') | |||
.option('-j --json', 'Output as JSON') | |||
.option('--registry-priority <registry>', 'Priority of the registry to use') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not being used by the inspect
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nice
implements
cannon trace
, which allows for the generation of a stacktrace of any transaction on chain, or a specified transaction code
offchain.
the cannon trace command works similar to the
cannon decode
command.Simply supply a package name and hex string.
can be used to decode any transaction already on chain by submitting the
transaction has as the hex string. The exact parameters under which the
original transaction executed will be accomodated in the simulation to
ensure that the result is exactly the same as its original circumstance
(individual fields, such as
from
orblock
, can be overridden ifdesired)
alternatively, if the transaction isnt submitted on-chain or you want to
trace a read-only call, supply the exact call data of the transaction
you want to execute. Cannon will auto-detect the contract to send the
call to and submit the transaction automatically. To override the
destination contract (as well as other options such as
value
orfrom
), those values can be supplied as needed.