@ledgerhq/coin-evm 8.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/docs/getBlock-internal-txs-schema.md +1 -1
- package/docs/network/node/index.md +3 -1
- package/lib/adapters/blockOperations.d.ts +4 -3
- package/lib/adapters/blockOperations.d.ts.map +1 -1
- package/lib/adapters/blockOperations.js +17 -17
- package/lib/adapters/blockOperations.js.map +1 -1
- package/lib/adapters/etherscan.d.ts +7 -6
- package/lib/adapters/etherscan.d.ts.map +1 -1
- package/lib/adapters/etherscan.js +19 -19
- package/lib/adapters/etherscan.js.map +1 -1
- package/lib/adapters/ledger.d.ts +6 -5
- package/lib/adapters/ledger.d.ts.map +1 -1
- package/lib/adapters/ledger.js +15 -15
- package/lib/adapters/ledger.js.map +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +1 -2
- package/lib/api/index.js.map +1 -1
- package/lib/logic/common.js +1 -1
- package/lib/logic/common.js.map +1 -1
- package/lib/logic/getBalance.d.ts.map +1 -1
- package/lib/logic/getBalance.js +3 -3
- package/lib/logic/getBalance.js.map +1 -1
- package/lib/logic/getBlock.d.ts.map +1 -1
- package/lib/logic/getBlock.js +22 -23
- package/lib/logic/getBlock.js.map +1 -1
- package/lib/logic/getStakes.d.ts.map +1 -1
- package/lib/logic/getStakes.js +2 -2
- package/lib/logic/getStakes.js.map +1 -1
- package/lib/logic/internalTransactionsFetcher.d.ts +3 -2
- package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib/logic/internalTransactionsFetcher.js +13 -10
- package/lib/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib/logic/listOperations.js +1 -1
- package/lib/logic/listOperations.js.map +1 -1
- package/lib/logic-public/utils.d.ts +3 -2
- package/lib/logic-public/utils.d.ts.map +1 -1
- package/lib/logic-public/utils.js +7 -6
- package/lib/logic-public/utils.js.map +1 -1
- package/lib/network/explorer/etherscan.d.ts +3 -2
- package/lib/network/explorer/etherscan.d.ts.map +1 -1
- package/lib/network/explorer/etherscan.js +13 -12
- package/lib/network/explorer/etherscan.js.map +1 -1
- package/lib/network/explorer/ledger.d.ts.map +1 -1
- package/lib/network/explorer/ledger.js +11 -11
- package/lib/network/explorer/ledger.js.map +1 -1
- package/lib/network/explorer/types.d.ts +2 -2
- package/lib/network/explorer/types.d.ts.map +1 -1
- package/lib/network/explorer/types.js.map +1 -1
- package/lib/network/node/explorerProxy.js +3 -3
- package/lib/network/node/explorerProxy.js.map +1 -1
- package/lib/network/node/index.d.ts.map +1 -1
- package/lib/network/node/index.js +2 -2
- package/lib/network/node/index.js.map +1 -1
- package/lib/network/node/ledger.d.ts +2 -1
- package/lib/network/node/ledger.d.ts.map +1 -1
- package/lib/network/node/ledger.js +9 -10
- package/lib/network/node/ledger.js.map +1 -1
- package/lib/network/node/rpc.common.d.ts +3 -2
- package/lib/network/node/rpc.common.d.ts.map +1 -1
- package/lib/network/node/rpc.common.js +52 -31
- package/lib/network/node/rpc.common.js.map +1 -1
- package/lib/network/node/rpc.errors.d.ts +1 -3
- package/lib/network/node/rpc.errors.d.ts.map +1 -1
- package/lib/network/node/rpc.errors.js +21 -2
- package/lib/network/node/rpc.errors.js.map +1 -1
- package/lib/staking/contracts.js +2 -2
- package/lib/staking/contracts.js.map +1 -1
- package/lib/staking/fetchers.d.ts.map +1 -1
- package/lib/staking/fetchers.js +7 -7
- package/lib/staking/fetchers.js.map +1 -1
- package/lib/staking/prepareIntents.d.ts +2 -1
- package/lib/staking/prepareIntents.d.ts.map +1 -1
- package/lib/staking/prepareIntents.js +4 -4
- package/lib/staking/prepareIntents.js.map +1 -1
- package/lib/staking/redelegations.d.ts +5 -4
- package/lib/staking/redelegations.d.ts.map +1 -1
- package/lib/staking/redelegations.js +13 -14
- package/lib/staking/redelegations.js.map +1 -1
- package/lib/staking/rewards.d.ts +2 -1
- package/lib/staking/rewards.d.ts.map +1 -1
- package/lib/staking/rewards.js +4 -5
- package/lib/staking/rewards.js.map +1 -1
- package/lib/staking/rewardsFromReceipt.d.ts +2 -1
- package/lib/staking/rewardsFromReceipt.d.ts.map +1 -1
- package/lib/staking/rewardsFromReceipt.js +2 -3
- package/lib/staking/rewardsFromReceipt.js.map +1 -1
- package/lib/staking/unbondings.d.ts +2 -1
- package/lib/staking/unbondings.d.ts.map +1 -1
- package/lib/staking/unbondings.js +4 -5
- package/lib/staking/unbondings.js.map +1 -1
- package/lib/staking/validators/index.d.ts +9 -4
- package/lib/staking/validators/index.d.ts.map +1 -1
- package/lib/staking/validators/index.js +19 -10
- package/lib/staking/validators/index.js.map +1 -1
- package/lib/staking/validators/monad.d.ts +6 -5
- package/lib/staking/validators/monad.d.ts.map +1 -1
- package/lib/staking/validators/monad.js +33 -29
- package/lib/staking/validators/monad.js.map +1 -1
- package/lib/staking/validators/monadResolver.d.ts +2 -1
- package/lib/staking/validators/monadResolver.d.ts.map +1 -1
- package/lib/staking/validators/monadResolver.js +2 -3
- package/lib/staking/validators/monadResolver.js.map +1 -1
- package/lib/staking/validators/somnia.d.ts +3 -2
- package/lib/staking/validators/somnia.d.ts.map +1 -1
- package/lib/staking/validators/somnia.js +16 -15
- package/lib/staking/validators/somnia.js.map +1 -1
- package/lib/staking/validators/types.d.ts +2 -1
- package/lib/staking/validators/types.d.ts.map +1 -1
- package/lib/staking/validators/zero_gravity.d.ts +2 -1
- package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
- package/lib/staking/validators/zero_gravity.js +7 -8
- package/lib/staking/validators/zero_gravity.js.map +1 -1
- package/lib/types/staking.d.ts +4 -3
- package/lib/types/staking.d.ts.map +1 -1
- package/lib-es/adapters/blockOperations.d.ts +4 -3
- package/lib-es/adapters/blockOperations.d.ts.map +1 -1
- package/lib-es/adapters/blockOperations.js +17 -17
- package/lib-es/adapters/blockOperations.js.map +1 -1
- package/lib-es/adapters/etherscan.d.ts +7 -6
- package/lib-es/adapters/etherscan.d.ts.map +1 -1
- package/lib-es/adapters/etherscan.js +19 -19
- package/lib-es/adapters/etherscan.js.map +1 -1
- package/lib-es/adapters/ledger.d.ts +6 -5
- package/lib-es/adapters/ledger.d.ts.map +1 -1
- package/lib-es/adapters/ledger.js +15 -15
- package/lib-es/adapters/ledger.js.map +1 -1
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/api/index.js +1 -2
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/logic/common.js +1 -1
- package/lib-es/logic/common.js.map +1 -1
- package/lib-es/logic/getBalance.d.ts.map +1 -1
- package/lib-es/logic/getBalance.js +3 -3
- package/lib-es/logic/getBalance.js.map +1 -1
- package/lib-es/logic/getBlock.d.ts.map +1 -1
- package/lib-es/logic/getBlock.js +22 -23
- package/lib-es/logic/getBlock.js.map +1 -1
- package/lib-es/logic/getStakes.d.ts.map +1 -1
- package/lib-es/logic/getStakes.js +2 -2
- package/lib-es/logic/getStakes.js.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.d.ts +3 -2
- package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.js +13 -10
- package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib-es/logic/listOperations.js +1 -1
- package/lib-es/logic/listOperations.js.map +1 -1
- package/lib-es/logic-public/utils.d.ts +3 -2
- package/lib-es/logic-public/utils.d.ts.map +1 -1
- package/lib-es/logic-public/utils.js +7 -6
- package/lib-es/logic-public/utils.js.map +1 -1
- package/lib-es/network/explorer/etherscan.d.ts +3 -2
- package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
- package/lib-es/network/explorer/etherscan.js +13 -12
- package/lib-es/network/explorer/etherscan.js.map +1 -1
- package/lib-es/network/explorer/ledger.d.ts.map +1 -1
- package/lib-es/network/explorer/ledger.js +11 -11
- package/lib-es/network/explorer/ledger.js.map +1 -1
- package/lib-es/network/explorer/types.d.ts +2 -2
- package/lib-es/network/explorer/types.d.ts.map +1 -1
- package/lib-es/network/explorer/types.js.map +1 -1
- package/lib-es/network/node/explorerProxy.js +3 -3
- package/lib-es/network/node/explorerProxy.js.map +1 -1
- package/lib-es/network/node/index.d.ts.map +1 -1
- package/lib-es/network/node/index.js +2 -2
- package/lib-es/network/node/index.js.map +1 -1
- package/lib-es/network/node/ledger.d.ts +2 -1
- package/lib-es/network/node/ledger.d.ts.map +1 -1
- package/lib-es/network/node/ledger.js +9 -10
- package/lib-es/network/node/ledger.js.map +1 -1
- package/lib-es/network/node/rpc.common.d.ts +3 -2
- package/lib-es/network/node/rpc.common.d.ts.map +1 -1
- package/lib-es/network/node/rpc.common.js +53 -32
- package/lib-es/network/node/rpc.common.js.map +1 -1
- package/lib-es/network/node/rpc.errors.d.ts +1 -3
- package/lib-es/network/node/rpc.errors.d.ts.map +1 -1
- package/lib-es/network/node/rpc.errors.js +20 -2
- package/lib-es/network/node/rpc.errors.js.map +1 -1
- package/lib-es/staking/contracts.js +2 -2
- package/lib-es/staking/contracts.js.map +1 -1
- package/lib-es/staking/fetchers.d.ts.map +1 -1
- package/lib-es/staking/fetchers.js +7 -7
- package/lib-es/staking/fetchers.js.map +1 -1
- package/lib-es/staking/prepareIntents.d.ts +2 -1
- package/lib-es/staking/prepareIntents.d.ts.map +1 -1
- package/lib-es/staking/prepareIntents.js +4 -4
- package/lib-es/staking/prepareIntents.js.map +1 -1
- package/lib-es/staking/redelegations.d.ts +5 -4
- package/lib-es/staking/redelegations.d.ts.map +1 -1
- package/lib-es/staking/redelegations.js +13 -14
- package/lib-es/staking/redelegations.js.map +1 -1
- package/lib-es/staking/rewards.d.ts +2 -1
- package/lib-es/staking/rewards.d.ts.map +1 -1
- package/lib-es/staking/rewards.js +4 -5
- package/lib-es/staking/rewards.js.map +1 -1
- package/lib-es/staking/rewardsFromReceipt.d.ts +2 -1
- package/lib-es/staking/rewardsFromReceipt.d.ts.map +1 -1
- package/lib-es/staking/rewardsFromReceipt.js +2 -3
- package/lib-es/staking/rewardsFromReceipt.js.map +1 -1
- package/lib-es/staking/unbondings.d.ts +2 -1
- package/lib-es/staking/unbondings.d.ts.map +1 -1
- package/lib-es/staking/unbondings.js +4 -5
- package/lib-es/staking/unbondings.js.map +1 -1
- package/lib-es/staking/validators/index.d.ts +9 -4
- package/lib-es/staking/validators/index.d.ts.map +1 -1
- package/lib-es/staking/validators/index.js +18 -10
- package/lib-es/staking/validators/index.js.map +1 -1
- package/lib-es/staking/validators/monad.d.ts +6 -5
- package/lib-es/staking/validators/monad.d.ts.map +1 -1
- package/lib-es/staking/validators/monad.js +33 -29
- package/lib-es/staking/validators/monad.js.map +1 -1
- package/lib-es/staking/validators/monadResolver.d.ts +2 -1
- package/lib-es/staking/validators/monadResolver.d.ts.map +1 -1
- package/lib-es/staking/validators/monadResolver.js +2 -3
- package/lib-es/staking/validators/monadResolver.js.map +1 -1
- package/lib-es/staking/validators/somnia.d.ts +3 -2
- package/lib-es/staking/validators/somnia.d.ts.map +1 -1
- package/lib-es/staking/validators/somnia.js +16 -15
- package/lib-es/staking/validators/somnia.js.map +1 -1
- package/lib-es/staking/validators/types.d.ts +2 -1
- package/lib-es/staking/validators/types.d.ts.map +1 -1
- package/lib-es/staking/validators/zero_gravity.d.ts +2 -1
- package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
- package/lib-es/staking/validators/zero_gravity.js +7 -8
- package/lib-es/staking/validators/zero_gravity.js.map +1 -1
- package/lib-es/types/staking.d.ts +4 -3
- package/lib-es/types/staking.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/adapters/blockOperations.test.ts +86 -67
- package/src/adapters/blockOperations.ts +28 -17
- package/src/adapters/etherscan.test.ts +151 -85
- package/src/adapters/etherscan.ts +27 -18
- package/src/adapters/ledger.test.ts +210 -83
- package/src/adapters/ledger.ts +21 -15
- package/src/api/index.integ.test.ts +7 -6
- package/src/api/index.test.ts +2 -2
- package/src/api/index.ts +1 -2
- package/src/logic/common.ts +1 -1
- package/src/logic/getBalance.ts +4 -3
- package/src/logic/getBlock.ts +43 -27
- package/src/logic/getStakes.ts +2 -1
- package/src/logic/internalTransactionsFetcher.ts +16 -10
- package/src/logic/listOperations.ts +2 -2
- package/src/logic/tests/getBalance.test.ts +5 -3
- package/src/logic/tests/getBlock.test.ts +16 -15
- package/src/logic/tests/internalTransactionsFetcher.test.ts +6 -5
- package/src/logic/tests/listOperations.test.ts +4 -4
- package/src/logic-public/tests/utils.test.ts +6 -5
- package/src/logic-public/utils.ts +8 -5
- package/src/logic.test.ts +5 -5
- package/src/network/explorer/etherscan.test.ts +169 -55
- package/src/network/explorer/etherscan.ts +27 -16
- package/src/network/explorer/index.test.ts +2 -1
- package/src/network/explorer/ledger.test.ts +207 -35
- package/src/network/explorer/ledger.ts +12 -8
- package/src/network/explorer/types.ts +3 -2
- package/src/network/node/explorerProxy.ts +3 -3
- package/src/network/node/index.ts +3 -2
- package/src/network/node/ledger.test.ts +25 -25
- package/src/network/node/ledger.ts +13 -10
- package/src/network/node/rpc.common.ts +107 -30
- package/src/network/node/rpc.errors.test.ts +53 -1
- package/src/network/node/rpc.errors.ts +25 -2
- package/src/network/node/rpc.test.ts +106 -47
- package/src/staking/contracts.ts +2 -2
- package/src/staking/fetchers.ts +20 -8
- package/src/staking/prepareIntents.test.ts +33 -12
- package/src/staking/prepareIntents.ts +9 -5
- package/src/staking/redelegations.test.ts +96 -35
- package/src/staking/redelegations.ts +20 -12
- package/src/staking/rewards.test.ts +15 -10
- package/src/staking/rewards.ts +8 -5
- package/src/staking/rewardsFromReceipt.test.ts +5 -4
- package/src/staking/rewardsFromReceipt.ts +4 -3
- package/src/staking/unbondings.test.ts +15 -12
- package/src/staking/unbondings.ts +7 -5
- package/src/staking/validators/index.ts +30 -10
- package/src/staking/validators/monad.test.ts +57 -43
- package/src/staking/validators/monad.ts +55 -32
- package/src/staking/validators/monadResolver.ts +4 -3
- package/src/staking/validators/somnia.test.ts +14 -13
- package/src/staking/validators/somnia.ts +35 -19
- package/src/staking/validators/types.ts +2 -0
- package/src/staking/validators/zero_gravity.test.ts +48 -26
- package/src/staking/validators/zero_gravity.ts +14 -8
- package/src/staking/validators.integ.test.ts +2 -2
- package/src/staking/validators.test.ts +30 -26
- package/src/types/staking.ts +9 -2
|
@@ -61,6 +61,7 @@ const createFetchWithLimit =
|
|
|
61
61
|
address: address,
|
|
62
62
|
fromBlock: 0,
|
|
63
63
|
sort,
|
|
64
|
+
logger: testLogger,
|
|
64
65
|
...(limit !== undefined ? { limit } : {}),
|
|
65
66
|
})
|
|
66
67
|
}
|
|
@@ -196,6 +197,7 @@ describe('EVM Family', () => {
|
|
|
196
197
|
address,
|
|
197
198
|
fromBlock: 0,
|
|
198
199
|
sort: 'asc',
|
|
200
|
+
logger: testLogger,
|
|
199
201
|
})
|
|
200
202
|
|
|
201
203
|
expect(response).toEqual({
|
|
@@ -229,6 +231,7 @@ describe('EVM Family', () => {
|
|
|
229
231
|
address: address,
|
|
230
232
|
fromBlock: 0,
|
|
231
233
|
sort: 'desc',
|
|
234
|
+
logger: testLogger,
|
|
232
235
|
})
|
|
233
236
|
fail('Promise should have been rejected')
|
|
234
237
|
} catch (e) {
|
|
@@ -252,12 +255,13 @@ describe('EVM Family', () => {
|
|
|
252
255
|
address: address,
|
|
253
256
|
fromBlock: 0,
|
|
254
257
|
sort: 'desc',
|
|
258
|
+
logger: testLogger,
|
|
255
259
|
})
|
|
256
260
|
|
|
257
261
|
expect(response.operations.length).toBe(4)
|
|
258
262
|
expect(response).toEqual({
|
|
259
263
|
operations: etherscanCoinOperations
|
|
260
|
-
.map((op) => etherscanOperationToOperations(address, currencyId, op))
|
|
264
|
+
.map((op) => etherscanOperationToOperations(address, currencyId, op, testLogger))
|
|
261
265
|
.flat(),
|
|
262
266
|
isDone: true,
|
|
263
267
|
boundBlock: 14923692,
|
|
@@ -289,12 +293,13 @@ describe('EVM Family', () => {
|
|
|
289
293
|
address: address,
|
|
290
294
|
fromBlock: 50,
|
|
291
295
|
sort: 'desc',
|
|
296
|
+
logger: testLogger,
|
|
292
297
|
})
|
|
293
298
|
|
|
294
299
|
expect(response.operations.length).toBe(4)
|
|
295
300
|
expect(response).toEqual({
|
|
296
301
|
operations: etherscanCoinOperations
|
|
297
|
-
.map((op) => etherscanOperationToOperations(address, currencyId, op))
|
|
302
|
+
.map((op) => etherscanOperationToOperations(address, currencyId, op, testLogger))
|
|
298
303
|
.flat(),
|
|
299
304
|
isDone: true,
|
|
300
305
|
boundBlock: 14923692,
|
|
@@ -327,12 +332,13 @@ describe('EVM Family', () => {
|
|
|
327
332
|
fromBlock: 50,
|
|
328
333
|
toBlock: 100,
|
|
329
334
|
sort: 'desc',
|
|
335
|
+
logger: testLogger,
|
|
330
336
|
})
|
|
331
337
|
|
|
332
338
|
expect(response.operations.length).toBe(4)
|
|
333
339
|
expect(response).toEqual({
|
|
334
340
|
operations: etherscanCoinOperations
|
|
335
|
-
.map((op) => etherscanOperationToOperations(address, currencyId, op))
|
|
341
|
+
.map((op) => etherscanOperationToOperations(address, currencyId, op, testLogger))
|
|
336
342
|
.flat(),
|
|
337
343
|
isDone: true,
|
|
338
344
|
boundBlock: 14923692,
|
|
@@ -444,6 +450,7 @@ describe('EVM Family', () => {
|
|
|
444
450
|
address: address,
|
|
445
451
|
fromBlock: 0,
|
|
446
452
|
sort: 'desc',
|
|
453
|
+
logger: testLogger,
|
|
447
454
|
})
|
|
448
455
|
fail('Promise should have been rejected')
|
|
449
456
|
} catch (e) {
|
|
@@ -467,14 +474,15 @@ describe('EVM Family', () => {
|
|
|
467
474
|
address: address,
|
|
468
475
|
fromBlock: 0,
|
|
469
476
|
sort: 'desc',
|
|
477
|
+
logger: testLogger,
|
|
470
478
|
})
|
|
471
479
|
|
|
472
480
|
expect(response.operations.length).toBe(4)
|
|
473
481
|
expect(response).toEqual({
|
|
474
482
|
operations: [
|
|
475
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0),
|
|
476
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0),
|
|
477
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1),
|
|
483
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0, testLogger),
|
|
484
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0, testLogger),
|
|
485
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1, testLogger),
|
|
478
486
|
].flat(),
|
|
479
487
|
isDone: true,
|
|
480
488
|
boundBlock: 4764973,
|
|
@@ -506,14 +514,15 @@ describe('EVM Family', () => {
|
|
|
506
514
|
address: address,
|
|
507
515
|
fromBlock: 50,
|
|
508
516
|
sort: 'desc',
|
|
517
|
+
logger: testLogger,
|
|
509
518
|
})
|
|
510
519
|
|
|
511
520
|
expect(response.operations.length).toBe(4)
|
|
512
521
|
expect(response).toEqual({
|
|
513
522
|
operations: [
|
|
514
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0),
|
|
515
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0),
|
|
516
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1),
|
|
523
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0, testLogger),
|
|
524
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0, testLogger),
|
|
525
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1, testLogger),
|
|
517
526
|
].flat(),
|
|
518
527
|
isDone: true,
|
|
519
528
|
boundBlock: 4764973,
|
|
@@ -546,14 +555,15 @@ describe('EVM Family', () => {
|
|
|
546
555
|
fromBlock: 50,
|
|
547
556
|
toBlock: 100,
|
|
548
557
|
sort: 'desc',
|
|
558
|
+
logger: testLogger,
|
|
549
559
|
})
|
|
550
560
|
|
|
551
561
|
expect(response.operations.length).toBe(4)
|
|
552
562
|
expect(response).toEqual({
|
|
553
563
|
operations: [
|
|
554
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0),
|
|
555
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0),
|
|
556
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1),
|
|
564
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0, testLogger),
|
|
565
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0, testLogger),
|
|
566
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1, testLogger),
|
|
557
567
|
].flat(),
|
|
558
568
|
isDone: true,
|
|
559
569
|
boundBlock: 4764973,
|
|
@@ -672,6 +682,7 @@ describe('EVM Family', () => {
|
|
|
672
682
|
address: address,
|
|
673
683
|
fromBlock: 0,
|
|
674
684
|
sort: 'desc',
|
|
685
|
+
logger: testLogger,
|
|
675
686
|
})
|
|
676
687
|
|
|
677
688
|
expect(response.operations).toHaveLength(0)
|
|
@@ -689,6 +700,7 @@ describe('EVM Family', () => {
|
|
|
689
700
|
address: address,
|
|
690
701
|
fromBlock: 0,
|
|
691
702
|
sort: 'desc',
|
|
703
|
+
logger: testLogger,
|
|
692
704
|
})
|
|
693
705
|
|
|
694
706
|
expect(response.operations).toHaveLength(0)
|
|
@@ -706,6 +718,7 @@ describe('EVM Family', () => {
|
|
|
706
718
|
address: address,
|
|
707
719
|
fromBlock: 0,
|
|
708
720
|
sort: 'desc',
|
|
721
|
+
logger: testLogger,
|
|
709
722
|
})
|
|
710
723
|
|
|
711
724
|
// 3 raw events => 4 processed ops (one event yields two ops via group/index logic)
|
|
@@ -724,6 +737,7 @@ describe('EVM Family', () => {
|
|
|
724
737
|
address: address,
|
|
725
738
|
fromBlock: 0,
|
|
726
739
|
sort: 'desc',
|
|
740
|
+
logger: testLogger,
|
|
727
741
|
})
|
|
728
742
|
|
|
729
743
|
expect(response.operations).toHaveLength(4)
|
|
@@ -752,6 +766,7 @@ describe('EVM Family', () => {
|
|
|
752
766
|
address: address,
|
|
753
767
|
fromBlock: 0,
|
|
754
768
|
sort: 'desc',
|
|
769
|
+
logger: testLogger,
|
|
755
770
|
})
|
|
756
771
|
fail('Promise should have been rejected')
|
|
757
772
|
} catch (e) {
|
|
@@ -775,14 +790,15 @@ describe('EVM Family', () => {
|
|
|
775
790
|
address: address,
|
|
776
791
|
fromBlock: 0,
|
|
777
792
|
sort: 'desc',
|
|
793
|
+
logger: testLogger,
|
|
778
794
|
})
|
|
779
795
|
|
|
780
796
|
expect(response.operations.length).toBe(4)
|
|
781
797
|
expect(response).toEqual({
|
|
782
798
|
operations: [
|
|
783
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[0], 0),
|
|
784
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[1], 0),
|
|
785
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[2], 1),
|
|
799
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[0], 0, testLogger),
|
|
800
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[1], 0, testLogger),
|
|
801
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[2], 1, testLogger),
|
|
786
802
|
].flat(),
|
|
787
803
|
isDone: true,
|
|
788
804
|
boundBlock: 4708161,
|
|
@@ -813,14 +829,15 @@ describe('EVM Family', () => {
|
|
|
813
829
|
address: address,
|
|
814
830
|
fromBlock: 50,
|
|
815
831
|
sort: 'desc',
|
|
832
|
+
logger: testLogger,
|
|
816
833
|
})
|
|
817
834
|
|
|
818
835
|
expect(response.operations.length).toBe(4)
|
|
819
836
|
expect(response).toEqual({
|
|
820
837
|
operations: [
|
|
821
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[0], 0),
|
|
822
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[1], 0),
|
|
823
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[2], 1),
|
|
838
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[0], 0, testLogger),
|
|
839
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[1], 0, testLogger),
|
|
840
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[2], 1, testLogger),
|
|
824
841
|
].flat(),
|
|
825
842
|
isDone: true,
|
|
826
843
|
boundBlock: 4708161,
|
|
@@ -852,14 +869,15 @@ describe('EVM Family', () => {
|
|
|
852
869
|
fromBlock: 50,
|
|
853
870
|
toBlock: 100,
|
|
854
871
|
sort: 'desc',
|
|
872
|
+
logger: testLogger,
|
|
855
873
|
})
|
|
856
874
|
|
|
857
875
|
expect(response.operations.length).toBe(4)
|
|
858
876
|
expect(response).toEqual({
|
|
859
877
|
operations: [
|
|
860
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[0], 0),
|
|
861
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[1], 0),
|
|
862
|
-
etherscanERC721EventToOperations(address, etherscanERC721Operations[2], 1),
|
|
878
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[0], 0, testLogger),
|
|
879
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[1], 0, testLogger),
|
|
880
|
+
etherscanERC721EventToOperations(address, etherscanERC721Operations[2], 1, testLogger),
|
|
863
881
|
].flat(),
|
|
864
882
|
isDone: true,
|
|
865
883
|
boundBlock: 4708161,
|
|
@@ -974,6 +992,7 @@ describe('EVM Family', () => {
|
|
|
974
992
|
address: address,
|
|
975
993
|
fromBlock: 0,
|
|
976
994
|
sort: 'desc',
|
|
995
|
+
logger: testLogger,
|
|
977
996
|
})
|
|
978
997
|
fail('Promise should have been rejected')
|
|
979
998
|
} catch (e) {
|
|
@@ -997,14 +1016,15 @@ describe('EVM Family', () => {
|
|
|
997
1016
|
address: address,
|
|
998
1017
|
fromBlock: 0,
|
|
999
1018
|
sort: 'desc',
|
|
1019
|
+
logger: testLogger,
|
|
1000
1020
|
})
|
|
1001
1021
|
|
|
1002
1022
|
expect(response.operations.length).toBe(4)
|
|
1003
1023
|
expect(response).toEqual({
|
|
1004
1024
|
operations: [
|
|
1005
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[0], 0),
|
|
1006
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[1], 0),
|
|
1007
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[2], 1),
|
|
1025
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[0], 0, testLogger),
|
|
1026
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[1], 0, testLogger),
|
|
1027
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[2], 1, testLogger),
|
|
1008
1028
|
].flat(),
|
|
1009
1029
|
isDone: true,
|
|
1010
1030
|
boundBlock: 14049909,
|
|
@@ -1035,14 +1055,15 @@ describe('EVM Family', () => {
|
|
|
1035
1055
|
address: address,
|
|
1036
1056
|
fromBlock: 50,
|
|
1037
1057
|
sort: 'desc',
|
|
1058
|
+
logger: testLogger,
|
|
1038
1059
|
})
|
|
1039
1060
|
|
|
1040
1061
|
expect(response.operations.length).toBe(4)
|
|
1041
1062
|
expect(response).toEqual({
|
|
1042
1063
|
operations: [
|
|
1043
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[0], 0),
|
|
1044
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[1], 0),
|
|
1045
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[2], 1),
|
|
1064
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[0], 0, testLogger),
|
|
1065
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[1], 0, testLogger),
|
|
1066
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[2], 1, testLogger),
|
|
1046
1067
|
].flat(),
|
|
1047
1068
|
isDone: true,
|
|
1048
1069
|
boundBlock: 14049909,
|
|
@@ -1074,14 +1095,15 @@ describe('EVM Family', () => {
|
|
|
1074
1095
|
fromBlock: 50,
|
|
1075
1096
|
toBlock: 100,
|
|
1076
1097
|
sort: 'desc',
|
|
1098
|
+
logger: testLogger,
|
|
1077
1099
|
})
|
|
1078
1100
|
|
|
1079
1101
|
expect(response.operations.length).toBe(4)
|
|
1080
1102
|
expect(response).toEqual({
|
|
1081
1103
|
operations: [
|
|
1082
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[0], 0),
|
|
1083
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[1], 0),
|
|
1084
|
-
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[2], 1),
|
|
1104
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[0], 0, testLogger),
|
|
1105
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[1], 0, testLogger),
|
|
1106
|
+
etherscanERC1155EventToOperations(address, etherscanERC1155Operations[2], 1, testLogger),
|
|
1085
1107
|
].flat(),
|
|
1086
1108
|
isDone: true,
|
|
1087
1109
|
boundBlock: 14049909,
|
|
@@ -1191,6 +1213,7 @@ describe('EVM Family', () => {
|
|
|
1191
1213
|
address: address,
|
|
1192
1214
|
fromBlock: 0,
|
|
1193
1215
|
sort: 'desc',
|
|
1216
|
+
logger: testLogger,
|
|
1194
1217
|
})
|
|
1195
1218
|
|
|
1196
1219
|
// Verify operations are sorted by date descending
|
|
@@ -1224,6 +1247,7 @@ describe('EVM Family', () => {
|
|
|
1224
1247
|
address: address,
|
|
1225
1248
|
fromBlock: 0,
|
|
1226
1249
|
sort,
|
|
1250
|
+
logger: testLogger,
|
|
1227
1251
|
...(limit !== undefined ? { limit } : {}),
|
|
1228
1252
|
})
|
|
1229
1253
|
}
|
|
@@ -1295,6 +1319,7 @@ describe('EVM Family', () => {
|
|
|
1295
1319
|
address: address,
|
|
1296
1320
|
fromBlock: 0,
|
|
1297
1321
|
sort,
|
|
1322
|
+
logger: testLogger,
|
|
1298
1323
|
})
|
|
1299
1324
|
}
|
|
1300
1325
|
|
|
@@ -1329,6 +1354,7 @@ describe('EVM Family', () => {
|
|
|
1329
1354
|
address: address,
|
|
1330
1355
|
fromBlock: 0,
|
|
1331
1356
|
sort: 'desc',
|
|
1357
|
+
logger: testLogger,
|
|
1332
1358
|
})
|
|
1333
1359
|
fail('Promise should have been rejected')
|
|
1334
1360
|
} catch (e) {
|
|
@@ -1352,14 +1378,30 @@ describe('EVM Family', () => {
|
|
|
1352
1378
|
address: address,
|
|
1353
1379
|
fromBlock: 0,
|
|
1354
1380
|
sort: 'desc',
|
|
1381
|
+
logger: testLogger,
|
|
1355
1382
|
})
|
|
1356
1383
|
|
|
1357
1384
|
expect(response.operations.length).toBe(3)
|
|
1358
1385
|
expect(response).toEqual({
|
|
1359
1386
|
operations: [
|
|
1360
|
-
etherscanInternalTransactionToOperations(
|
|
1361
|
-
|
|
1362
|
-
|
|
1387
|
+
etherscanInternalTransactionToOperations(
|
|
1388
|
+
address,
|
|
1389
|
+
etherscanInternalOperations[0],
|
|
1390
|
+
0,
|
|
1391
|
+
testLogger
|
|
1392
|
+
),
|
|
1393
|
+
etherscanInternalTransactionToOperations(
|
|
1394
|
+
address,
|
|
1395
|
+
etherscanInternalOperations[1],
|
|
1396
|
+
1,
|
|
1397
|
+
testLogger
|
|
1398
|
+
),
|
|
1399
|
+
etherscanInternalTransactionToOperations(
|
|
1400
|
+
address,
|
|
1401
|
+
etherscanInternalOperations[2],
|
|
1402
|
+
0,
|
|
1403
|
+
testLogger
|
|
1404
|
+
),
|
|
1363
1405
|
].flat(),
|
|
1364
1406
|
isDone: true,
|
|
1365
1407
|
boundBlock: 15214745,
|
|
@@ -1391,14 +1433,30 @@ describe('EVM Family', () => {
|
|
|
1391
1433
|
address: address,
|
|
1392
1434
|
fromBlock: 50,
|
|
1393
1435
|
sort: 'desc',
|
|
1436
|
+
logger: testLogger,
|
|
1394
1437
|
})
|
|
1395
1438
|
|
|
1396
1439
|
expect(response.operations.length).toBe(3)
|
|
1397
1440
|
expect(response).toEqual({
|
|
1398
1441
|
operations: [
|
|
1399
|
-
etherscanInternalTransactionToOperations(
|
|
1400
|
-
|
|
1401
|
-
|
|
1442
|
+
etherscanInternalTransactionToOperations(
|
|
1443
|
+
address,
|
|
1444
|
+
etherscanInternalOperations[0],
|
|
1445
|
+
0,
|
|
1446
|
+
testLogger
|
|
1447
|
+
),
|
|
1448
|
+
etherscanInternalTransactionToOperations(
|
|
1449
|
+
address,
|
|
1450
|
+
etherscanInternalOperations[1],
|
|
1451
|
+
1,
|
|
1452
|
+
testLogger
|
|
1453
|
+
),
|
|
1454
|
+
etherscanInternalTransactionToOperations(
|
|
1455
|
+
address,
|
|
1456
|
+
etherscanInternalOperations[2],
|
|
1457
|
+
0,
|
|
1458
|
+
testLogger
|
|
1459
|
+
),
|
|
1402
1460
|
].flat(),
|
|
1403
1461
|
isDone: true,
|
|
1404
1462
|
boundBlock: 15214745,
|
|
@@ -1431,14 +1489,30 @@ describe('EVM Family', () => {
|
|
|
1431
1489
|
fromBlock: 50,
|
|
1432
1490
|
toBlock: 100,
|
|
1433
1491
|
sort: 'desc',
|
|
1492
|
+
logger: testLogger,
|
|
1434
1493
|
})
|
|
1435
1494
|
|
|
1436
1495
|
expect(response.operations.length).toBe(3)
|
|
1437
1496
|
expect(response).toEqual({
|
|
1438
1497
|
operations: [
|
|
1439
|
-
etherscanInternalTransactionToOperations(
|
|
1440
|
-
|
|
1441
|
-
|
|
1498
|
+
etherscanInternalTransactionToOperations(
|
|
1499
|
+
address,
|
|
1500
|
+
etherscanInternalOperations[0],
|
|
1501
|
+
0,
|
|
1502
|
+
testLogger
|
|
1503
|
+
),
|
|
1504
|
+
etherscanInternalTransactionToOperations(
|
|
1505
|
+
address,
|
|
1506
|
+
etherscanInternalOperations[1],
|
|
1507
|
+
1,
|
|
1508
|
+
testLogger
|
|
1509
|
+
),
|
|
1510
|
+
etherscanInternalTransactionToOperations(
|
|
1511
|
+
address,
|
|
1512
|
+
etherscanInternalOperations[2],
|
|
1513
|
+
0,
|
|
1514
|
+
testLogger
|
|
1515
|
+
),
|
|
1442
1516
|
].flat(),
|
|
1443
1517
|
isDone: true,
|
|
1444
1518
|
boundBlock: 15214745,
|
|
@@ -1476,13 +1550,29 @@ describe('EVM Family', () => {
|
|
|
1476
1550
|
address: address,
|
|
1477
1551
|
fromBlock: 0,
|
|
1478
1552
|
sort: 'desc',
|
|
1553
|
+
logger: testLogger,
|
|
1479
1554
|
})
|
|
1480
1555
|
|
|
1481
1556
|
expect(response.operations).toEqual(
|
|
1482
1557
|
[
|
|
1483
|
-
etherscanInternalTransactionToOperations(
|
|
1484
|
-
|
|
1485
|
-
|
|
1558
|
+
etherscanInternalTransactionToOperations(
|
|
1559
|
+
address,
|
|
1560
|
+
etherscanInternalOperations[0],
|
|
1561
|
+
0,
|
|
1562
|
+
testLogger
|
|
1563
|
+
),
|
|
1564
|
+
etherscanInternalTransactionToOperations(
|
|
1565
|
+
address,
|
|
1566
|
+
etherscanInternalOperations[1],
|
|
1567
|
+
1,
|
|
1568
|
+
testLogger
|
|
1569
|
+
),
|
|
1570
|
+
etherscanInternalTransactionToOperations(
|
|
1571
|
+
address,
|
|
1572
|
+
etherscanInternalOperations[2],
|
|
1573
|
+
0,
|
|
1574
|
+
testLogger
|
|
1575
|
+
),
|
|
1486
1576
|
].flat()
|
|
1487
1577
|
)
|
|
1488
1578
|
})
|
|
@@ -1500,6 +1590,7 @@ describe('EVM Family', () => {
|
|
|
1500
1590
|
address: address,
|
|
1501
1591
|
fromBlock: 0,
|
|
1502
1592
|
sort: 'asc',
|
|
1593
|
+
logger: testLogger,
|
|
1503
1594
|
})
|
|
1504
1595
|
|
|
1505
1596
|
expect(response.operations).toEqual([])
|
|
@@ -1793,6 +1884,7 @@ describe('EVM Family', () => {
|
|
|
1793
1884
|
address: address,
|
|
1794
1885
|
fromBlock: 0,
|
|
1795
1886
|
sort: 'desc',
|
|
1887
|
+
logger: testLogger,
|
|
1796
1888
|
})
|
|
1797
1889
|
expect(response).toEqual({
|
|
1798
1890
|
operations: [],
|
|
@@ -1830,6 +1922,7 @@ describe('EVM Family', () => {
|
|
|
1830
1922
|
address: '0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d',
|
|
1831
1923
|
fromBlock: 0,
|
|
1832
1924
|
sort: 'desc',
|
|
1925
|
+
logger: testLogger,
|
|
1833
1926
|
})
|
|
1834
1927
|
const requestedUrls = requestSpy.mock.calls.map(([{ url }]) => url ?? '')
|
|
1835
1928
|
return {
|
|
@@ -1912,14 +2005,14 @@ describe('EVM Family', () => {
|
|
|
1912
2005
|
await expect(
|
|
1913
2006
|
ETHERSCAN_API.getOperations.force(
|
|
1914
2007
|
config,
|
|
2008
|
+
testLogger,
|
|
1915
2009
|
currencyId,
|
|
1916
2010
|
address,
|
|
1917
2011
|
0,
|
|
1918
2012
|
undefined,
|
|
1919
2013
|
undefined,
|
|
1920
2014
|
1,
|
|
1921
|
-
'asc'
|
|
1922
|
-
testLogger
|
|
2015
|
+
'asc'
|
|
1923
2016
|
)
|
|
1924
2017
|
).rejects.toBeInstanceOf(RateLimitError)
|
|
1925
2018
|
})
|
|
@@ -2091,14 +2184,14 @@ describe('EVM Family', () => {
|
|
|
2091
2184
|
jest.spyOn(axios, 'request').mockImplementation(createBlockchainMock(allOps, limit, order))
|
|
2092
2185
|
return ETHERSCAN_API.getOperations.force(
|
|
2093
2186
|
config,
|
|
2187
|
+
testLogger,
|
|
2094
2188
|
currencyId,
|
|
2095
2189
|
address,
|
|
2096
2190
|
fromBlock,
|
|
2097
2191
|
toBlock,
|
|
2098
2192
|
pagingToken,
|
|
2099
2193
|
limit,
|
|
2100
|
-
order
|
|
2101
|
-
testLogger
|
|
2194
|
+
order
|
|
2102
2195
|
)
|
|
2103
2196
|
}
|
|
2104
2197
|
|
|
@@ -2973,6 +3066,7 @@ describe('EVM Family', () => {
|
|
|
2973
3066
|
fromBlock: 0,
|
|
2974
3067
|
limit: LIMIT,
|
|
2975
3068
|
sort: 'desc',
|
|
3069
|
+
logger: testLogger,
|
|
2976
3070
|
},
|
|
2977
3071
|
testLogger
|
|
2978
3072
|
)
|
|
@@ -3007,6 +3101,7 @@ describe('EVM Family', () => {
|
|
|
3007
3101
|
fromBlock: 0,
|
|
3008
3102
|
limit: LIMIT,
|
|
3009
3103
|
sort: 'desc',
|
|
3104
|
+
logger: testLogger,
|
|
3010
3105
|
},
|
|
3011
3106
|
testLogger
|
|
3012
3107
|
)
|
|
@@ -3030,6 +3125,7 @@ describe('EVM Family', () => {
|
|
|
3030
3125
|
fromBlock: 0,
|
|
3031
3126
|
limit: LIMIT,
|
|
3032
3127
|
sort: 'desc',
|
|
3128
|
+
logger: testLogger,
|
|
3033
3129
|
},
|
|
3034
3130
|
testLogger
|
|
3035
3131
|
)
|
|
@@ -3052,6 +3148,7 @@ describe('EVM Family', () => {
|
|
|
3052
3148
|
fromBlock: 0,
|
|
3053
3149
|
limit: LIMIT,
|
|
3054
3150
|
sort: 'desc',
|
|
3151
|
+
logger: testLogger,
|
|
3055
3152
|
},
|
|
3056
3153
|
testLogger
|
|
3057
3154
|
)
|
|
@@ -3077,6 +3174,7 @@ describe('EVM Family', () => {
|
|
|
3077
3174
|
fromBlock: 0,
|
|
3078
3175
|
limit: LIMIT,
|
|
3079
3176
|
sort: 'desc',
|
|
3177
|
+
logger: testLogger,
|
|
3080
3178
|
},
|
|
3081
3179
|
testLogger
|
|
3082
3180
|
)
|
|
@@ -3091,7 +3189,15 @@ describe('EVM Family', () => {
|
|
|
3091
3189
|
|
|
3092
3190
|
await ETHERSCAN_API.exhaustEndpoint(
|
|
3093
3191
|
mockFetch,
|
|
3094
|
-
{
|
|
3192
|
+
{
|
|
3193
|
+
currencyId,
|
|
3194
|
+
config,
|
|
3195
|
+
address,
|
|
3196
|
+
fromBlock: 0,
|
|
3197
|
+
limit: LIMIT,
|
|
3198
|
+
sort: 'desc',
|
|
3199
|
+
logger: testLogger,
|
|
3200
|
+
},
|
|
3095
3201
|
logger
|
|
3096
3202
|
)
|
|
3097
3203
|
|
|
@@ -3122,6 +3228,7 @@ describe('EVM Family', () => {
|
|
|
3122
3228
|
fromBlock: 0,
|
|
3123
3229
|
limit: 100,
|
|
3124
3230
|
sort: 'desc',
|
|
3231
|
+
logger: testLogger,
|
|
3125
3232
|
},
|
|
3126
3233
|
testLogger
|
|
3127
3234
|
)
|
|
@@ -3201,6 +3308,7 @@ describe('EVM Family', () => {
|
|
|
3201
3308
|
fromBlock: 0,
|
|
3202
3309
|
limit: LIMIT,
|
|
3203
3310
|
sort: 'desc',
|
|
3311
|
+
logger: testLogger,
|
|
3204
3312
|
},
|
|
3205
3313
|
testLogger
|
|
3206
3314
|
)
|
|
@@ -3224,12 +3332,18 @@ describe('EVM Family', () => {
|
|
|
3224
3332
|
data: { result: etherscanTokenOperations },
|
|
3225
3333
|
}))
|
|
3226
3334
|
|
|
3227
|
-
const assets = await ETHERSCAN_API.discoverTokenAssets.force(
|
|
3335
|
+
const assets = await ETHERSCAN_API.discoverTokenAssets.force(
|
|
3336
|
+
config,
|
|
3337
|
+
testLogger,
|
|
3338
|
+
currencyId,
|
|
3339
|
+
address,
|
|
3340
|
+
0
|
|
3341
|
+
)
|
|
3228
3342
|
|
|
3229
3343
|
const expectedOperations = [
|
|
3230
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0),
|
|
3231
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0),
|
|
3232
|
-
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1),
|
|
3344
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[0], 0, testLogger),
|
|
3345
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[1], 0, testLogger),
|
|
3346
|
+
etherscanERC20EventToOperations(address, etherscanTokenOperations[2], 1, testLogger),
|
|
3233
3347
|
].flat()
|
|
3234
3348
|
const expectedReferences = new Set(
|
|
3235
3349
|
expectedOperations
|
|
@@ -3257,7 +3371,7 @@ describe('EVM Family', () => {
|
|
|
3257
3371
|
data: { result: etherscanTokenOperations },
|
|
3258
3372
|
}))
|
|
3259
3373
|
|
|
3260
|
-
await ETHERSCAN_API.discoverTokenAssets.force(config, currencyId, address, 0)
|
|
3374
|
+
await ETHERSCAN_API.discoverTokenAssets.force(config, testLogger, currencyId, address, 0)
|
|
3261
3375
|
|
|
3262
3376
|
expect(requestSpy).toHaveBeenCalledTimes(1)
|
|
3263
3377
|
expect(requestSpy).toHaveBeenCalledWith(
|
|
@@ -3270,12 +3384,12 @@ describe('EVM Family', () => {
|
|
|
3270
3384
|
data: { result: etherscanTokenOperations },
|
|
3271
3385
|
}))
|
|
3272
3386
|
|
|
3273
|
-
await ETHERSCAN_API.discoverTokenAssets(config, currencyId, address, 999)
|
|
3274
|
-
await ETHERSCAN_API.discoverTokenAssets(config, currencyId, address, 999)
|
|
3387
|
+
await ETHERSCAN_API.discoverTokenAssets(config, testLogger, currencyId, address, 999)
|
|
3388
|
+
await ETHERSCAN_API.discoverTokenAssets(config, testLogger, currencyId, address, 999)
|
|
3275
3389
|
|
|
3276
3390
|
expect(requestSpy).toHaveBeenCalledTimes(1)
|
|
3277
3391
|
|
|
3278
|
-
await ETHERSCAN_API.discoverTokenAssets.force(config, currencyId, address, 999)
|
|
3392
|
+
await ETHERSCAN_API.discoverTokenAssets.force(config, testLogger, currencyId, address, 999)
|
|
3279
3393
|
|
|
3280
3394
|
expect(requestSpy).toHaveBeenCalledTimes(2)
|
|
3281
3395
|
})
|