fix: allow lowercase hex in Uint64 (#135)

This commit is contained in:
Nathan Nichols
2021-06-11 10:58:15 -07:00
parent 7e7f47cc20
commit c149ec87ea
2 changed files with 30 additions and 1 deletions

View File

@@ -27,6 +27,34 @@ const json = {
LowNode: "0",
};
const binaryEntry0 =
"11007222001100002501EC24873700000000000000003800000000000000A35506FC7DE374089D50F81AAE13E7BBF3D0E694769331E14F55351B38D0148018EA62D44BF89AC2A40B800000000000000000000000004A50590000000000000000000000000000000000000000000000000166D6C38D7EA4C680000000000000000000000000004A5059000000000047C1258B4B79774B28176324068F759EDE226F686780000000000000000000000000000000000000004A505900000000005BBC0F22F61D9224A110650CFE21CC0C4BE13098";
const jsonEntry0 = {
Balance: {
currency: "JPY",
issuer: "rrrrrrrrrrrrrrrrrrrrBZbvji",
value: "0.3369568318",
},
Flags: 1114112,
HighLimit: {
currency: "JPY",
issuer: "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN",
value: "0",
},
HighNode: "a3",
LedgerEntryType: "RippleState",
LowLimit: {
currency: "JPY",
issuer: "rfYQMgj3g3Qp8VLoZNvvU35mEuuJC8nCmY",
value: "1000000000",
},
LowNode: "0",
PreviousTxnID:
"06FC7DE374089D50F81AAE13E7BBF3D0E694769331E14F55351B38D0148018EA",
PreviousTxnLgrSeq: 32253063,
index: "000319BAE0A618A7D3BB492F17E98E5D92EA0C6458AFEBED44206B5B4798A840",
};
const binaryEntry1 =
"1100642200000000320000000000000002580CB3C1AD2C371136AEA434246D971C5FCCD32CBF520667E131AB7B10D706E7528214BA53D10260FFCC968ACD16BA30F7CEABAD6E5D92011340A3454ACED87177146EABD5E4A256021D836D1E3617618B1EB362D10B0D1BAC6AE1ED9E8D280BBE0B6656748FD647231851C6C650794D5E6852DFA1E35E68630F";
const jsonEntry1 = {
@@ -108,6 +136,7 @@ test("UInt64 from string zero", () => {
});
test("UInt64 from non 16 length hex", () => {
expect(encode(jsonEntry0)).toEqual(binaryEntry0);
expect(encode(jsonEntry1)).toEqual(binaryEntry1);
expect(encode(jsonEntry2)).toEqual(binaryEntry2);
});