@ledgerhq/coin-evm 5.3.1 → 5.3.3
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 +3 -13
- package/CHANGELOG.md +13 -0
- package/lib/adapters/blockOperations.d.ts +2 -2
- package/lib/adapters/blockOperations.d.ts.map +1 -1
- package/lib/adapters/blockOperations.js.map +1 -1
- package/lib/api/index.d.ts +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/config.d.ts +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/logic/combine.d.ts +2 -1
- package/lib/logic/combine.d.ts.map +1 -1
- package/lib/logic/combine.js.map +1 -1
- package/lib/logic/common.d.ts +2 -1
- package/lib/logic/common.d.ts.map +1 -1
- package/lib/logic/common.js.map +1 -1
- package/lib/logic/craftTransaction.d.ts +1 -1
- package/lib/logic/craftTransaction.d.ts.map +1 -1
- package/lib/logic/craftTransaction.js.map +1 -1
- package/lib/logic/craftTransactionData.d.ts +1 -1
- package/lib/logic/craftTransactionData.d.ts.map +1 -1
- package/lib/logic/estimateFees.d.ts +1 -1
- package/lib/logic/estimateFees.d.ts.map +1 -1
- package/lib/logic/estimateFees.js.map +1 -1
- package/lib/logic/getBalance.d.ts +1 -1
- package/lib/logic/getBalance.d.ts.map +1 -1
- package/lib/logic/getBalance.js.map +1 -1
- package/lib/logic/getBlock.d.ts +1 -1
- package/lib/logic/getBlock.d.ts.map +1 -1
- package/lib/logic/getBlock.js.map +1 -1
- package/lib/logic/getStakes.d.ts +1 -1
- package/lib/logic/getStakes.d.ts.map +1 -1
- package/lib/logic/internalTransactionsFetcher.d.ts +1 -1
- package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib/logic/validateIntent.d.ts +1 -1
- package/lib/logic/validateIntent.d.ts.map +1 -1
- package/lib/logic/validateIntent.js.map +1 -1
- package/lib/logic.d.ts +1 -1
- package/lib/logic.d.ts.map +1 -1
- package/lib/network/explorer/etherscan.d.ts +4 -4
- package/lib/network/explorer/etherscan.d.ts.map +1 -1
- package/lib/network/explorer/etherscan.js.map +1 -1
- package/lib/network/explorer/index.d.ts +2 -2
- package/lib/network/explorer/index.d.ts.map +1 -1
- package/lib/network/explorer/index.js.map +1 -1
- package/lib/network/explorer/ledger.d.ts +2 -2
- package/lib/network/explorer/ledger.d.ts.map +1 -1
- package/lib/network/explorer/ledger.js.map +1 -1
- package/lib/network/explorer/none.d.ts +1 -1
- package/lib/network/explorer/none.d.ts.map +1 -1
- package/lib/network/explorer/none.js.map +1 -1
- package/lib/network/explorer/types.d.ts +1 -1
- package/lib/network/explorer/types.d.ts.map +1 -1
- package/lib/network/gasTracker/index.d.ts +2 -2
- package/lib/network/gasTracker/index.d.ts.map +1 -1
- package/lib/network/gasTracker/index.js.map +1 -1
- package/lib/network/gasTracker/ledger.d.ts +3 -3
- package/lib/network/gasTracker/ledger.d.ts.map +1 -1
- package/lib/network/gasTracker/ledger.js.map +1 -1
- package/lib/network/gasTracker/types.d.ts +2 -2
- package/lib/network/gasTracker/types.d.ts.map +1 -1
- package/lib/network/node/ledger.d.ts +2 -2
- package/lib/network/node/ledger.d.ts.map +1 -1
- package/lib/network/node/ledger.js.map +1 -1
- package/lib/network/node/rpc.common.d.ts +1 -1
- package/lib/network/node/rpc.common.d.ts.map +1 -1
- package/lib/network/node/rpc.common.js.map +1 -1
- package/lib/network/node/types.d.ts +3 -3
- package/lib/network/node/types.d.ts.map +1 -1
- package/lib/staking/validators/monad.d.ts +2 -1
- package/lib/staking/validators/monad.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/staking/validators/somnia.d.ts.map +1 -1
- package/lib/staking/validators/somnia.js.map +1 -1
- package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
- package/lib/staking/validators/zero_gravity.js.map +1 -1
- package/lib/types/assets.d.ts +1 -1
- package/lib/types/assets.d.ts.map +1 -1
- package/lib/types/transaction.d.ts +1 -1
- package/lib/types/transaction.d.ts.map +1 -1
- package/lib-es/adapters/blockOperations.d.ts +2 -2
- package/lib-es/adapters/blockOperations.d.ts.map +1 -1
- package/lib-es/adapters/blockOperations.js.map +1 -1
- package/lib-es/api/index.d.ts +1 -1
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/config.d.ts +1 -1
- package/lib-es/config.d.ts.map +1 -1
- package/lib-es/logic/combine.d.ts +2 -1
- package/lib-es/logic/combine.d.ts.map +1 -1
- package/lib-es/logic/combine.js.map +1 -1
- package/lib-es/logic/common.d.ts +2 -1
- package/lib-es/logic/common.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/craftTransaction.d.ts +1 -1
- package/lib-es/logic/craftTransaction.d.ts.map +1 -1
- package/lib-es/logic/craftTransaction.js.map +1 -1
- package/lib-es/logic/craftTransactionData.d.ts +1 -1
- package/lib-es/logic/craftTransactionData.d.ts.map +1 -1
- package/lib-es/logic/estimateFees.d.ts +1 -1
- package/lib-es/logic/estimateFees.d.ts.map +1 -1
- package/lib-es/logic/estimateFees.js.map +1 -1
- package/lib-es/logic/getBalance.d.ts +1 -1
- package/lib-es/logic/getBalance.d.ts.map +1 -1
- package/lib-es/logic/getBalance.js.map +1 -1
- package/lib-es/logic/getBlock.d.ts +1 -1
- package/lib-es/logic/getBlock.d.ts.map +1 -1
- package/lib-es/logic/getBlock.js.map +1 -1
- package/lib-es/logic/getStakes.d.ts +1 -1
- package/lib-es/logic/getStakes.d.ts.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.d.ts +1 -1
- package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib-es/logic/validateIntent.d.ts +1 -1
- package/lib-es/logic/validateIntent.d.ts.map +1 -1
- package/lib-es/logic/validateIntent.js.map +1 -1
- package/lib-es/logic.d.ts +1 -1
- package/lib-es/logic.d.ts.map +1 -1
- package/lib-es/network/explorer/etherscan.d.ts +4 -4
- package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
- package/lib-es/network/explorer/etherscan.js.map +1 -1
- package/lib-es/network/explorer/index.d.ts +2 -2
- package/lib-es/network/explorer/index.d.ts.map +1 -1
- package/lib-es/network/explorer/index.js.map +1 -1
- package/lib-es/network/explorer/ledger.d.ts +2 -2
- package/lib-es/network/explorer/ledger.d.ts.map +1 -1
- package/lib-es/network/explorer/ledger.js.map +1 -1
- package/lib-es/network/explorer/none.d.ts +1 -1
- package/lib-es/network/explorer/none.d.ts.map +1 -1
- package/lib-es/network/explorer/none.js.map +1 -1
- package/lib-es/network/explorer/types.d.ts +1 -1
- package/lib-es/network/explorer/types.d.ts.map +1 -1
- package/lib-es/network/gasTracker/index.d.ts +2 -2
- package/lib-es/network/gasTracker/index.d.ts.map +1 -1
- package/lib-es/network/gasTracker/index.js.map +1 -1
- package/lib-es/network/gasTracker/ledger.d.ts +3 -3
- package/lib-es/network/gasTracker/ledger.d.ts.map +1 -1
- package/lib-es/network/gasTracker/ledger.js +1 -1
- package/lib-es/network/gasTracker/ledger.js.map +1 -1
- package/lib-es/network/gasTracker/types.d.ts +2 -2
- package/lib-es/network/gasTracker/types.d.ts.map +1 -1
- package/lib-es/network/node/ledger.d.ts +2 -2
- package/lib-es/network/node/ledger.d.ts.map +1 -1
- package/lib-es/network/node/ledger.js.map +1 -1
- package/lib-es/network/node/rpc.common.d.ts +1 -1
- package/lib-es/network/node/rpc.common.d.ts.map +1 -1
- package/lib-es/network/node/rpc.common.js +1 -1
- package/lib-es/network/node/rpc.common.js.map +1 -1
- package/lib-es/network/node/types.d.ts +3 -3
- package/lib-es/network/node/types.d.ts.map +1 -1
- package/lib-es/staking/validators/monad.d.ts +2 -1
- package/lib-es/staking/validators/monad.d.ts.map +1 -1
- 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.map +1 -1
- package/lib-es/staking/validators/somnia.d.ts.map +1 -1
- package/lib-es/staking/validators/somnia.js.map +1 -1
- package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
- package/lib-es/staking/validators/zero_gravity.js.map +1 -1
- package/lib-es/types/assets.d.ts +1 -1
- package/lib-es/types/assets.d.ts.map +1 -1
- package/lib-es/types/transaction.d.ts +1 -1
- package/lib-es/types/transaction.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapters/blockOperations.test.ts +29 -31
- package/src/adapters/blockOperations.ts +3 -2
- package/src/adapters/etherscan.test.ts +7 -7
- package/src/adapters/ledger.test.ts +2 -2
- package/src/api/getBlock.integ.test.ts +1 -1
- package/src/api/index.fantom.integ.test.ts +1 -1
- package/src/api/index.flare.integ.test.ts +2 -14
- package/src/api/index.integ.test.ts +330 -246
- package/src/api/index.linea.integ.test.ts +1 -1
- package/src/api/index.optimism.integ.test.ts +1 -1
- package/src/api/index.shape.integ.test.ts +1 -1
- package/src/api/index.ts +1 -1
- package/src/config.ts +1 -1
- package/src/fixtures/context.fixtures.ts +79 -1
- package/src/fixtures/ethers.fixtures.ts +26 -0
- package/src/fixtures/ledger.fixtures.ts +1 -1
- package/src/internalTxSources.test.ts +3 -6
- package/src/logic/broadcast.integ.test.ts +6 -18
- package/src/logic/broadcast.test.ts +19 -31
- package/src/logic/broadcastSource.test.ts +6 -7
- package/src/logic/combine.test.ts +2 -2
- package/src/logic/combine.ts +2 -1
- package/src/logic/common.test.ts +120 -112
- package/src/logic/common.ts +2 -7
- package/src/logic/craftTransaction.test.ts +163 -200
- package/src/logic/craftTransaction.ts +3 -2
- package/src/logic/craftTransactionData.test.ts +6 -6
- package/src/logic/craftTransactionData.ts +1 -1
- package/src/logic/estimateFees.test.ts +19 -15
- package/src/logic/estimateFees.ts +6 -3
- package/src/logic/getBalance.test.ts +16 -15
- package/src/logic/getBalance.ts +4 -3
- package/src/logic/getBlock.test.ts +379 -388
- package/src/logic/getBlock.ts +3 -2
- package/src/logic/getBlockInfo.test.ts +7 -9
- package/src/logic/getNextSequence.test.ts +5 -5
- package/src/logic/getStakes.test.ts +35 -35
- package/src/logic/getStakes.ts +1 -1
- package/src/logic/internalTransactionsFetcher.test.ts +26 -24
- package/src/logic/internalTransactionsFetcher.ts +1 -1
- package/src/logic/lastBlock.test.ts +29 -20
- package/src/logic/listOperations.test.ts +44 -40
- package/src/logic/validateIntent.test.ts +152 -101
- package/src/logic/validateIntent.ts +4 -2
- package/src/logic.test.ts +13 -18
- package/src/logic.ts +1 -1
- package/src/network/explorer/etherscan.test.ts +6 -6
- package/src/network/explorer/etherscan.ts +12 -10
- package/src/network/explorer/index.test.ts +52 -22
- package/src/network/explorer/index.ts +2 -2
- package/src/network/explorer/ledger.test.ts +17 -5
- package/src/network/explorer/ledger.ts +3 -2
- package/src/network/explorer/none.ts +2 -1
- package/src/network/explorer/types.ts +1 -1
- package/src/network/gasTracker/index.test.ts +14 -8
- package/src/network/gasTracker/index.ts +2 -2
- package/src/network/gasTracker/ledger.test.ts +34 -29
- package/src/network/gasTracker/ledger.ts +5 -7
- package/src/network/gasTracker/types.ts +2 -2
- package/src/network/node/index.memoization.test.ts +25 -31
- package/src/network/node/index.test.ts +14 -25
- package/src/network/node/ledger.test.ts +45 -60
- package/src/network/node/ledger.ts +6 -5
- package/src/network/node/node.fixtures.ts +0 -2
- package/src/network/node/rpc.common.ts +14 -14
- package/src/network/node/rpc.test.ts +153 -184
- package/src/network/node/types.ts +3 -3
- package/src/staking/detectOperationType.test.ts +1 -1
- package/src/staking/encoder.test.ts +14 -22
- package/src/staking/logic.test.ts +20 -14
- package/src/staking/operations/index.test.ts +29 -29
- package/src/staking/prepareIntents.test.ts +26 -20
- package/src/staking/redelegations.test.ts +50 -33
- package/src/staking/rewards.test.ts +29 -17
- package/src/staking/rewardsFromReceipt.test.ts +20 -21
- package/src/staking/transactionData.test.ts +23 -23
- package/src/staking/validators/monad.test.ts +65 -24
- package/src/staking/validators/monad.ts +2 -1
- package/src/staking/validators/monadResolver.ts +2 -1
- package/src/staking/validators/somnia.test.ts +21 -13
- package/src/staking/validators/somnia.ts +2 -1
- package/src/staking/validators/zero_gravity.test.ts +118 -48
- package/src/staking/validators/zero_gravity.ts +2 -1
- package/src/staking/validators.integ.test.ts +13 -25
- package/src/staking/validators.test.ts +7 -2
- package/src/types/assets.ts +1 -1
- package/src/types/transaction.ts +1 -1
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { AssertionError, fail } from 'assert'
|
|
5
4
|
import { delay } from '@ledgerhq/coin-module-framework/promises'
|
|
6
5
|
import BigNumber from 'bignumber.js'
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
JsonRpcProvider,
|
|
10
|
-
Network,
|
|
11
|
-
Transaction,
|
|
12
|
-
TransactionReceipt,
|
|
13
|
-
TransactionResponse,
|
|
14
|
-
ethers,
|
|
15
|
-
} from 'ethers'
|
|
16
|
-
import { EvmConfigInfo, getCoinConfig } from '../../config'
|
|
6
|
+
import { FeeData, FetchRequest, JsonRpcProvider, Network, Transaction } from 'ethers'
|
|
7
|
+
import { getCoinConfig } from '../../config'
|
|
17
8
|
import { GasEstimationError, InsufficientFunds, UnsupportedRpcMethodError } from '../../errors'
|
|
9
|
+
import { createMockEvmConfigInfo, mkExternalNode } from '../../fixtures/context.fixtures'
|
|
10
|
+
import {
|
|
11
|
+
mkBlock,
|
|
12
|
+
mkTransactionReceipt,
|
|
13
|
+
mkTransactionResponse,
|
|
14
|
+
} from '../../fixtures/ethers.fixtures'
|
|
18
15
|
import {
|
|
19
16
|
createNodeApi,
|
|
20
17
|
DEFAULT_RETRIES_RPC_METHODS,
|
|
@@ -28,11 +25,11 @@ import {
|
|
|
28
25
|
|
|
29
26
|
const currencyId = 'my_new_chain'
|
|
30
27
|
|
|
31
|
-
const evmConfig = {
|
|
28
|
+
const evmConfig = createMockEvmConfigInfo({
|
|
32
29
|
chainId: 1,
|
|
33
30
|
name: 'My New Chain',
|
|
34
|
-
node: {
|
|
35
|
-
}
|
|
31
|
+
node: mkExternalNode({ uri: 'http://test' }),
|
|
32
|
+
})
|
|
36
33
|
|
|
37
34
|
const nodeApi = createNodeApi(evmConfig, {
|
|
38
35
|
type: 'external',
|
|
@@ -50,7 +47,7 @@ const now = Math.floor(Date.now() / 1000)
|
|
|
50
47
|
const address = '0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d'
|
|
51
48
|
|
|
52
49
|
jest.mock('@ledgerhq/coin-module-framework/promises')
|
|
53
|
-
|
|
50
|
+
jest.mocked(delay).mockImplementation(
|
|
54
51
|
() => new Promise((resolve) => setTimeout(resolve, 1)) // mocking the delay supposed to happen after each try
|
|
55
52
|
)
|
|
56
53
|
|
|
@@ -61,9 +58,7 @@ describe('EVM Family', () => {
|
|
|
61
58
|
|
|
62
59
|
beforeEach(() => {
|
|
63
60
|
jest.resetAllMocks()
|
|
64
|
-
jest
|
|
65
|
-
.spyOn(JsonRpcProvider.prototype as any, '_detectNetwork')
|
|
66
|
-
.mockResolvedValue(Network.from(1))
|
|
61
|
+
jest.spyOn(JsonRpcProvider.prototype, '_detectNetwork').mockResolvedValue(Network.from(1))
|
|
67
62
|
|
|
68
63
|
mockGetConfig.mockImplementation((): any => {
|
|
69
64
|
return {
|
|
@@ -76,66 +71,66 @@ describe('EVM Family', () => {
|
|
|
76
71
|
}
|
|
77
72
|
})
|
|
78
73
|
|
|
79
|
-
jest
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
maxPriorityFeePerGas: 0n,
|
|
83
|
-
} as ethers.FeeData)
|
|
74
|
+
jest
|
|
75
|
+
.spyOn(JsonRpcProvider.prototype, 'getFeeData')
|
|
76
|
+
.mockResolvedValue(new FeeData(BigInt(666), 0n, 0n))
|
|
84
77
|
|
|
85
78
|
jest.spyOn(JsonRpcProvider.prototype, 'getBalance').mockResolvedValue(BigInt(420))
|
|
86
79
|
jest
|
|
87
80
|
.spyOn(JsonRpcProvider.prototype, 'call')
|
|
88
81
|
.mockResolvedValue('0x000000000000000000000000000000000000000000000000000000000000A455')
|
|
89
|
-
jest.spyOn(JsonRpcProvider.prototype, 'getBlock').mockResolvedValue(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
82
|
+
jest.spyOn(JsonRpcProvider.prototype, 'getBlock').mockResolvedValue(
|
|
83
|
+
mkBlock({
|
|
84
|
+
hash: '0x474dee0136108e9412e9d84197b468bb057a8dad0f2024fc55adebc4a28fa8c5',
|
|
85
|
+
parentHash: '0xfc900c22725f9c0843c9cf7d2c47f4b61b246bd21e18e99f709aebaefc8aff14',
|
|
86
|
+
number: 1,
|
|
87
|
+
difficulty: 0n,
|
|
88
|
+
gasLimit: BigInt(1),
|
|
89
|
+
gasUsed: BigInt(2),
|
|
90
|
+
extraData: '0x',
|
|
91
|
+
baseFeePerGas: BigInt(123),
|
|
92
|
+
timestamp: now,
|
|
93
|
+
})
|
|
94
|
+
)
|
|
100
95
|
|
|
101
96
|
jest.spyOn(JsonRpcProvider.prototype, 'getTransactionCount').mockResolvedValue(5)
|
|
102
97
|
|
|
103
|
-
jest.spyOn(JsonRpcProvider.prototype, 'getTransaction').mockResolvedValue(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
98
|
+
jest.spyOn(JsonRpcProvider.prototype, 'getTransaction').mockResolvedValue(
|
|
99
|
+
mkTransactionResponse({
|
|
100
|
+
hash: '0x435b00d28a10febbcfefbdea080134d08ef843df122d5bc9174b09de7fce6a59',
|
|
101
|
+
blockNumber: 69,
|
|
102
|
+
blockHash: '0x474dee0136108e9412e9d84197b468bb057a8dad0f2024fc55adebc4a28fa8c5',
|
|
103
|
+
nonce: 123,
|
|
104
|
+
value: BigInt(456),
|
|
105
|
+
gasLimit: BigInt(123),
|
|
106
|
+
gasPrice: BigInt(789),
|
|
107
|
+
data: '0x',
|
|
108
|
+
to: '0xC2907EFccE4011C491BbedA8A0fA63BA7aab596C',
|
|
109
|
+
from: '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d',
|
|
110
|
+
type: 0,
|
|
111
|
+
confirmations: jest.fn().mockResolvedValue(1),
|
|
112
|
+
})
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
jest.spyOn(JsonRpcProvider.prototype, 'getTransactionReceipt').mockResolvedValue(
|
|
116
|
+
mkTransactionReceipt({
|
|
117
|
+
blockHash: '0x8a179bc6cb299f936c4fd614995e62d597ec6108b579c23034fb220967ceaa94',
|
|
118
|
+
blockNumber: 69,
|
|
119
|
+
confirmations: jest.fn().mockResolvedValue(100),
|
|
120
|
+
contractAddress: null,
|
|
121
|
+
cumulativeGasUsed: BigInt(121),
|
|
122
|
+
from: '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d',
|
|
123
|
+
gasUsed: BigInt(122),
|
|
124
|
+
gasPrice: BigInt(789),
|
|
125
|
+
logs: [],
|
|
126
|
+
logsBloom: '0x',
|
|
127
|
+
status: 1,
|
|
128
|
+
to: '0xC2907EFccE4011C491BbedA8A0fA63BA7aab596C',
|
|
129
|
+
hash: '0x435b00d28a10febbcfefbdea080134d08ef843df122d5bc9174b09de7fce6a59',
|
|
130
|
+
index: 123,
|
|
131
|
+
type: 0,
|
|
132
|
+
})
|
|
133
|
+
)
|
|
139
134
|
|
|
140
135
|
jest
|
|
141
136
|
.spyOn(JsonRpcProvider.prototype, 'broadcastTransaction')
|
|
@@ -198,15 +193,7 @@ describe('EVM Family', () => {
|
|
|
198
193
|
retries: DEFAULT_RETRIES_RPC_METHODS,
|
|
199
194
|
}
|
|
200
195
|
|
|
201
|
-
|
|
202
|
-
await withApi(evmConfig, currencyId, spy, nodeConfig)
|
|
203
|
-
fail('Promise should have been rejected')
|
|
204
|
-
} catch (e) {
|
|
205
|
-
if (e instanceof AssertionError) {
|
|
206
|
-
throw e
|
|
207
|
-
}
|
|
208
|
-
expect(e).toBeInstanceOf(SpyError)
|
|
209
|
-
}
|
|
196
|
+
await expect(withApi(evmConfig, currencyId, spy, nodeConfig)).rejects.toThrow(SpyError)
|
|
210
197
|
})
|
|
211
198
|
|
|
212
199
|
it('provider cache should reuse the same JsonRpcProvider for the same currency id and same uri', async () => {
|
|
@@ -701,14 +688,12 @@ describe('EVM Family', () => {
|
|
|
701
688
|
|
|
702
689
|
describe('getGasEstimation', () => {
|
|
703
690
|
it('should return the expected payload', async () => {
|
|
704
|
-
jest
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
return null
|
|
711
|
-
})
|
|
691
|
+
jest.spyOn(JsonRpcProvider.prototype, '_perform').mockImplementation(async (req: any) => {
|
|
692
|
+
if (req.method === 'estimateGas') {
|
|
693
|
+
return 5n
|
|
694
|
+
}
|
|
695
|
+
return null
|
|
696
|
+
})
|
|
712
697
|
expect(
|
|
713
698
|
await nodeApi.getGasEstimation(currencyId, address, {
|
|
714
699
|
recipient: '0x0000000000000000000000000000000000000000',
|
|
@@ -719,14 +704,12 @@ describe('EVM Family', () => {
|
|
|
719
704
|
})
|
|
720
705
|
|
|
721
706
|
it('should throw a GasEstimationError in case of error', async () => {
|
|
722
|
-
jest
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
return null
|
|
729
|
-
})
|
|
707
|
+
jest.spyOn(JsonRpcProvider.prototype, '_perform').mockImplementation(async (req: any) => {
|
|
708
|
+
if (req.method === 'estimateGas') {
|
|
709
|
+
throw new Error('fail')
|
|
710
|
+
}
|
|
711
|
+
return null
|
|
712
|
+
})
|
|
730
713
|
|
|
731
714
|
await expect(
|
|
732
715
|
nodeApi.getGasEstimation(currencyId, address, {
|
|
@@ -963,7 +946,7 @@ describe('EVM Family', () => {
|
|
|
963
946
|
},
|
|
964
947
|
}))
|
|
965
948
|
const sendSpy = jest
|
|
966
|
-
.spyOn(JsonRpcProvider.prototype
|
|
949
|
+
.spyOn(JsonRpcProvider.prototype, 'send')
|
|
967
950
|
.mockImplementation(async (method) => {
|
|
968
951
|
if (method === 'eth_getBlockByNumber') {
|
|
969
952
|
return {
|
|
@@ -1073,28 +1056,24 @@ describe('EVM Family', () => {
|
|
|
1073
1056
|
},
|
|
1074
1057
|
}))
|
|
1075
1058
|
|
|
1076
|
-
jest
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
gasUsed: 2n,
|
|
1087
|
-
extraData: '0x',
|
|
1088
|
-
}
|
|
1059
|
+
jest.spyOn(JsonRpcProvider.prototype, 'send').mockImplementationOnce(async (method) => {
|
|
1060
|
+
if (method === 'eth_getBlockByNumber') {
|
|
1061
|
+
return {
|
|
1062
|
+
parentHash: '0x0',
|
|
1063
|
+
number: 1,
|
|
1064
|
+
timestamp: 123,
|
|
1065
|
+
difficulty: 0n,
|
|
1066
|
+
gasLimit: 1n,
|
|
1067
|
+
gasUsed: 2n,
|
|
1068
|
+
extraData: '0x',
|
|
1089
1069
|
}
|
|
1090
|
-
}
|
|
1070
|
+
}
|
|
1071
|
+
})
|
|
1091
1072
|
// node reports 1 Gwei via the getFeeData mock at the top of the suite (666 wei), but
|
|
1092
1073
|
// we override here to assert the floor wins
|
|
1093
|
-
jest.spyOn(JsonRpcProvider.prototype, 'getFeeData').mockResolvedValueOnce(
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
maxPriorityFeePerGas: 0n,
|
|
1097
|
-
} as ethers.FeeData)
|
|
1074
|
+
jest.spyOn(JsonRpcProvider.prototype, 'getFeeData').mockResolvedValueOnce(
|
|
1075
|
+
new FeeData(BigInt('1000000000'), 0n, 0n) // 1 Gwei
|
|
1076
|
+
)
|
|
1098
1077
|
|
|
1099
1078
|
const result = await nodeApi.getFeeData(getCoinConfig(currencyId).info, currencyId, legacyTx)
|
|
1100
1079
|
|
|
@@ -1141,24 +1120,22 @@ describe('EVM Family', () => {
|
|
|
1141
1120
|
}
|
|
1142
1121
|
|
|
1143
1122
|
it('should return the expected payload for a legacy tx', async () => {
|
|
1144
|
-
jest
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
}
|
|
1161
|
-
})
|
|
1123
|
+
jest.spyOn(JsonRpcProvider.prototype, 'send').mockImplementationOnce(async (method) => {
|
|
1124
|
+
switch (method) {
|
|
1125
|
+
case 'eth_getBlockByNumber':
|
|
1126
|
+
return {
|
|
1127
|
+
parentHash: '0x474dee0136108e9412e9d84197b468bb057a8dad0f2024fc55adebc4a28fa8c5',
|
|
1128
|
+
number: 1,
|
|
1129
|
+
timestamp: 123,
|
|
1130
|
+
difficulty: 0n,
|
|
1131
|
+
gasLimit: 1n,
|
|
1132
|
+
gasUsed: 2n,
|
|
1133
|
+
extraData: '0x',
|
|
1134
|
+
}
|
|
1135
|
+
default:
|
|
1136
|
+
throw new Error(`Method not mocked: ${method}`)
|
|
1137
|
+
}
|
|
1138
|
+
})
|
|
1162
1139
|
|
|
1163
1140
|
expect(
|
|
1164
1141
|
await nodeApi.getFeeData(getCoinConfig('optimism').info, 'optimism', legacyTx)
|
|
@@ -1184,30 +1161,18 @@ describe('EVM Family', () => {
|
|
|
1184
1161
|
const serializedTransaction =
|
|
1185
1162
|
'0x02f873012d85010c388d0085077715912682520894c2907efcce4011c491bbeda8a0fa63ba7aab596c87038d7ea4c6800080c001a0bbffe7ba303ab03f697d64672c4a288ae863df8a62ffc67ba72872ce8c227f6fa01261e7c9f06af13631f03fad9b88d3c48931d353b6b41b4072fddcca5ec41628'
|
|
1186
1163
|
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
} catch (e) {
|
|
1191
|
-
if (e instanceof AssertionError) {
|
|
1192
|
-
throw e
|
|
1193
|
-
}
|
|
1194
|
-
expect(e).toBeInstanceOf(InsufficientFunds)
|
|
1195
|
-
}
|
|
1164
|
+
await expect(nodeApi.broadcastTransaction(currencyId, serializedTransaction)).rejects.toThrow(
|
|
1165
|
+
InsufficientFunds
|
|
1166
|
+
)
|
|
1196
1167
|
})
|
|
1197
1168
|
|
|
1198
1169
|
it('should throw any other error', async () => {
|
|
1199
1170
|
const serializedTransaction =
|
|
1200
1171
|
'0x02f873012d85010c388d0085077715912682520894c2907efcce4011c491bbeda8a0fa63ba7aab596c87038d7ea4c6800080c001a0bbffe7ba303ab03f697d64672c4a288ae863df8a62ffc67ba72872ce8c227f6fa01261e7c9f06af13631f03fad9b88d3c48931d353b6b41b4072fddcca5ec41625'
|
|
1201
1172
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
} catch (e) {
|
|
1206
|
-
if (e instanceof AssertionError) {
|
|
1207
|
-
throw e
|
|
1208
|
-
}
|
|
1209
|
-
expect((e as Error).message).toEqual('any error')
|
|
1210
|
-
}
|
|
1173
|
+
await expect(nodeApi.broadcastTransaction(currencyId, serializedTransaction)).rejects.toThrow(
|
|
1174
|
+
'any error'
|
|
1175
|
+
)
|
|
1211
1176
|
})
|
|
1212
1177
|
})
|
|
1213
1178
|
|
|
@@ -1225,22 +1190,24 @@ describe('EVM Family', () => {
|
|
|
1225
1190
|
})
|
|
1226
1191
|
|
|
1227
1192
|
it('should prefetch block transactions when requested', async () => {
|
|
1228
|
-
jest.spyOn(JsonRpcProvider.prototype, 'getBlock').mockResolvedValueOnce(
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1193
|
+
jest.spyOn(JsonRpcProvider.prototype, 'getBlock').mockResolvedValueOnce(
|
|
1194
|
+
mkBlock({
|
|
1195
|
+
hash: '0x474dee0136108e9412e9d84197b468bb057a8dad0f2024fc55adebc4a28fa8c5',
|
|
1196
|
+
parentHash: '0xfc900c22725f9c0843c9cf7d2c47f4b61b246bd21e18e99f709aebaefc8aff14',
|
|
1197
|
+
number: 1,
|
|
1198
|
+
timestamp: now,
|
|
1199
|
+
transactions: ['0xtx1'],
|
|
1200
|
+
prefetchedTransactions: [
|
|
1201
|
+
mkTransactionResponse({
|
|
1202
|
+
hash: '0xtx1',
|
|
1203
|
+
value: 1n,
|
|
1204
|
+
from: '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d',
|
|
1205
|
+
to: '0xc2907efcce4011c491bbeda8a0fa63ba7aab596c',
|
|
1206
|
+
gasPrice: 0n,
|
|
1207
|
+
}),
|
|
1208
|
+
],
|
|
1209
|
+
})
|
|
1210
|
+
)
|
|
1244
1211
|
|
|
1245
1212
|
expect(await nodeApi.getBlockByHeight(currencyId, 1, true)).toEqual({
|
|
1246
1213
|
hash: '0x474dee0136108e9412e9d84197b468bb057a8dad0f2024fc55adebc4a28fa8c5',
|
|
@@ -1261,18 +1228,23 @@ describe('EVM Family', () => {
|
|
|
1261
1228
|
})
|
|
1262
1229
|
|
|
1263
1230
|
it('should fallback to transaction hashes when prefetched transactions are unavailable', async () => {
|
|
1264
|
-
|
|
1231
|
+
const blockWithThrowingGetter = mkBlock({
|
|
1265
1232
|
hash: '0x474dee0136108e9412e9d84197b468bb057a8dad0f2024fc55adebc4a28fa8c5',
|
|
1266
1233
|
parentHash: '0xfc900c22725f9c0843c9cf7d2c47f4b61b246bd21e18e99f709aebaefc8aff14',
|
|
1267
1234
|
number: 1,
|
|
1268
1235
|
timestamp: now,
|
|
1269
1236
|
transactions: ['0xtx1'],
|
|
1270
|
-
|
|
1237
|
+
})
|
|
1238
|
+
Object.defineProperty(blockWithThrowingGetter, 'prefetchedTransactions', {
|
|
1239
|
+
get() {
|
|
1271
1240
|
const error = new Error('transactions were not prefetched with block request')
|
|
1272
|
-
|
|
1241
|
+
Object.assign(error, { code: 'UNSUPPORTED_OPERATION' })
|
|
1273
1242
|
throw error
|
|
1274
1243
|
},
|
|
1275
|
-
}
|
|
1244
|
+
})
|
|
1245
|
+
jest
|
|
1246
|
+
.spyOn(JsonRpcProvider.prototype, 'getBlock')
|
|
1247
|
+
.mockResolvedValueOnce(blockWithThrowingGetter)
|
|
1276
1248
|
|
|
1277
1249
|
expect(await nodeApi.getBlockByHeight(currencyId, 1, true)).toEqual({
|
|
1278
1250
|
hash: '0x474dee0136108e9412e9d84197b468bb057a8dad0f2024fc55adebc4a28fa8c5',
|
|
@@ -1484,7 +1456,7 @@ describe('EVM Family', () => {
|
|
|
1484
1456
|
(e: unknown) => e
|
|
1485
1457
|
)
|
|
1486
1458
|
expect(err).toBeInstanceOf(UnsupportedRpcMethodError)
|
|
1487
|
-
expect((
|
|
1459
|
+
expect(err).toMatchObject({ method: 'trace_block' })
|
|
1488
1460
|
}
|
|
1489
1461
|
)
|
|
1490
1462
|
})
|
|
@@ -1554,7 +1526,7 @@ describe('EVM Family', () => {
|
|
|
1554
1526
|
(e: unknown) => e
|
|
1555
1527
|
)
|
|
1556
1528
|
expect(err).toBeInstanceOf(UnsupportedRpcMethodError)
|
|
1557
|
-
expect((
|
|
1529
|
+
expect(err).toMatchObject({ method: 'debug_traceBlockByNumber' })
|
|
1558
1530
|
}
|
|
1559
1531
|
)
|
|
1560
1532
|
|
|
@@ -1574,7 +1546,7 @@ describe('EVM Family', () => {
|
|
|
1574
1546
|
(e: unknown) => e
|
|
1575
1547
|
)
|
|
1576
1548
|
expect(err).toBeInstanceOf(UnsupportedRpcMethodError)
|
|
1577
|
-
expect((
|
|
1549
|
+
expect(err).toMatchObject({ method: 'debug_traceBlockByNumber' })
|
|
1578
1550
|
})
|
|
1579
1551
|
})
|
|
1580
1552
|
|
|
@@ -1753,16 +1725,13 @@ describe('EVM Family', () => {
|
|
|
1753
1725
|
const NORMALIZED_RECIPIENT = '0xc2907efcce4011c491bbeda8a0fa63ba7aab596c'
|
|
1754
1726
|
|
|
1755
1727
|
let capturedTransaction: { from?: string; to?: string } | undefined
|
|
1756
|
-
jest
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
}
|
|
1764
|
-
return null
|
|
1765
|
-
})
|
|
1728
|
+
jest.spyOn(JsonRpcProvider.prototype, '_perform').mockImplementation(async (arg) => {
|
|
1729
|
+
if (arg.method === 'estimateGas') {
|
|
1730
|
+
capturedTransaction = arg.transaction
|
|
1731
|
+
return 21000n
|
|
1732
|
+
}
|
|
1733
|
+
return null
|
|
1734
|
+
})
|
|
1766
1735
|
|
|
1767
1736
|
await nodeApi.getGasEstimation(currencyId, address, {
|
|
1768
1737
|
recipient: EIP1191_RECIPIENT,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import type { BlockFinalizationTag, EvmConfigInfo } from '../../config'
|
|
5
|
+
import type { FeeData } from '../../types'
|
|
4
6
|
import type { BroadcastConfig } from '@ledgerhq/coin-module-framework/api/types'
|
|
5
|
-
import BigNumber from 'bignumber.js'
|
|
6
|
-
import { BlockFinalizationTag, EvmConfigInfo } from '../../config'
|
|
7
|
-
import { FeeData } from '../../types'
|
|
7
|
+
import type BigNumber from 'bignumber.js'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Asset information for token transfers
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import type { StakingOperation } from '../types/staking'
|
|
4
5
|
import { ethers } from 'ethers'
|
|
5
|
-
import { StakingOperation } from '../types/staking'
|
|
6
6
|
import { detectEvmStakingOperationType, isStakingOperation } from './detectOperationType'
|
|
7
7
|
|
|
8
8
|
describe('isStakingOperation', () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import type { StakingOperation } from '../types/staking'
|
|
4
5
|
import { ethers } from 'ethers'
|
|
5
|
-
import { StakingOperation } from '../types/staking'
|
|
6
6
|
import { extractSeiDelegation, getSeiDelegationAmount } from '../utils'
|
|
7
7
|
import { STAKING_CONTRACTS } from './contracts'
|
|
8
8
|
import { encodeStakingData, decodeStakingResult } from './encoder'
|
|
@@ -18,7 +18,7 @@ describe('encodeStakingData', () => {
|
|
|
18
18
|
|
|
19
19
|
const encoded = encodeStakingData({
|
|
20
20
|
currencyId,
|
|
21
|
-
operation: 'delegate'
|
|
21
|
+
operation: 'delegate',
|
|
22
22
|
config,
|
|
23
23
|
params,
|
|
24
24
|
})
|
|
@@ -33,7 +33,7 @@ describe('encodeStakingData', () => {
|
|
|
33
33
|
|
|
34
34
|
const encoded = encodeStakingData({
|
|
35
35
|
currencyId,
|
|
36
|
-
operation: 'undelegate'
|
|
36
|
+
operation: 'undelegate',
|
|
37
37
|
config,
|
|
38
38
|
params,
|
|
39
39
|
})
|
|
@@ -49,7 +49,7 @@ describe('encodeStakingData', () => {
|
|
|
49
49
|
|
|
50
50
|
const encoded = encodeStakingData({
|
|
51
51
|
currencyId,
|
|
52
|
-
operation: 'redelegate'
|
|
52
|
+
operation: 'redelegate',
|
|
53
53
|
config,
|
|
54
54
|
params,
|
|
55
55
|
})
|
|
@@ -84,7 +84,7 @@ describe('encodeStakingData', () => {
|
|
|
84
84
|
|
|
85
85
|
const encoded = encodeStakingData({
|
|
86
86
|
currencyId,
|
|
87
|
-
operation: 'delegate'
|
|
87
|
+
operation: 'delegate',
|
|
88
88
|
config,
|
|
89
89
|
params,
|
|
90
90
|
})
|
|
@@ -99,7 +99,7 @@ describe('encodeStakingData', () => {
|
|
|
99
99
|
|
|
100
100
|
const encoded = encodeStakingData({
|
|
101
101
|
currencyId,
|
|
102
|
-
operation: 'undelegate'
|
|
102
|
+
operation: 'undelegate',
|
|
103
103
|
config,
|
|
104
104
|
params,
|
|
105
105
|
})
|
|
@@ -115,7 +115,7 @@ describe('encodeStakingData', () => {
|
|
|
115
115
|
expect(() => {
|
|
116
116
|
encodeStakingData({
|
|
117
117
|
currencyId: 'unsupported_currency',
|
|
118
|
-
operation: 'delegate'
|
|
118
|
+
operation: 'delegate',
|
|
119
119
|
config,
|
|
120
120
|
params: ['validator'],
|
|
121
121
|
})
|
|
@@ -126,7 +126,8 @@ describe('encodeStakingData', () => {
|
|
|
126
126
|
expect(() => {
|
|
127
127
|
encodeStakingData({
|
|
128
128
|
currencyId: 'sei_evm',
|
|
129
|
-
operation
|
|
129
|
+
// @ts-ignore — intentionally invalid operation to test error path
|
|
130
|
+
operation: 'invalidOperation',
|
|
130
131
|
config,
|
|
131
132
|
params: ['validator'],
|
|
132
133
|
})
|
|
@@ -197,12 +198,7 @@ describe('decodeStakingResult', () => {
|
|
|
197
198
|
[mockBalance, mockDelegation],
|
|
198
199
|
])
|
|
199
200
|
|
|
200
|
-
const decoded = decodeStakingResult(
|
|
201
|
-
currencyId,
|
|
202
|
-
'getStakedBalance' as StakingOperation,
|
|
203
|
-
config,
|
|
204
|
-
encodedResult
|
|
205
|
-
)
|
|
201
|
+
const decoded = decodeStakingResult(currencyId, 'getStakedBalance', config, encodedResult)
|
|
206
202
|
|
|
207
203
|
expect(decoded).toBeInstanceOf(Array)
|
|
208
204
|
expect(decoded.length).toBeGreaterThan(0)
|
|
@@ -265,7 +261,7 @@ describe('decodeStakingResult', () => {
|
|
|
265
261
|
|
|
266
262
|
const decoded = decodeStakingResult(
|
|
267
263
|
'sei_evm',
|
|
268
|
-
'getStakedBalance'
|
|
264
|
+
'getStakedBalance',
|
|
269
265
|
STAKING_CONTRACTS['sei_evm'],
|
|
270
266
|
encodedResult
|
|
271
267
|
)
|
|
@@ -283,18 +279,14 @@ describe('decodeStakingResult', () => {
|
|
|
283
279
|
|
|
284
280
|
it('should throw error for unsupported currency', () => {
|
|
285
281
|
expect(() => {
|
|
286
|
-
decodeStakingResult(
|
|
287
|
-
'unsupported_currency',
|
|
288
|
-
'getStakedBalance' as StakingOperation,
|
|
289
|
-
config,
|
|
290
|
-
'0x'
|
|
291
|
-
)
|
|
282
|
+
decodeStakingResult('unsupported_currency', 'getStakedBalance', config, '0x')
|
|
292
283
|
}).toThrow('No ABI found for staking currency: unsupported_currency')
|
|
293
284
|
})
|
|
294
285
|
|
|
295
286
|
it('should throw error for unsupported operation', () => {
|
|
296
287
|
expect(() => {
|
|
297
|
-
|
|
288
|
+
// @ts-ignore — intentionally invalid operation to test error path
|
|
289
|
+
decodeStakingResult('sei_evm', 'invalidOperation', config, '0x')
|
|
298
290
|
}).toThrow("Operation 'invalidOperation' not supported for currency: sei_evm")
|
|
299
291
|
})
|
|
300
292
|
})
|