@@ -27,6 +27,49 @@ const json = {
27
27
LowNode : "0" ,
28
28
} ;
29
29
30
+ const binaryEntry1 =
31
+ "1100642200000000320000000000000002580CB3C1AD2C371136AEA434246D971C5FCCD32CBF520667E131AB7B10D706E7528214BA53D10260FFCC968ACD16BA30F7CEABAD6E5D92011340A3454ACED87177146EABD5E4A256021D836D1E3617618B1EB362D10B0D1BAC6AE1ED9E8D280BBE0B6656748FD647231851C6C650794D5E6852DFA1E35E68630F" ;
32
+ const jsonEntry1 = {
33
+ Flags : 0 ,
34
+ IndexPrevious : "2" ,
35
+ Indexes : [
36
+ "A3454ACED87177146EABD5E4A256021D836D1E3617618B1EB362D10B0D1BAC6A" ,
37
+ "E1ED9E8D280BBE0B6656748FD647231851C6C650794D5E6852DFA1E35E68630F" ,
38
+ ] ,
39
+ LedgerEntryType : "DirectoryNode" ,
40
+ Owner : "rHzDaMNybxQppiE3uWyt2N265KvAKdiRdP" ,
41
+ RootIndex : "0CB3C1AD2C371136AEA434246D971C5FCCD32CBF520667E131AB7B10D706E752" ,
42
+ index : "0B4A2E68C111F7E42FAEEE405F7344560C8240840B151D9D04131EB79D080167" ,
43
+ } ;
44
+
45
+ const binaryEntry2 =
46
+ "1100722200210000250178D1CA37000000000000000038000000000000028355C0C37CE200B509E0A529880634F7841A9EF4CB65F03C12E6004CFAD9718D66946280000000000000000000000000000000000000004743420000000000000000000000000000000000000000000000000166D6071AFD498D000000000000000000000000000047434200000000002599D1D255BCA61189CA64C84528F2FCBE4BFC3867800000000000000000000000000000000000000047434200000000006EEBB1D1852CE667876A0B3630861FB6C6AB358E" ;
47
+ const jsonEntry2 = {
48
+ Balance : {
49
+ currency : "GCB" ,
50
+ issuer : "rrrrrrrrrrrrrrrrrrrrBZbvji" ,
51
+ value : "0" ,
52
+ } ,
53
+ Flags : 2162688 ,
54
+ HighLimit : {
55
+ currency : "GCB" ,
56
+ issuer : "rBfVgTnsdh8ckC19RM8aVGNuMZnpwrMP6n" ,
57
+ value : "0" ,
58
+ } ,
59
+ HighNode : "283" ,
60
+ LedgerEntryType : "RippleState" ,
61
+ LowLimit : {
62
+ currency : "GCB" ,
63
+ issuer : "rhRFGCy2RJTA8oxkjjtYTvofPVGqcgvXWj" ,
64
+ value : "2000000" ,
65
+ } ,
66
+ LowNode : "0" ,
67
+ PreviousTxnID :
68
+ "C0C37CE200B509E0A529880634F7841A9EF4CB65F03C12E6004CFAD9718D6694" ,
69
+ PreviousTxnLgrSeq : 24695242 ,
70
+ index : "0000041EFD027808D3F78C8352F97E324CB816318E00B977C74ECDDC7CD975B2" ,
71
+ } ;
72
+
30
73
test ( "compareToTests[0]" , ( ) => {
31
74
expect ( UInt8 . from ( 124 ) . compareTo ( UInt64 . from ( 124 ) ) ) . toBe ( 0 ) ;
32
75
} ) ;
@@ -64,6 +107,11 @@ test("UInt64 from string zero", () => {
64
107
expect ( encode ( json ) ) . toEqual ( binary ) ;
65
108
} ) ;
66
109
110
+ test ( "UInt64 from non 16 length hex" , ( ) => {
111
+ expect ( encode ( jsonEntry1 ) ) . toEqual ( binaryEntry1 ) ;
112
+ expect ( encode ( jsonEntry2 ) ) . toEqual ( binaryEntry2 ) ;
113
+ } ) ;
114
+
67
115
test ( "valueOfTests" , ( ) => {
68
116
let val = UInt8 . from ( 1 ) ;
69
117
val |= 0x2 ;
0 commit comments