fix(rpc): reject non-positive fund account amounts#1625
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request adds input validation to the Changesfund_account Input Validation
🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Summary
Rejects non-positive
sim_fundAccountamounts before creating or crediting a funding transaction.Why
sim_fundAccountis expected to create funding transactions only for positive values. Accepting0can create useless transactions, while negative values can lead to invalid transfer semantics later in the simulator flow.Changes
amount > 0infund_account0and negative amountsTest plan
python3 -m py_compile backend/protocol_rpc/endpoints.py tests/unit/test_simulator_sessions.pygit diff --check -- backend/protocol_rpc/endpoints.py tests/unit/test_simulator_sessions.pypython3 -m pytest tests/unit/test_simulator_sessions.py -qSummary by CodeRabbit
Bug Fixes