Repository navigation
Expose the ledger entry key as an XdrLedgerKey - #203
Merged
Merged
Conversation
Fixes a defect in `LedgerEntry`. Before this change, `getKeyXdr()` decoded the base64 `key` of a `getLedgerEntries` entry, a `LedgerKey`, as an `XdrSCVal`, so it returned a value of an unrelated type for every entry. The key of an account entry read as `SCV_BOOL` false, the key of a contract data entry as an `SCV_I64`. The docblock presented the result as the key of the ledger entry. This change: - Adds `getLedgerKeyXdr()`, which decodes the key as an `XdrLedgerKey`. - Deprecates `getKeyXdr()` in its docblock with a message that names the new getter, and keeps its result as it was. - Asserts the decoded keys of an account entry and a contract data entry and their round trip to the response key. The unit suite passes. Closes #202
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #203 +/- ##
=========================================
Coverage 93.47% 93.47%
- Complexity 21621 21622 +1
=========================================
Files 1006 1006
Lines 52422 52424 +2
=========================================
+ Hits 49001 49003 +2
Misses 3421 3421
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a defect in
LedgerEntry. Before this change,getKeyXdr()decoded the base64keyof agetLedgerEntriesentry, aLedgerKey, as anXdrSCVal, so it returned a value of an unrelated type for every entry. The key of an account entry read asSCV_BOOLfalse, the key of a contract data entry as anSCV_I64. The docblock presented the result as the key of the ledger entry.This change:
getLedgerKeyXdr(), which decodes the key as anXdrLedgerKey.getKeyXdr()in its docblock with a message that names the new getter, and keeps its result as it was.The unit suite passes.
Closes #202