Skip to content
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

Add additional info and formatting to transaction command #403

Merged
merged 10 commits into from
Jul 9, 2024

Conversation

geoff-vball
Copy link
Contributor

@geoff-vball geoff-vball commented Jun 17, 2024

Why this should be merged

Closes #400

How this works

Formats outputs using json.MarshalIndent and prints them using cmd.Println, since logger.Info can only output to a single line.

Adds an optional -d or --debug flag to the transaction command in the Teleporter CLI. This will output the transaction info and the transaction trace.

How this was tested

Manually using go build && ./teleporter-cli transaction --rpc 'https://testnet-qr0606t3tp-xe0ed.avax-test.network/ext/bc/rtLueJ1R8vQ7yGe3QdveWJB1VAnvusy6PPp7TrA5suhUmgbnB/rpc?token=<REDACTED>' -d --teleporter-address "0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf" "0x23a6ab766838c3e0536e6630b8b07297716aaa2773869a80b62b2285b378007e"

Output:
cli-output.txt (updated)

How is this documented

Adding info for command help

Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me. The questions above are minor.


for _, log := range receipt.Logs {
printTeleporterLogs(cmd, log)
printWarpLogs(cmd, log)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did printWarpLogs(cmd,log) portion get tested? It looks like the cli-output.txt includes logs from the printTeleporterLogs portion only.

cmd/teleporter-cli/transaction.go Outdated Show resolved Hide resolved
cmd/teleporter-cli/transaction.go Outdated Show resolved Hide resolved
cmd/teleporter-cli/transaction.go Outdated Show resolved Hide resolved
cmd/teleporter-cli/transaction.go Show resolved Hide resolved
iansuvak
iansuvak previously approved these changes Jun 21, 2024
Copy link
Contributor

@bernard-avalabs bernard-avalabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally makes sense to me. I left a few minor comments.

cmd/teleporter-cli/transaction.go Outdated Show resolved Hide resolved
abi-bindings/go/Teleporter/TeleporterMessenger/event.go Outdated Show resolved Hide resolved
@geoff-vball geoff-vball requested a review from a team as a code owner July 8, 2024 13:36
Co-authored-by: bernard-avalabs <[email protected]>
Signed-off-by: Geoff Stuart <[email protected]>
@geoff-vball geoff-vball requested a review from iansuvak July 8, 2024 15:49
@geoff-vball geoff-vball merged commit c41e011 into main Jul 9, 2024
14 checks passed
@geoff-vball geoff-vball deleted the gstuart/tx-utils branch July 24, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add additional debugging tools to teleporter-cli
5 participants