@ledgerhq/coin-evm 7.0.0 → 9.0.0
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/.oxlintrc.json +1 -1
- package/CHANGELOG.md +62 -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/config.d.ts +0 -1
- package/lib/config.d.ts.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 +37 -29
- package/lib/network/node/rpc.common.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/config.d.ts +0 -1
- package/lib-es/config.d.ts.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 +37 -29
- package/lib-es/network/node/rpc.common.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/getBlock.integ.test.ts +10 -4
- package/src/api/index.arbitrum.integ.test.ts +1 -0
- package/src/api/index.arc.integ.test.ts +1 -0
- package/src/api/index.avalanche_c_chain_fuji.integ.test.ts +1 -0
- package/src/api/index.cronos.integ.test.ts +1 -0
- package/src/api/index.flare.integ.test.ts +4 -2
- package/src/api/index.integ.test.ts +7 -6
- package/src/api/index.linea.integ.test.ts +4 -2
- package/src/api/index.optimism.integ.test.ts +1 -0
- package/src/api/index.rsk.integ.test.ts +1 -0
- package/src/api/index.shape.integ.test.ts +4 -2
- package/src/api/index.somnia.integ.test.ts +1 -0
- package/src/api/index.test.ts +2 -2
- package/src/api/index.ts +1 -2
- package/src/config.ts +0 -1
- package/src/fixtures/context.fixtures.ts +5 -5
- 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 +208 -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/node.fixtures.ts +2 -1
- package/src/network/node/rpc.common.ts +84 -28
- package/src/network/node/rpc.test.ts +45 -31
- 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 +98 -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 +16 -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 +31 -26
- package/src/types/staking.ts +9 -2
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
deserializePagingToken,
|
|
22
22
|
serializePagingToken,
|
|
23
23
|
} from '../adapters'
|
|
24
|
+
import { testLogger } from '../fixtures/context.fixtures'
|
|
24
25
|
import { NO_TOKEN } from '../network/explorer/types'
|
|
25
26
|
|
|
26
27
|
describe('EVM Family', () => {
|
|
@@ -83,9 +84,9 @@ describe('EVM Family', () => {
|
|
|
83
84
|
},
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
expect(
|
|
87
|
-
|
|
88
|
-
])
|
|
87
|
+
expect(
|
|
88
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
89
|
+
).toEqual([expectedOperation])
|
|
89
90
|
})
|
|
90
91
|
|
|
91
92
|
it('should convert an etherscan-like smart contract operation (from their API) to an Operation', () => {
|
|
@@ -144,9 +145,9 @@ describe('EVM Family', () => {
|
|
|
144
145
|
},
|
|
145
146
|
}
|
|
146
147
|
|
|
147
|
-
expect(
|
|
148
|
-
|
|
149
|
-
])
|
|
148
|
+
expect(
|
|
149
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
150
|
+
).toEqual([expectedOperation])
|
|
150
151
|
})
|
|
151
152
|
|
|
152
153
|
it('should convert an etherscan-like coin out operation (from their API) to an Operation', () => {
|
|
@@ -198,9 +199,9 @@ describe('EVM Family', () => {
|
|
|
198
199
|
details: { sequence: '11898499' },
|
|
199
200
|
}
|
|
200
201
|
|
|
201
|
-
expect(
|
|
202
|
-
|
|
203
|
-
])
|
|
202
|
+
expect(
|
|
203
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
204
|
+
).toEqual([expectedOperation])
|
|
204
205
|
})
|
|
205
206
|
|
|
206
207
|
it('should convert an etherscan-like coin in operation (from their API) to an Operation', () => {
|
|
@@ -252,9 +253,9 @@ describe('EVM Family', () => {
|
|
|
252
253
|
details: { sequence: '11898499' },
|
|
253
254
|
}
|
|
254
255
|
|
|
255
|
-
expect(
|
|
256
|
-
|
|
257
|
-
])
|
|
256
|
+
expect(
|
|
257
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
258
|
+
).toEqual([expectedOperation])
|
|
258
259
|
})
|
|
259
260
|
|
|
260
261
|
it('should convert an etherscan-like coin none operation (from their API) to an Operation', () => {
|
|
@@ -306,9 +307,9 @@ describe('EVM Family', () => {
|
|
|
306
307
|
details: { sequence: '11898499' },
|
|
307
308
|
}
|
|
308
309
|
|
|
309
|
-
expect(
|
|
310
|
-
|
|
311
|
-
])
|
|
310
|
+
expect(
|
|
311
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
312
|
+
).toEqual([expectedOperation])
|
|
312
313
|
})
|
|
313
314
|
|
|
314
315
|
it('should convert an etherscan-like self send coin operation (from their API) to 2 Operations', () => {
|
|
@@ -374,9 +375,9 @@ describe('EVM Family', () => {
|
|
|
374
375
|
},
|
|
375
376
|
]
|
|
376
377
|
|
|
377
|
-
expect(
|
|
378
|
-
|
|
379
|
-
)
|
|
378
|
+
expect(
|
|
379
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
380
|
+
).toEqual(expectedOperations)
|
|
380
381
|
})
|
|
381
382
|
|
|
382
383
|
it('should return an operation with the expected amount', () => {
|
|
@@ -409,14 +410,20 @@ describe('EVM Family', () => {
|
|
|
409
410
|
|
|
410
411
|
// Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
|
|
411
412
|
expect(
|
|
412
|
-
etherscanOperationToOperations(address, currencyId, etherscanOpFees)[0]
|
|
413
|
+
etherscanOperationToOperations(address, currencyId, etherscanOpFees, testLogger)[0]
|
|
414
|
+
.value
|
|
413
415
|
).toEqual(BigInt(etherscanOpFees.value))
|
|
414
416
|
// Failing Op (value = tx value, same as success)
|
|
415
417
|
expect(
|
|
416
|
-
etherscanOperationToOperations(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
etherscanOperationToOperations(
|
|
419
|
+
address,
|
|
420
|
+
currencyId,
|
|
421
|
+
{
|
|
422
|
+
...etherscanOpFees,
|
|
423
|
+
isError: '1',
|
|
424
|
+
},
|
|
425
|
+
testLogger
|
|
426
|
+
)[0].value
|
|
420
427
|
).toEqual(BigInt(etherscanOpFees.value))
|
|
421
428
|
|
|
422
429
|
const etherscanOpOut: EtherscanOperation = {
|
|
@@ -444,14 +451,19 @@ describe('EVM Family', () => {
|
|
|
444
451
|
|
|
445
452
|
// Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
|
|
446
453
|
expect(
|
|
447
|
-
etherscanOperationToOperations(address, currencyId, etherscanOpOut)[0].value
|
|
454
|
+
etherscanOperationToOperations(address, currencyId, etherscanOpOut, testLogger)[0].value
|
|
448
455
|
).toEqual(BigInt(etherscanOpOut.value))
|
|
449
456
|
// Failing Op (value = tx value, same as success)
|
|
450
457
|
expect(
|
|
451
|
-
etherscanOperationToOperations(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
458
|
+
etherscanOperationToOperations(
|
|
459
|
+
address,
|
|
460
|
+
currencyId,
|
|
461
|
+
{
|
|
462
|
+
...etherscanOpOut,
|
|
463
|
+
isError: '1',
|
|
464
|
+
},
|
|
465
|
+
testLogger
|
|
466
|
+
)[0].value
|
|
455
467
|
).toEqual(BigInt(etherscanOpOut.value))
|
|
456
468
|
|
|
457
469
|
const etherscanOpIn: EtherscanOperation = {
|
|
@@ -479,14 +491,19 @@ describe('EVM Family', () => {
|
|
|
479
491
|
|
|
480
492
|
// Successful Op
|
|
481
493
|
expect(
|
|
482
|
-
etherscanOperationToOperations(address, currencyId, etherscanOpIn)[0].value
|
|
494
|
+
etherscanOperationToOperations(address, currencyId, etherscanOpIn, testLogger)[0].value
|
|
483
495
|
).toEqual(BigInt(etherscanOpIn.value))
|
|
484
496
|
// Failing Op
|
|
485
497
|
expect(
|
|
486
|
-
etherscanOperationToOperations(
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
498
|
+
etherscanOperationToOperations(
|
|
499
|
+
address,
|
|
500
|
+
currencyId,
|
|
501
|
+
{
|
|
502
|
+
...etherscanOpIn,
|
|
503
|
+
isError: '1',
|
|
504
|
+
},
|
|
505
|
+
testLogger
|
|
506
|
+
)[0].value
|
|
490
507
|
).toEqual(BigInt(etherscanOpIn.value))
|
|
491
508
|
})
|
|
492
509
|
|
|
@@ -523,7 +540,8 @@ describe('EVM Family', () => {
|
|
|
523
540
|
const result = etherscanOperationToOperations(
|
|
524
541
|
address,
|
|
525
542
|
currencyId,
|
|
526
|
-
rawBlockscoutTransaction
|
|
543
|
+
rawBlockscoutTransaction,
|
|
544
|
+
testLogger
|
|
527
545
|
)
|
|
528
546
|
|
|
529
547
|
expect(result).toHaveLength(1)
|
|
@@ -546,7 +564,12 @@ describe('EVM Family', () => {
|
|
|
546
564
|
hash: '0xb7ae1fdaa0d0bcde82cdb12d91898862fbcc5308bc844f508916b434080bb218',
|
|
547
565
|
}
|
|
548
566
|
|
|
549
|
-
const result = etherscanOperationToOperations(
|
|
567
|
+
const result = etherscanOperationToOperations(
|
|
568
|
+
address,
|
|
569
|
+
currencyId,
|
|
570
|
+
failedTransaction,
|
|
571
|
+
testLogger
|
|
572
|
+
)
|
|
550
573
|
|
|
551
574
|
expect(result).toHaveLength(1)
|
|
552
575
|
expect(result[0].tx.fees).toEqual(0n)
|
|
@@ -563,7 +586,12 @@ describe('EVM Family', () => {
|
|
|
563
586
|
value: '',
|
|
564
587
|
}
|
|
565
588
|
|
|
566
|
-
const result = etherscanOperationToOperations(
|
|
589
|
+
const result = etherscanOperationToOperations(
|
|
590
|
+
address,
|
|
591
|
+
currencyId,
|
|
592
|
+
txWithEmptyValue,
|
|
593
|
+
testLogger
|
|
594
|
+
)
|
|
567
595
|
|
|
568
596
|
expect(result).toHaveLength(1)
|
|
569
597
|
expect(result[0].tx.fees).toEqual(0n)
|
|
@@ -596,7 +624,12 @@ describe('EVM Family', () => {
|
|
|
596
624
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
597
625
|
const currencyId = 'ethereum'
|
|
598
626
|
|
|
599
|
-
const result = etherscanOperationToOperations(
|
|
627
|
+
const result = etherscanOperationToOperations(
|
|
628
|
+
address,
|
|
629
|
+
currencyId,
|
|
630
|
+
etherscanOp,
|
|
631
|
+
testLogger
|
|
632
|
+
)
|
|
600
633
|
|
|
601
634
|
expect(result).toHaveLength(1)
|
|
602
635
|
expect(result[0].recipients).toEqual([])
|
|
@@ -628,7 +661,12 @@ describe('EVM Family', () => {
|
|
|
628
661
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
629
662
|
const currencyId = 'ethereum'
|
|
630
663
|
|
|
631
|
-
const result = etherscanOperationToOperations(
|
|
664
|
+
const result = etherscanOperationToOperations(
|
|
665
|
+
address,
|
|
666
|
+
currencyId,
|
|
667
|
+
etherscanOp,
|
|
668
|
+
testLogger
|
|
669
|
+
)
|
|
632
670
|
|
|
633
671
|
expect(result).toHaveLength(1)
|
|
634
672
|
expect(result[0].senders).toEqual([])
|
|
@@ -661,7 +699,12 @@ describe('EVM Family', () => {
|
|
|
661
699
|
}
|
|
662
700
|
|
|
663
701
|
const address = '0x83802741df938c6cd94c46481cadba5b1b0c2f70'
|
|
664
|
-
const result = etherscanOperationToOperations(
|
|
702
|
+
const result = etherscanOperationToOperations(
|
|
703
|
+
address,
|
|
704
|
+
'optimism',
|
|
705
|
+
etherscanOp,
|
|
706
|
+
testLogger
|
|
707
|
+
)
|
|
665
708
|
|
|
666
709
|
expect(result).toHaveLength(1)
|
|
667
710
|
// fees = gasUsed * gasPrice + L1FeesPaid
|
|
@@ -695,7 +738,8 @@ describe('EVM Family', () => {
|
|
|
695
738
|
const result = etherscanOperationToOperations(
|
|
696
739
|
'0x9aa99c23f67c81701c772b106b4f83f6e858dd2e',
|
|
697
740
|
'ethereum',
|
|
698
|
-
etherscanOp
|
|
741
|
+
etherscanOp,
|
|
742
|
+
testLogger
|
|
699
743
|
)
|
|
700
744
|
|
|
701
745
|
expect(result[0].tx.fees).toEqual(57168n * 125521409858n)
|
|
@@ -759,7 +803,9 @@ describe('EVM Family', () => {
|
|
|
759
803
|
},
|
|
760
804
|
}
|
|
761
805
|
|
|
762
|
-
expect(etherscanERC20EventToOperations(address, etherscanOp)).toEqual([
|
|
806
|
+
expect(etherscanERC20EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([
|
|
807
|
+
expectedOperation,
|
|
808
|
+
])
|
|
763
809
|
})
|
|
764
810
|
|
|
765
811
|
it('should convert an etherscan-like usdc in event (from their API) to an Operation', () => {
|
|
@@ -818,7 +864,9 @@ describe('EVM Family', () => {
|
|
|
818
864
|
},
|
|
819
865
|
}
|
|
820
866
|
|
|
821
|
-
expect(etherscanERC20EventToOperations(address, etherscanOp)).toEqual([
|
|
867
|
+
expect(etherscanERC20EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([
|
|
868
|
+
expectedOperation,
|
|
869
|
+
])
|
|
822
870
|
})
|
|
823
871
|
|
|
824
872
|
it('should ignore an etherscan-like usdc none event (from their API) and return empty array', () => {
|
|
@@ -846,7 +894,7 @@ describe('EVM Family', () => {
|
|
|
846
894
|
|
|
847
895
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
848
896
|
|
|
849
|
-
expect(etherscanERC20EventToOperations(address, etherscanOp)).toEqual([])
|
|
897
|
+
expect(etherscanERC20EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([])
|
|
850
898
|
})
|
|
851
899
|
|
|
852
900
|
it('should convert an etherscan-like self usdc event (from their API) into 2 Operations', () => {
|
|
@@ -929,7 +977,9 @@ describe('EVM Family', () => {
|
|
|
929
977
|
},
|
|
930
978
|
]
|
|
931
979
|
|
|
932
|
-
expect(etherscanERC20EventToOperations(address, etherscanOp)).toEqual(
|
|
980
|
+
expect(etherscanERC20EventToOperations(address, etherscanOp, 0, testLogger)).toEqual(
|
|
981
|
+
expectedOperations
|
|
982
|
+
)
|
|
933
983
|
})
|
|
934
984
|
|
|
935
985
|
it('should handle ERC20 event with empty gasPrice (Blockscout Optimism)', () => {
|
|
@@ -957,7 +1007,7 @@ describe('EVM Family', () => {
|
|
|
957
1007
|
confirmations: '29885597',
|
|
958
1008
|
}
|
|
959
1009
|
|
|
960
|
-
const result = etherscanERC20EventToOperations(address, erc20Event)
|
|
1010
|
+
const result = etherscanERC20EventToOperations(address, erc20Event, 0, testLogger)
|
|
961
1011
|
|
|
962
1012
|
expect(result).toHaveLength(1)
|
|
963
1013
|
expect(result[0].tx.fees).toEqual(0n)
|
|
@@ -989,7 +1039,7 @@ describe('EVM Family', () => {
|
|
|
989
1039
|
|
|
990
1040
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
991
1041
|
|
|
992
|
-
const result = etherscanERC20EventToOperations(address, etherscanOp)
|
|
1042
|
+
const result = etherscanERC20EventToOperations(address, etherscanOp, 0, testLogger)
|
|
993
1043
|
|
|
994
1044
|
expect(result).toHaveLength(1)
|
|
995
1045
|
result.forEach((op) => expect(op.recipients).toEqual([]))
|
|
@@ -1053,7 +1103,7 @@ describe('EVM Family', () => {
|
|
|
1053
1103
|
},
|
|
1054
1104
|
}
|
|
1055
1105
|
|
|
1056
|
-
expect(etherscanERC721EventToOperations(address, etherscanOp)).toEqual([
|
|
1106
|
+
expect(etherscanERC721EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([
|
|
1057
1107
|
expectedOperation,
|
|
1058
1108
|
])
|
|
1059
1109
|
})
|
|
@@ -1111,7 +1161,7 @@ describe('EVM Family', () => {
|
|
|
1111
1161
|
},
|
|
1112
1162
|
}
|
|
1113
1163
|
|
|
1114
|
-
expect(etherscanERC721EventToOperations(address, etherscanOp)).toEqual([
|
|
1164
|
+
expect(etherscanERC721EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([
|
|
1115
1165
|
expectedOperation,
|
|
1116
1166
|
])
|
|
1117
1167
|
})
|
|
@@ -1141,7 +1191,7 @@ describe('EVM Family', () => {
|
|
|
1141
1191
|
|
|
1142
1192
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
1143
1193
|
|
|
1144
|
-
expect(etherscanERC721EventToOperations(address, etherscanOp)).toEqual([])
|
|
1194
|
+
expect(etherscanERC721EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([])
|
|
1145
1195
|
})
|
|
1146
1196
|
|
|
1147
1197
|
it('should convert an etherscan-like erc721 nft event (from their API) into 2 Operations', () => {
|
|
@@ -1218,7 +1268,9 @@ describe('EVM Family', () => {
|
|
|
1218
1268
|
},
|
|
1219
1269
|
]
|
|
1220
1270
|
|
|
1221
|
-
expect(etherscanERC721EventToOperations(address, etherscanOp)).toEqual(
|
|
1271
|
+
expect(etherscanERC721EventToOperations(address, etherscanOp, 0, testLogger)).toEqual(
|
|
1272
|
+
expectedOperations
|
|
1273
|
+
)
|
|
1222
1274
|
})
|
|
1223
1275
|
|
|
1224
1276
|
it('should produce empty recipients when to is an empty string', () => {
|
|
@@ -1246,7 +1298,7 @@ describe('EVM Family', () => {
|
|
|
1246
1298
|
|
|
1247
1299
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
1248
1300
|
|
|
1249
|
-
const result = etherscanERC721EventToOperations(address, etherscanOp)
|
|
1301
|
+
const result = etherscanERC721EventToOperations(address, etherscanOp, 0, testLogger)
|
|
1250
1302
|
|
|
1251
1303
|
// from matches account → NFT_OUT is emitted, but recipients must not contain empty string
|
|
1252
1304
|
expect(result).toHaveLength(1)
|
|
@@ -1311,7 +1363,7 @@ describe('EVM Family', () => {
|
|
|
1311
1363
|
},
|
|
1312
1364
|
}
|
|
1313
1365
|
|
|
1314
|
-
expect(etherscanERC1155EventToOperations(address, etherscanOp)).toEqual([
|
|
1366
|
+
expect(etherscanERC1155EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([
|
|
1315
1367
|
expectedOperation,
|
|
1316
1368
|
])
|
|
1317
1369
|
})
|
|
@@ -1369,7 +1421,7 @@ describe('EVM Family', () => {
|
|
|
1369
1421
|
},
|
|
1370
1422
|
}
|
|
1371
1423
|
|
|
1372
|
-
expect(etherscanERC1155EventToOperations(address, etherscanOp)).toEqual([
|
|
1424
|
+
expect(etherscanERC1155EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([
|
|
1373
1425
|
expectedOperation,
|
|
1374
1426
|
])
|
|
1375
1427
|
})
|
|
@@ -1399,7 +1451,7 @@ describe('EVM Family', () => {
|
|
|
1399
1451
|
|
|
1400
1452
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
1401
1453
|
|
|
1402
|
-
expect(etherscanERC1155EventToOperations(address, etherscanOp)).toEqual([])
|
|
1454
|
+
expect(etherscanERC1155EventToOperations(address, etherscanOp, 0, testLogger)).toEqual([])
|
|
1403
1455
|
})
|
|
1404
1456
|
|
|
1405
1457
|
it('should convert an etherscan-like erc1155 nft event (from their API) into 2 Operations', () => {
|
|
@@ -1476,7 +1528,7 @@ describe('EVM Family', () => {
|
|
|
1476
1528
|
},
|
|
1477
1529
|
]
|
|
1478
1530
|
|
|
1479
|
-
expect(etherscanERC1155EventToOperations(address, etherscanOp)).toEqual(
|
|
1531
|
+
expect(etherscanERC1155EventToOperations(address, etherscanOp, 0, testLogger)).toEqual(
|
|
1480
1532
|
expectedOperations
|
|
1481
1533
|
)
|
|
1482
1534
|
})
|
|
@@ -1506,7 +1558,7 @@ describe('EVM Family', () => {
|
|
|
1506
1558
|
|
|
1507
1559
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
1508
1560
|
|
|
1509
|
-
const result = etherscanERC1155EventToOperations(address, etherscanOp)
|
|
1561
|
+
const result = etherscanERC1155EventToOperations(address, etherscanOp, 0, testLogger)
|
|
1510
1562
|
|
|
1511
1563
|
// from matches account → NFT_OUT is emitted, but recipients must not contain empty string
|
|
1512
1564
|
expect(result).toHaveLength(1)
|
|
@@ -1554,9 +1606,9 @@ describe('EVM Family', () => {
|
|
|
1554
1606
|
details: { internal: true },
|
|
1555
1607
|
}
|
|
1556
1608
|
|
|
1557
|
-
expect(
|
|
1558
|
-
|
|
1559
|
-
])
|
|
1609
|
+
expect(
|
|
1610
|
+
etherscanInternalTransactionToOperations(address, etherscanOp, 0, testLogger)
|
|
1611
|
+
).toEqual([expectedOperation])
|
|
1560
1612
|
})
|
|
1561
1613
|
|
|
1562
1614
|
it('should convert a etherscan-like in internal transaction (from their API) to an Operation', () => {
|
|
@@ -1596,9 +1648,9 @@ describe('EVM Family', () => {
|
|
|
1596
1648
|
details: { internal: true },
|
|
1597
1649
|
}
|
|
1598
1650
|
|
|
1599
|
-
expect(
|
|
1600
|
-
|
|
1601
|
-
])
|
|
1651
|
+
expect(
|
|
1652
|
+
etherscanInternalTransactionToOperations(address, etherscanOp, 0, testLogger)
|
|
1653
|
+
).toEqual([expectedOperation])
|
|
1602
1654
|
})
|
|
1603
1655
|
|
|
1604
1656
|
it('should convert a etherscan-like none internal transaction (from their API) to an Operation', () => {
|
|
@@ -1621,7 +1673,9 @@ describe('EVM Family', () => {
|
|
|
1621
1673
|
|
|
1622
1674
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
1623
1675
|
|
|
1624
|
-
expect(
|
|
1676
|
+
expect(
|
|
1677
|
+
etherscanInternalTransactionToOperations(address, etherscanOp, 0, testLogger)
|
|
1678
|
+
).toEqual([])
|
|
1625
1679
|
})
|
|
1626
1680
|
|
|
1627
1681
|
it('should convert a etherscan-like self internal transaction (from their API) to 2 Operations', () => {
|
|
@@ -1675,9 +1729,9 @@ describe('EVM Family', () => {
|
|
|
1675
1729
|
},
|
|
1676
1730
|
]
|
|
1677
1731
|
|
|
1678
|
-
expect(
|
|
1679
|
-
|
|
1680
|
-
)
|
|
1732
|
+
expect(
|
|
1733
|
+
etherscanInternalTransactionToOperations(address, etherscanOp, 0, testLogger)
|
|
1734
|
+
).toEqual(expectedOperations)
|
|
1681
1735
|
})
|
|
1682
1736
|
|
|
1683
1737
|
it('should produce empty recipients when to is an empty string', () => {
|
|
@@ -1700,7 +1754,12 @@ describe('EVM Family', () => {
|
|
|
1700
1754
|
|
|
1701
1755
|
const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
|
|
1702
1756
|
|
|
1703
|
-
const result = etherscanInternalTransactionToOperations(
|
|
1757
|
+
const result = etherscanInternalTransactionToOperations(
|
|
1758
|
+
address,
|
|
1759
|
+
etherscanOp,
|
|
1760
|
+
0,
|
|
1761
|
+
testLogger
|
|
1762
|
+
)
|
|
1704
1763
|
|
|
1705
1764
|
// from matches account → OUT is emitted, but recipients must not contain empty string
|
|
1706
1765
|
expect(result).toHaveLength(1)
|
|
@@ -1741,7 +1800,12 @@ describe('EVM Family', () => {
|
|
|
1741
1800
|
{ type: 'callcode' },
|
|
1742
1801
|
])('returns no operations for non-value-transferring call type %o', (overrides) => {
|
|
1743
1802
|
expect(
|
|
1744
|
-
etherscanInternalTransactionToOperations(
|
|
1803
|
+
etherscanInternalTransactionToOperations(
|
|
1804
|
+
addressForCallType,
|
|
1805
|
+
makeInternalTx(overrides),
|
|
1806
|
+
0,
|
|
1807
|
+
testLogger
|
|
1808
|
+
)
|
|
1745
1809
|
).toEqual([])
|
|
1746
1810
|
})
|
|
1747
1811
|
|
|
@@ -1749,7 +1813,9 @@ describe('EVM Family', () => {
|
|
|
1749
1813
|
expect(
|
|
1750
1814
|
etherscanInternalTransactionToOperations(
|
|
1751
1815
|
addressForCallType,
|
|
1752
|
-
makeInternalTx({ callType: 'DelegateCall' })
|
|
1816
|
+
makeInternalTx({ callType: 'DelegateCall' }),
|
|
1817
|
+
0,
|
|
1818
|
+
testLogger
|
|
1753
1819
|
)
|
|
1754
1820
|
).toEqual([])
|
|
1755
1821
|
})
|
|
@@ -1813,9 +1879,9 @@ describe('EVM Family', () => {
|
|
|
1813
1879
|
},
|
|
1814
1880
|
}
|
|
1815
1881
|
|
|
1816
|
-
expect(
|
|
1817
|
-
|
|
1818
|
-
])
|
|
1882
|
+
expect(
|
|
1883
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
1884
|
+
).toEqual([expectedOperation])
|
|
1819
1885
|
})
|
|
1820
1886
|
|
|
1821
1887
|
it('should convert an etherscan-like staking smart contract redelegate operation (from their API) to an Operation', () => {
|
|
@@ -1870,9 +1936,9 @@ describe('EVM Family', () => {
|
|
|
1870
1936
|
},
|
|
1871
1937
|
}
|
|
1872
1938
|
|
|
1873
|
-
expect(
|
|
1874
|
-
|
|
1875
|
-
])
|
|
1939
|
+
expect(
|
|
1940
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
1941
|
+
).toEqual([expectedOperation])
|
|
1876
1942
|
})
|
|
1877
1943
|
|
|
1878
1944
|
it('should convert an etherscan-like staking smart contract undelegate operation (from their API) to an Operation', () => {
|
|
@@ -1925,9 +1991,9 @@ describe('EVM Family', () => {
|
|
|
1925
1991
|
},
|
|
1926
1992
|
}
|
|
1927
1993
|
|
|
1928
|
-
expect(
|
|
1929
|
-
|
|
1930
|
-
])
|
|
1994
|
+
expect(
|
|
1995
|
+
etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
|
|
1996
|
+
).toEqual([expectedOperation])
|
|
1931
1997
|
})
|
|
1932
1998
|
})
|
|
1933
1999
|
|
|
@@ -1997,7 +2063,7 @@ describe('EVM Family', () => {
|
|
|
1997
2063
|
|
|
1998
2064
|
it('groups internal txs by hash and converts to native transfer operations', () => {
|
|
1999
2065
|
const internalTxs = [{ ...baseInternalTx, hash: '0xtx1', value: '1000000000000000000' }]
|
|
2000
|
-
const byHash = internalTxsToOperationsByHash(internalTxs)
|
|
2066
|
+
const byHash = internalTxsToOperationsByHash(internalTxs, testLogger)
|
|
2001
2067
|
expect(byHash.size).toBe(1)
|
|
2002
2068
|
const ops = byHash.get('0xtx1')!
|
|
2003
2069
|
expect(ops).toHaveLength(2) // sender + receiver
|
|
@@ -2010,18 +2076,18 @@ describe('EVM Family', () => {
|
|
|
2010
2076
|
|
|
2011
2077
|
it("skips internal txs with isError === '1'", () => {
|
|
2012
2078
|
const internalTxs = [{ ...baseInternalTx, hash: '0xtx1', isError: '1', value: '1000' }]
|
|
2013
|
-
const byHash = internalTxsToOperationsByHash(internalTxs)
|
|
2079
|
+
const byHash = internalTxsToOperationsByHash(internalTxs, testLogger)
|
|
2014
2080
|
expect(byHash.size).toBe(0)
|
|
2015
2081
|
})
|
|
2016
2082
|
|
|
2017
2083
|
it("skips internal txs with value === '0'", () => {
|
|
2018
2084
|
const internalTxs = [{ ...baseInternalTx, hash: '0xtx1', value: '0' }]
|
|
2019
|
-
const byHash = internalTxsToOperationsByHash(internalTxs)
|
|
2085
|
+
const byHash = internalTxsToOperationsByHash(internalTxs, testLogger)
|
|
2020
2086
|
expect(byHash.size).toBe(0)
|
|
2021
2087
|
})
|
|
2022
2088
|
|
|
2023
2089
|
it('returns empty map for empty internal txs array', () => {
|
|
2024
|
-
const byHash = internalTxsToOperationsByHash([])
|
|
2090
|
+
const byHash = internalTxsToOperationsByHash([], testLogger)
|
|
2025
2091
|
expect(byHash.size).toBe(0)
|
|
2026
2092
|
})
|
|
2027
2093
|
|
|
@@ -2030,7 +2096,7 @@ describe('EVM Family', () => {
|
|
|
2030
2096
|
{ ...baseInternalTx, hash: '0xtx1', value: '1000', from: '0xa', to: '0xb' },
|
|
2031
2097
|
{ ...baseInternalTx, hash: '0xtx1', value: '2000', from: '0xc', to: '0xd' },
|
|
2032
2098
|
]
|
|
2033
|
-
const byHash = internalTxsToOperationsByHash(internalTxs)
|
|
2099
|
+
const byHash = internalTxsToOperationsByHash(internalTxs, testLogger)
|
|
2034
2100
|
expect(byHash.size).toBe(1)
|
|
2035
2101
|
expect(byHash.get('0xtx1')!.length).toBe(4) // 2 internal txs × 2 ops each
|
|
2036
2102
|
})
|
|
@@ -2039,7 +2105,7 @@ describe('EVM Family', () => {
|
|
|
2039
2105
|
'skips internal txs whose Blockscout callType is %s (no native value moves)',
|
|
2040
2106
|
(callType) => {
|
|
2041
2107
|
const internalTxs = [{ ...baseInternalTx, hash: '0xtx1', callType }]
|
|
2042
|
-
const byHash = internalTxsToOperationsByHash(internalTxs)
|
|
2108
|
+
const byHash = internalTxsToOperationsByHash(internalTxs, testLogger)
|
|
2043
2109
|
expect(byHash.size).toBe(0)
|
|
2044
2110
|
}
|
|
2045
2111
|
)
|
|
@@ -2048,7 +2114,7 @@ describe('EVM Family', () => {
|
|
|
2048
2114
|
'skips internal txs whose Etherscan type is %s (no native value moves)',
|
|
2049
2115
|
(type) => {
|
|
2050
2116
|
const internalTxs = [{ ...baseInternalTx, hash: '0xtx1', type }]
|
|
2051
|
-
const byHash = internalTxsToOperationsByHash(internalTxs)
|
|
2117
|
+
const byHash = internalTxsToOperationsByHash(internalTxs, testLogger)
|
|
2052
2118
|
expect(byHash.size).toBe(0)
|
|
2053
2119
|
}
|
|
2054
2120
|
)
|