Repository navigation
Detect chain network from address format instead of hardcoding tron - #24
Conversation
RiskListPort.lookup keys on network:value, so hardcoding "tron" made every non-Tron destination silently look up under the wrong network. Infer the network from the address format and flag anything matching neither Tron nor Ethereum instead of assuming Tron. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe application now detects Tron and Ethereum networks from destination address formats. It rejects unrecognized formats before analysis and passes the detected network to downstream risk checks. ChangesChain network detection
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Destination analysis now uses the detected Tron or Ethereum network rather than always using Tron, while unsupported address formats are blocked before analysis. No concrete current-head merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
Description
apps/web/src/App.tsxhardcodednetwork: "tron"for every destination address, soRiskListPort.lookup(which keys onnetwork:value) silently checked the wrong list for any non-Tron address.Changes
detectChainNetwork()inpackages/core, inferringtron(base58,T...) orethereum(0x...hex) from the address format, returningotherotherwise.App.tsxinstead of the hardcoded"tron"network.Closes
Closes #10
Notes
No lint script is configured in the repo, so only
test/typecheck/buildwere run.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests