refactor(e2e): make zetae2e balances chain-aware with --network flag#4558
refactor(e2e): make zetae2e balances chain-aware with --network flag#4558ws4charlie merged 4 commits intomainfrom
zetae2e balances chain-aware with --network flag#4558Conversation
Replace the `--skip-btc` boolean flag with a `--network` string flag that scopes native balance queries to a single external chain. This prevents cross-chain RPC failures (e.g. Sui index store unavailable) from crashing unrelated chain jobs in the parallel e2e workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR refactors the e2e balance query system from a boolean flag mechanism to a network-aware orchestration system. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: EVM balances no longer fetched for gas tracking reports
- Changed GetAccountBalances("") to GetAccountBalances("eth") to restore EVM balance fetching for gas tracking, matching the pre-refactor behavior.
Or push these changes by commenting:
@cursor push e985adb0dc
Preview (e985adb0dc)
diff --git a/e2e/runner/run.go b/e2e/runner/run.go
--- a/e2e/runner/run.go
+++ b/e2e/runner/run.go
@@ -101,7 +101,7 @@
reports := make(TestReports, 0, len(e2eTests))
for _, test := range e2eTests {
// get info before test
- balancesBefore, err := r.GetAccountBalances("")
+ balancesBefore, err := r.GetAccountBalances("eth")
if err != nil {
return nil, err
}
@@ -117,7 +117,7 @@
time.Sleep(5 * time.Second)
// get info after test
- balancesAfter, err := r.GetAccountBalances("")
+ balancesAfter, err := r.GetAccountBalances("eth")
if err != nil {
return nil, err
}Comment @cursor review or bugbot run to trigger another review on this PR
- Add validNetworks map to reject unknown --network values early - Always query EVM balances (needed by GetAccountBalancesDiff for gas reporting in RunE2ETestsIntoReport); only gate printing on isEVMNetwork - Add comment explaining --skip-btc is intentionally not read (lockstep CI update) - Add changelog entry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add constants for EVM network names (networkPolygon, networkBSC, etc.) and use them in validNetworks map to eliminate typo risk - Remove isEVMNetwork helper (dead code after printing change) - Always print EVM balances since they are always queried - Remove inconsistent zero-check for TON balance printing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ring
- Add networkZEVM = "zevm" constant for the ZEVM-only default
- Update cobra flag default from "" to "zevm"
- Replace GetAccountBalances("") calls with GetAccountBalances(networkZEVM)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |

Summary
--skip-btcboolean flag with a--networkstring flag that scopes native balance queries to a single external chainChanges
e2e/runner/balances.gonetworkZEVM,networkPolygon,networkBSC, etc.);GetAccountBalances(skipBTC bool)→GetAccountBalances(network string)with validation;PrintAccountBalances(balances)→PrintAccountBalances(balances, network)with per-network gating; removeisEVMNetwork()helper (EVM always printed); always print EVM and TON balances consistentlycmd/zetae2e/balances.go--networkflag (default"zevm"); deprecate+hide--skip-btcfor backward compate2e/runner/run.goGetAccountBalances(true)→GetAccountBalances(networkZEVM)Before / After
ethe2e jobzetae2e balances --skip-btcqueries Sui → paniczetae2e balances --network ethskips Sui → no crashzetae2e balancesqueries all chainszetae2e balances --network btcqueries only BTC native--network zevm→ queries ZEVM + EVM only (safe default)Supported
--networkvalueszevm(default)polygon,bsc,eth,base,arbitrum,avalanchebtcsolanasuiton🤖 Generated with Claude Code