Repository navigation
feat(autoclaim): identify API requests by global index - #1891
Conversation
Replace the custom source:destination:deposit_count request ID in the
autoclaim public and admin APIs with the claim global index, matching the
bridge API.
- GET /bridges/{global_index}, POST /bridges/{global_index}/approve|reject
accept a decimal or 0x-prefixed hex global index (400 if invalid)
- GET /bridges gains a global_index filter
- drop the `id` field from the request response
- add Storage.GetRequestByGlobalIndex; 409 when a legacy pre-Etrog index
collides with a rollup-origin one
- regenerate swagger, update docs and e2e helpers, add tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eyBoQ7G2hoShKEzAQvZWM
|
Claude finished @arnaubennassar's task in 51s —— View job Review of PR #1891: identify autoclaim API requests by global index
Overall this is a clean, well-scoped change. The internal request key is untouched, so no migration is needed. Error mapping (400/404/409) is consistent across the public and admin routes, and the unit tests cover decimal input, hex input, invalid input, not found, ambiguous and the list filter. I found no 🔴 blockers. I only read the code and did not build or run the tests, and the e2e changes were not run either. 🟡 Suggested
🟢 Optional
Security and performance notes
🚀 What's New
🐛 Bug FixesNone. 📋 Config UpdatesNone.
|
|
Claude finished @joanestebanr's task in 27s —— View job Review of PR #1891: identify autoclaim API requests by global indexThis is a clean, well-scoped change. I found no 🔴 blockers. I read the code and did not build or run the tests, and the e2e changes were not run.
🟡 Suggested
🟢 Optional
Security and performance notes
🚀 What's New
🐛 Bug FixesNone. 📋 Config UpdatesNone.
|
- GetRequestByGlobalIndex now runs a single LIMIT query instead of COUNT + SELECT - accept optional destination_network on GET/approve/reject so requests sharing a global index can still be targeted - document global_index parsing as identical to the bridge API - align the swagger error example with the actual not-found error Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017eyBoQ7G2hoShKEzAQvZWM
|
Addressed the review suggestions in the latest commit:
🤖 Generated with Claude Code |
🔄 Changes Summary
source_network:destination_network:deposit_countID.GET /autoclaim/v1/bridges/{global_index},POST .../{global_index}/approveand.../rejecttake a decimal or0x-prefixed hex global index. Non-numeric values return400.GET /autoclaim/v1/bridgesgains aglobal_indexfilter.idfield is removed from the request response (global_indexwas already present).Storage.GetRequestByGlobalIndex; the internal request key is unchanged (no migration).docs/autoclaim.md/docs/e2e_tests.mdupdated, e2e helpers convert keys to global indexes.{id}path parameter replaced by{global_index};idresponse field removed.🔌 API Updates
🔌 Others API
GET /autoclaim/v1/bridges/{id}→{global_index},POST /autoclaim/v1/bridges/{id}/approve|reject→{global_index}; addedglobal_indexquery filter onGET /autoclaim/v1/bridges; removedidfrom responses. Breaking interface change.✅ Testing
autoclaim/api,autoclaim/apitypes,autoclaim/storage(lookup, hex input, invalid input, not found, ambiguous, list filter); e2e helpers updated (not run locally).golangci-lintclean on./autoclaim/... ./test/e2e/....🐞 Issues
📝 Notes
409; the list endpoint withglobal_index+destination_networkcan disambiguate, but approve/reject cannot target such a request.global_index; lookups scanautoclaim_request. Can add a migration if the table is expected to be large.🤖 Generated with Claude Code
https://claude.ai/code/session_017eyBoQ7G2hoShKEzAQvZWM