fix: Correctly parse the limit/page pagination parameters when getting the logs emitted by a contract#79
Conversation
…g the logs emitted by a contract
|
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 (1)
📝 WalkthroughWalkthroughThe ChangesAddress Logs Pagination Refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
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 |
I set up a local chain through anvil and ran the atlas-server. I deployed a contract on the local chain and was trying to fetch the logs emitted by that contract with
curl -s "localhost:3000/api/addresses/0xe7f1725e7734ce288f8367e1bb143e90bb3f0512/logs?limit=20"Doing so triggered the following error:
It looks like the
#[serde(flatten)]annotation on theLogsQuerydoesn't play nicely withaxum::extract::Query. Theflattenattribute seems to keep the query parameters as strings internally, but theLogsQueryrequiresu32.I've removed the
Paginationfield and flattened it in line to matchTransactionLogsQuerySummary by CodeRabbit
Refactor
pageandlimitquery parameters for pagination.Tests