Skip to content

Add evm transactions command and fix OpenAPI spec gaps across all EVM commands#33

Open
ivpusic wants to merge 1 commit intosim/evm-activityfrom
sim/evm-transactions
Open

Add evm transactions command and fix OpenAPI spec gaps across all EVM commands#33
ivpusic wants to merge 1 commit intosim/evm-activityfrom
sim/evm-transactions

Conversation

@ivpusic
Copy link
Member

@ivpusic ivpusic commented Mar 12, 2026

  • Add dune sim evm transactions with --chain-ids, --decode, --limit, --offset flags
  • Add --decode text-mode stderr hint and E2E tests (text, JSON, decode-text, decode-JSON, pagination)
  • Fix spec gaps: add missing struct fields across all EVM commands
    • transactions: block_version, max_fee_per_gas, max_priority_fee_per_gas, decoded, logs, errors
    • balances/balance/stablecoins: historical_prices, token_metadata, pool, errors + printBalanceErrors
    • activity: tokenMetadata.standard, functionInfo.inputs
    • balance: --metadata and --historical-prices CLI flags
  • Use json.RawMessage for decoded input values to handle non-string ABI types safely

This was referenced Mar 12, 2026
@cursor
Copy link

cursor bot commented Mar 12, 2026

PR Summary

Medium Risk
Adds a new sim evm transactions CLI surface and expands JSON decoding structs/flags across existing EVM commands; moderate risk of breaking output/unmarshal expectations if the API schema differs. Changes are mostly additive but touch multiple commands’ response parsing and stderr messaging.

Overview
Adds a new sim evm transactions command with pagination, chain filtering, and optional --decode support (JSON-only), including stderr hints and end-to-end tests for text/JSON/decode/pagination.

Updates existing EVM commands to close API schema gaps by extending decoded response structs (e.g., balance errors, historical_prices, token_metadata, pool; activity token standard and function inputs with json.RawMessage values), and introduces printBalanceErrors to surface partial-failure details on stderr. Also extends sim evm balance to pass through --metadata and --historical-prices query params.

Written by Cursor Bugbot for commit bcff9e1. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Balance command silently drops errors in text mode
    • Added missing printBalanceErrors call to runBalance function in balance.go, matching the pattern used in balances and stablecoins commands.

Create PR

Or push these changes by commenting:

@cursor push a207014ce9
Preview (a207014ce9)
diff --git a/cmd/sim/evm/balance.go b/cmd/sim/evm/balance.go
--- a/cmd/sim/evm/balance.go
+++ b/cmd/sim/evm/balance.go
@@ -73,6 +73,8 @@
 			return fmt.Errorf("parsing response: %w", err)
 		}
 
+		printBalanceErrors(cmd, resp.Errors)
+
 		if len(resp.Balances) == 0 {
 			fmt.Fprintln(w, "No balance found.")
 			return nil

Comment @cursor review or bugbot run to trigger another review on this PR

}
if v, _ := cmd.Flags().GetString("historical-prices"); v != "" {
params.Set("historical_prices", v)
}
Copy link

Choose a reason for hiding this comment

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

Balance command silently drops errors in text mode

Medium Severity

The runBalance text-mode path in balance.go deserializes into balancesResponse (which now includes the new Errors field) but never calls printBalanceErrors. Both runBalances and runStablecoins call printBalanceErrors(cmd, resp.Errors) before rendering, so balance is the only command that silently swallows API-reported errors in text mode.

Additional Locations (2)
Fix in Cursor Fix in Web

ChainID int64 `json:"chain_id"`
Address string `json:"address"`
Description string `json:"description,omitempty"`
}
Copy link

Choose a reason for hiding this comment

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

Duplicated error types and printing functions across commands

Low Severity

transactionErrorInfo and balanceErrorInfo have identical fields, and printTransactionErrors and printBalanceErrors contain nearly identical logic. Both are introduced in this PR and could share a single error-info type and a common printing helper, reducing duplication and the risk of divergent fixes.

Additional Locations (2)
Fix in Cursor Fix in Web

@ivpusic ivpusic force-pushed the sim/evm-transactions branch 2 times, most recently from a0d205d to fbcafd8 Compare March 12, 2026 15:39
@ivpusic ivpusic force-pushed the sim/evm-transactions branch from fbcafd8 to a7bacad Compare March 12, 2026 16:07
… commands

- Add dune sim evm transactions with --chain-ids, --decode, --limit, --offset flags
- Add --decode text-mode stderr hint and E2E tests (text, JSON, decode-text, decode-JSON, pagination)
- Fix spec gaps: add missing struct fields across all EVM commands
  - transactions: block_version, max_fee_per_gas, max_priority_fee_per_gas, decoded, logs, errors
  - balances/balance/stablecoins: historical_prices, token_metadata, pool, errors + printBalanceErrors
  - activity: tokenMetadata.standard, functionInfo.inputs
  - balance: --metadata and --historical-prices CLI flags
- Use json.RawMessage for decoded input values to handle non-string ABI types safely
@ivpusic ivpusic force-pushed the sim/evm-transactions branch from a7bacad to f381fe4 Compare March 12, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants