@@ -62,7 +62,7 @@ func Test_GetMessages(t *testing.T) {
62
62
args {
63
63
inbox : func () stores.State {
64
64
stateMock := statemock .NewMockState (mockCtrl )
65
- stateMock .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte ).Times (1 )
65
+ stateMock .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte , int32 ( 0 ), int32 ( 15 ) ).Times (1 )
66
66
return stateMock
67
67
}(),
68
68
ks : func () keystore.Store {
@@ -86,7 +86,7 @@ func Test_GetMessages(t *testing.T) {
86
86
inbox : func () stores.State {
87
87
inbox := statemock .NewMockState (mockCtrl )
88
88
inbox .EXPECT ().GetReadStatus (mail.ID {71 , 236 , 160 , 17 , 227 , 43 , 82 , 199 , 16 , 5 , 173 , 138 , 143 , 117 , 225 , 180 , 76 , 146 , 201 , 159 , 209 , 46 , 67 , 188 , 207 , 229 , 113 , 227 , 194 , 209 , 61 , 46 , 154 , 130 , 106 , 85 , 15 , 95 , 246 , 59 , 36 , 122 , 244 , 113 }).Return (false , nil ).Times (1 )
89
- inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte ).Return ([]stores.Transaction {
89
+ inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte , int32 ( 0 ), int32 ( 15 ) ).Return ([]stores.Transaction {
90
90
{
91
91
BlockNumber : 100 ,
92
92
Hash : []byte {0x01 , 0x02 , 0x03 },
@@ -131,7 +131,7 @@ func Test_GetMessages(t *testing.T) {
131
131
inbox : func () stores.State {
132
132
inbox := statemock .NewMockState (mockCtrl )
133
133
inbox .EXPECT ().GetReadStatus (mail.ID {71 , 236 , 160 , 17 , 227 , 43 , 82 , 199 , 16 , 5 , 173 , 138 , 143 , 117 , 225 , 180 , 76 , 146 , 201 , 159 , 209 , 46 , 67 , 188 , 207 , 229 , 113 , 227 , 194 , 209 , 61 , 46 , 154 , 130 , 106 , 85 , 15 , 95 , 246 , 59 , 36 , 122 , 244 , 113 }).Return (false , nil ).Times (1 )
134
- inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte ).Return ([]stores.Transaction {
134
+ inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte , int32 ( 0 ), int32 ( 15 ) ).Return ([]stores.Transaction {
135
135
{
136
136
BlockNumber : 100 ,
137
137
Hash : []byte {0x01 , 0x02 , 0x03 },
@@ -171,7 +171,7 @@ func Test_GetMessages(t *testing.T) {
171
171
inbox : func () stores.State {
172
172
inbox := statemock .NewMockState (mockCtrl )
173
173
inbox .EXPECT ().GetReadStatus (mail.ID {71 , 236 , 160 , 17 , 227 , 43 , 82 , 199 , 16 , 5 , 173 , 138 , 143 , 117 , 225 , 180 , 76 , 146 , 201 , 159 , 209 , 46 , 67 , 188 , 207 , 229 , 113 , 227 , 194 , 209 , 61 , 46 , 154 , 130 , 106 , 85 , 15 , 95 , 246 , 59 , 36 , 122 , 244 , 113 }).Return (false , nil ).Times (1 )
174
- inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte ).Return ([]stores.Transaction {
174
+ inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte , int32 ( 0 ), int32 ( 15 ) ).Return ([]stores.Transaction {
175
175
{
176
176
BlockNumber : 100 ,
177
177
Hash : []byte {0x01 , 0x02 , 0x03 },
@@ -219,7 +219,7 @@ func Test_GetMessages(t *testing.T) {
219
219
args {
220
220
inbox : func () stores.State {
221
221
inbox := statemock .NewMockState (mockCtrl )
222
- inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte ).Return (nil , errors .New ("internal error" ))
222
+ inbox .EXPECT ().GetTransactions ("ethereum" , "mainnet" , addressingtest .EthereumCharlotte , int32 ( 0 ), int32 ( 15 ) ).Return (nil , errors .New ("internal error" ))
223
223
return inbox
224
224
}(),
225
225
ks : func () keystore.Store {
@@ -306,6 +306,8 @@ func Test_parseGetMessagesRequest(t *testing.T) {
306
306
Network : "mainnet" ,
307
307
Protocol : "ethereum" ,
308
308
Fetch : true ,
309
+ Limit : 15 ,
310
+ Skip : 0 ,
309
311
addressBytes : []byte {0x56 , 0x2 , 0xea , 0x95 , 0x54 , 0xb , 0xee , 0x46 , 0xd0 , 0x3b , 0xa3 , 0x35 , 0xee , 0xd6 , 0xf4 , 0x9d , 0x11 , 0x7e , 0xab , 0x95 , 0xc8 , 0xab , 0x8b , 0x71 , 0xba , 0xe2 , 0xcd , 0xd1 , 0xe5 , 0x64 , 0xa7 , 0x61 },
310
312
},
311
313
false ,
@@ -323,10 +325,38 @@ func Test_parseGetMessagesRequest(t *testing.T) {
323
325
Address : "0x5602ea95540bee46d03ba335eed6f49d117eab95c8ab8b71bae2cdd1e564a761" ,
324
326
Network : "mainnet" ,
325
327
Protocol : "ethereum" ,
328
+ Limit : 15 ,
329
+ Skip : 0 ,
326
330
addressBytes : []byte {0x56 , 0x2 , 0xea , 0x95 , 0x54 , 0xb , 0xee , 0x46 , 0xd0 , 0x3b , 0xa3 , 0x35 , 0xee , 0xd6 , 0xf4 , 0x9d , 0x11 , 0x7e , 0xab , 0x95 , 0xc8 , 0xab , 0x8b , 0x71 , 0xba , 0xe2 , 0xcd , 0xd1 , 0xe5 , 0x64 , 0xa7 , 0x61 },
327
331
},
328
332
false ,
329
333
},
334
+ {
335
+ "err-skip-value" ,
336
+ args {
337
+ map [string ]string {
338
+ "address" : "0x5602ea95540bee46d03ba335eed6f49d117eab95c8ab8b71bae2cdd1e564a761" ,
339
+ "network" : "mainnet" ,
340
+ "protocol" : "ethereum" ,
341
+ "skip" : "invalid" ,
342
+ },
343
+ },
344
+ nil ,
345
+ true ,
346
+ },
347
+ {
348
+ "err-limit-value" ,
349
+ args {
350
+ map [string ]string {
351
+ "address" : "0x5602ea95540bee46d03ba335eed6f49d117eab95c8ab8b71bae2cdd1e564a761" ,
352
+ "network" : "mainnet" ,
353
+ "protocol" : "ethereum" ,
354
+ "limit" : "invalid" ,
355
+ },
356
+ },
357
+ nil ,
358
+ true ,
359
+ },
330
360
{
331
361
"err-invalid-protocol" ,
332
362
args {
0 commit comments