Unify request validation methods for getLedgers and getTransactions#407
Unify request validation methods for getLedgers and getTransactions#407Shaptic merged 9 commits intoprotocol-23from
getLedgers and getTransactions#407Conversation
|
It looks like getEvents has its own checks for pagination and ledger range. Should that updated it to use this as well for consistent error handling? |
|
@urvisavla |
I missed that GetEvents also includes the endLedger. I agree there’s no need to expand the scope of this PR. The changes look good overall. There are some failing integration tests that you'll want to fix. |
What
Use a single method to ensure request parameters are correct. Specifically, follow the documented set of rules:
paginationis set:cursoris set, thestartLedgeris not set.limitis set, it does not exceed the maxLimit.cursoris not set, thestartLedgeris in the RPC's range of known ledgers.startLedgeris set and is in the RPC's range of known ledgers.This also improves the error messages in failure cases by, for example, including the
startLedgerthat was provided in the message itself.Why
Several issues have cropped up related to this.
For example, #391 is caused by a lack of
startLedgervalidation due to the presence ofpagination. A recent Slack thread by @fnando also highlights problematic validation.Known limitations
n/a