@ledgerhq/coin-evm 8.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.
Files changed (278) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/docs/getBlock-internal-txs-schema.md +1 -1
  3. package/docs/network/node/index.md +3 -1
  4. package/lib/adapters/blockOperations.d.ts +4 -3
  5. package/lib/adapters/blockOperations.d.ts.map +1 -1
  6. package/lib/adapters/blockOperations.js +17 -17
  7. package/lib/adapters/blockOperations.js.map +1 -1
  8. package/lib/adapters/etherscan.d.ts +7 -6
  9. package/lib/adapters/etherscan.d.ts.map +1 -1
  10. package/lib/adapters/etherscan.js +19 -19
  11. package/lib/adapters/etherscan.js.map +1 -1
  12. package/lib/adapters/ledger.d.ts +6 -5
  13. package/lib/adapters/ledger.d.ts.map +1 -1
  14. package/lib/adapters/ledger.js +15 -15
  15. package/lib/adapters/ledger.js.map +1 -1
  16. package/lib/api/index.d.ts.map +1 -1
  17. package/lib/api/index.js +1 -2
  18. package/lib/api/index.js.map +1 -1
  19. package/lib/logic/common.js +1 -1
  20. package/lib/logic/common.js.map +1 -1
  21. package/lib/logic/getBalance.d.ts.map +1 -1
  22. package/lib/logic/getBalance.js +3 -3
  23. package/lib/logic/getBalance.js.map +1 -1
  24. package/lib/logic/getBlock.d.ts.map +1 -1
  25. package/lib/logic/getBlock.js +22 -23
  26. package/lib/logic/getBlock.js.map +1 -1
  27. package/lib/logic/getStakes.d.ts.map +1 -1
  28. package/lib/logic/getStakes.js +2 -2
  29. package/lib/logic/getStakes.js.map +1 -1
  30. package/lib/logic/internalTransactionsFetcher.d.ts +3 -2
  31. package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
  32. package/lib/logic/internalTransactionsFetcher.js +13 -10
  33. package/lib/logic/internalTransactionsFetcher.js.map +1 -1
  34. package/lib/logic/listOperations.js +1 -1
  35. package/lib/logic/listOperations.js.map +1 -1
  36. package/lib/logic-public/utils.d.ts +3 -2
  37. package/lib/logic-public/utils.d.ts.map +1 -1
  38. package/lib/logic-public/utils.js +7 -6
  39. package/lib/logic-public/utils.js.map +1 -1
  40. package/lib/network/explorer/etherscan.d.ts +3 -2
  41. package/lib/network/explorer/etherscan.d.ts.map +1 -1
  42. package/lib/network/explorer/etherscan.js +13 -12
  43. package/lib/network/explorer/etherscan.js.map +1 -1
  44. package/lib/network/explorer/ledger.d.ts.map +1 -1
  45. package/lib/network/explorer/ledger.js +11 -11
  46. package/lib/network/explorer/ledger.js.map +1 -1
  47. package/lib/network/explorer/types.d.ts +2 -2
  48. package/lib/network/explorer/types.d.ts.map +1 -1
  49. package/lib/network/explorer/types.js.map +1 -1
  50. package/lib/network/node/explorerProxy.js +3 -3
  51. package/lib/network/node/explorerProxy.js.map +1 -1
  52. package/lib/network/node/index.d.ts.map +1 -1
  53. package/lib/network/node/index.js +2 -2
  54. package/lib/network/node/index.js.map +1 -1
  55. package/lib/network/node/ledger.d.ts +2 -1
  56. package/lib/network/node/ledger.d.ts.map +1 -1
  57. package/lib/network/node/ledger.js +9 -10
  58. package/lib/network/node/ledger.js.map +1 -1
  59. package/lib/network/node/rpc.common.d.ts +3 -2
  60. package/lib/network/node/rpc.common.d.ts.map +1 -1
  61. package/lib/network/node/rpc.common.js +37 -29
  62. package/lib/network/node/rpc.common.js.map +1 -1
  63. package/lib/staking/contracts.js +2 -2
  64. package/lib/staking/contracts.js.map +1 -1
  65. package/lib/staking/fetchers.d.ts.map +1 -1
  66. package/lib/staking/fetchers.js +7 -7
  67. package/lib/staking/fetchers.js.map +1 -1
  68. package/lib/staking/prepareIntents.d.ts +2 -1
  69. package/lib/staking/prepareIntents.d.ts.map +1 -1
  70. package/lib/staking/prepareIntents.js +4 -4
  71. package/lib/staking/prepareIntents.js.map +1 -1
  72. package/lib/staking/redelegations.d.ts +5 -4
  73. package/lib/staking/redelegations.d.ts.map +1 -1
  74. package/lib/staking/redelegations.js +13 -14
  75. package/lib/staking/redelegations.js.map +1 -1
  76. package/lib/staking/rewards.d.ts +2 -1
  77. package/lib/staking/rewards.d.ts.map +1 -1
  78. package/lib/staking/rewards.js +4 -5
  79. package/lib/staking/rewards.js.map +1 -1
  80. package/lib/staking/rewardsFromReceipt.d.ts +2 -1
  81. package/lib/staking/rewardsFromReceipt.d.ts.map +1 -1
  82. package/lib/staking/rewardsFromReceipt.js +2 -3
  83. package/lib/staking/rewardsFromReceipt.js.map +1 -1
  84. package/lib/staking/unbondings.d.ts +2 -1
  85. package/lib/staking/unbondings.d.ts.map +1 -1
  86. package/lib/staking/unbondings.js +4 -5
  87. package/lib/staking/unbondings.js.map +1 -1
  88. package/lib/staking/validators/index.d.ts +9 -4
  89. package/lib/staking/validators/index.d.ts.map +1 -1
  90. package/lib/staking/validators/index.js +19 -10
  91. package/lib/staking/validators/index.js.map +1 -1
  92. package/lib/staking/validators/monad.d.ts +6 -5
  93. package/lib/staking/validators/monad.d.ts.map +1 -1
  94. package/lib/staking/validators/monad.js +33 -29
  95. package/lib/staking/validators/monad.js.map +1 -1
  96. package/lib/staking/validators/monadResolver.d.ts +2 -1
  97. package/lib/staking/validators/monadResolver.d.ts.map +1 -1
  98. package/lib/staking/validators/monadResolver.js +2 -3
  99. package/lib/staking/validators/monadResolver.js.map +1 -1
  100. package/lib/staking/validators/somnia.d.ts +3 -2
  101. package/lib/staking/validators/somnia.d.ts.map +1 -1
  102. package/lib/staking/validators/somnia.js +16 -15
  103. package/lib/staking/validators/somnia.js.map +1 -1
  104. package/lib/staking/validators/types.d.ts +2 -1
  105. package/lib/staking/validators/types.d.ts.map +1 -1
  106. package/lib/staking/validators/zero_gravity.d.ts +2 -1
  107. package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
  108. package/lib/staking/validators/zero_gravity.js +7 -8
  109. package/lib/staking/validators/zero_gravity.js.map +1 -1
  110. package/lib/types/staking.d.ts +4 -3
  111. package/lib/types/staking.d.ts.map +1 -1
  112. package/lib-es/adapters/blockOperations.d.ts +4 -3
  113. package/lib-es/adapters/blockOperations.d.ts.map +1 -1
  114. package/lib-es/adapters/blockOperations.js +17 -17
  115. package/lib-es/adapters/blockOperations.js.map +1 -1
  116. package/lib-es/adapters/etherscan.d.ts +7 -6
  117. package/lib-es/adapters/etherscan.d.ts.map +1 -1
  118. package/lib-es/adapters/etherscan.js +19 -19
  119. package/lib-es/adapters/etherscan.js.map +1 -1
  120. package/lib-es/adapters/ledger.d.ts +6 -5
  121. package/lib-es/adapters/ledger.d.ts.map +1 -1
  122. package/lib-es/adapters/ledger.js +15 -15
  123. package/lib-es/adapters/ledger.js.map +1 -1
  124. package/lib-es/api/index.d.ts.map +1 -1
  125. package/lib-es/api/index.js +1 -2
  126. package/lib-es/api/index.js.map +1 -1
  127. package/lib-es/logic/common.js +1 -1
  128. package/lib-es/logic/common.js.map +1 -1
  129. package/lib-es/logic/getBalance.d.ts.map +1 -1
  130. package/lib-es/logic/getBalance.js +3 -3
  131. package/lib-es/logic/getBalance.js.map +1 -1
  132. package/lib-es/logic/getBlock.d.ts.map +1 -1
  133. package/lib-es/logic/getBlock.js +22 -23
  134. package/lib-es/logic/getBlock.js.map +1 -1
  135. package/lib-es/logic/getStakes.d.ts.map +1 -1
  136. package/lib-es/logic/getStakes.js +2 -2
  137. package/lib-es/logic/getStakes.js.map +1 -1
  138. package/lib-es/logic/internalTransactionsFetcher.d.ts +3 -2
  139. package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
  140. package/lib-es/logic/internalTransactionsFetcher.js +13 -10
  141. package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
  142. package/lib-es/logic/listOperations.js +1 -1
  143. package/lib-es/logic/listOperations.js.map +1 -1
  144. package/lib-es/logic-public/utils.d.ts +3 -2
  145. package/lib-es/logic-public/utils.d.ts.map +1 -1
  146. package/lib-es/logic-public/utils.js +7 -6
  147. package/lib-es/logic-public/utils.js.map +1 -1
  148. package/lib-es/network/explorer/etherscan.d.ts +3 -2
  149. package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
  150. package/lib-es/network/explorer/etherscan.js +13 -12
  151. package/lib-es/network/explorer/etherscan.js.map +1 -1
  152. package/lib-es/network/explorer/ledger.d.ts.map +1 -1
  153. package/lib-es/network/explorer/ledger.js +11 -11
  154. package/lib-es/network/explorer/ledger.js.map +1 -1
  155. package/lib-es/network/explorer/types.d.ts +2 -2
  156. package/lib-es/network/explorer/types.d.ts.map +1 -1
  157. package/lib-es/network/explorer/types.js.map +1 -1
  158. package/lib-es/network/node/explorerProxy.js +3 -3
  159. package/lib-es/network/node/explorerProxy.js.map +1 -1
  160. package/lib-es/network/node/index.d.ts.map +1 -1
  161. package/lib-es/network/node/index.js +2 -2
  162. package/lib-es/network/node/index.js.map +1 -1
  163. package/lib-es/network/node/ledger.d.ts +2 -1
  164. package/lib-es/network/node/ledger.d.ts.map +1 -1
  165. package/lib-es/network/node/ledger.js +9 -10
  166. package/lib-es/network/node/ledger.js.map +1 -1
  167. package/lib-es/network/node/rpc.common.d.ts +3 -2
  168. package/lib-es/network/node/rpc.common.d.ts.map +1 -1
  169. package/lib-es/network/node/rpc.common.js +37 -29
  170. package/lib-es/network/node/rpc.common.js.map +1 -1
  171. package/lib-es/staking/contracts.js +2 -2
  172. package/lib-es/staking/contracts.js.map +1 -1
  173. package/lib-es/staking/fetchers.d.ts.map +1 -1
  174. package/lib-es/staking/fetchers.js +7 -7
  175. package/lib-es/staking/fetchers.js.map +1 -1
  176. package/lib-es/staking/prepareIntents.d.ts +2 -1
  177. package/lib-es/staking/prepareIntents.d.ts.map +1 -1
  178. package/lib-es/staking/prepareIntents.js +4 -4
  179. package/lib-es/staking/prepareIntents.js.map +1 -1
  180. package/lib-es/staking/redelegations.d.ts +5 -4
  181. package/lib-es/staking/redelegations.d.ts.map +1 -1
  182. package/lib-es/staking/redelegations.js +13 -14
  183. package/lib-es/staking/redelegations.js.map +1 -1
  184. package/lib-es/staking/rewards.d.ts +2 -1
  185. package/lib-es/staking/rewards.d.ts.map +1 -1
  186. package/lib-es/staking/rewards.js +4 -5
  187. package/lib-es/staking/rewards.js.map +1 -1
  188. package/lib-es/staking/rewardsFromReceipt.d.ts +2 -1
  189. package/lib-es/staking/rewardsFromReceipt.d.ts.map +1 -1
  190. package/lib-es/staking/rewardsFromReceipt.js +2 -3
  191. package/lib-es/staking/rewardsFromReceipt.js.map +1 -1
  192. package/lib-es/staking/unbondings.d.ts +2 -1
  193. package/lib-es/staking/unbondings.d.ts.map +1 -1
  194. package/lib-es/staking/unbondings.js +4 -5
  195. package/lib-es/staking/unbondings.js.map +1 -1
  196. package/lib-es/staking/validators/index.d.ts +9 -4
  197. package/lib-es/staking/validators/index.d.ts.map +1 -1
  198. package/lib-es/staking/validators/index.js +18 -10
  199. package/lib-es/staking/validators/index.js.map +1 -1
  200. package/lib-es/staking/validators/monad.d.ts +6 -5
  201. package/lib-es/staking/validators/monad.d.ts.map +1 -1
  202. package/lib-es/staking/validators/monad.js +33 -29
  203. package/lib-es/staking/validators/monad.js.map +1 -1
  204. package/lib-es/staking/validators/monadResolver.d.ts +2 -1
  205. package/lib-es/staking/validators/monadResolver.d.ts.map +1 -1
  206. package/lib-es/staking/validators/monadResolver.js +2 -3
  207. package/lib-es/staking/validators/monadResolver.js.map +1 -1
  208. package/lib-es/staking/validators/somnia.d.ts +3 -2
  209. package/lib-es/staking/validators/somnia.d.ts.map +1 -1
  210. package/lib-es/staking/validators/somnia.js +16 -15
  211. package/lib-es/staking/validators/somnia.js.map +1 -1
  212. package/lib-es/staking/validators/types.d.ts +2 -1
  213. package/lib-es/staking/validators/types.d.ts.map +1 -1
  214. package/lib-es/staking/validators/zero_gravity.d.ts +2 -1
  215. package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
  216. package/lib-es/staking/validators/zero_gravity.js +7 -8
  217. package/lib-es/staking/validators/zero_gravity.js.map +1 -1
  218. package/lib-es/types/staking.d.ts +4 -3
  219. package/lib-es/types/staking.d.ts.map +1 -1
  220. package/package.json +2 -3
  221. package/src/adapters/blockOperations.test.ts +86 -67
  222. package/src/adapters/blockOperations.ts +28 -17
  223. package/src/adapters/etherscan.test.ts +151 -85
  224. package/src/adapters/etherscan.ts +27 -18
  225. package/src/adapters/ledger.test.ts +210 -83
  226. package/src/adapters/ledger.ts +21 -15
  227. package/src/api/index.integ.test.ts +7 -6
  228. package/src/api/index.test.ts +2 -2
  229. package/src/api/index.ts +1 -2
  230. package/src/logic/common.ts +1 -1
  231. package/src/logic/getBalance.ts +4 -3
  232. package/src/logic/getBlock.ts +43 -27
  233. package/src/logic/getStakes.ts +2 -1
  234. package/src/logic/internalTransactionsFetcher.ts +16 -10
  235. package/src/logic/listOperations.ts +2 -2
  236. package/src/logic/tests/getBalance.test.ts +5 -3
  237. package/src/logic/tests/getBlock.test.ts +16 -15
  238. package/src/logic/tests/internalTransactionsFetcher.test.ts +6 -5
  239. package/src/logic/tests/listOperations.test.ts +4 -4
  240. package/src/logic-public/tests/utils.test.ts +6 -5
  241. package/src/logic-public/utils.ts +8 -5
  242. package/src/logic.test.ts +5 -5
  243. package/src/network/explorer/etherscan.test.ts +169 -55
  244. package/src/network/explorer/etherscan.ts +27 -16
  245. package/src/network/explorer/index.test.ts +2 -1
  246. package/src/network/explorer/ledger.test.ts +207 -35
  247. package/src/network/explorer/ledger.ts +12 -8
  248. package/src/network/explorer/types.ts +3 -2
  249. package/src/network/node/explorerProxy.ts +3 -3
  250. package/src/network/node/index.ts +3 -2
  251. package/src/network/node/ledger.test.ts +25 -25
  252. package/src/network/node/ledger.ts +13 -10
  253. package/src/network/node/rpc.common.ts +84 -28
  254. package/src/network/node/rpc.test.ts +45 -31
  255. package/src/staking/contracts.ts +2 -2
  256. package/src/staking/fetchers.ts +20 -8
  257. package/src/staking/prepareIntents.test.ts +33 -12
  258. package/src/staking/prepareIntents.ts +9 -5
  259. package/src/staking/redelegations.test.ts +96 -35
  260. package/src/staking/redelegations.ts +20 -12
  261. package/src/staking/rewards.test.ts +15 -10
  262. package/src/staking/rewards.ts +8 -5
  263. package/src/staking/rewardsFromReceipt.test.ts +5 -4
  264. package/src/staking/rewardsFromReceipt.ts +4 -3
  265. package/src/staking/unbondings.test.ts +15 -12
  266. package/src/staking/unbondings.ts +7 -5
  267. package/src/staking/validators/index.ts +30 -10
  268. package/src/staking/validators/monad.test.ts +57 -43
  269. package/src/staking/validators/monad.ts +55 -32
  270. package/src/staking/validators/monadResolver.ts +4 -3
  271. package/src/staking/validators/somnia.test.ts +14 -13
  272. package/src/staking/validators/somnia.ts +35 -19
  273. package/src/staking/validators/types.ts +2 -0
  274. package/src/staking/validators/zero_gravity.test.ts +48 -26
  275. package/src/staking/validators/zero_gravity.ts +14 -8
  276. package/src/staking/validators.integ.test.ts +2 -2
  277. package/src/staking/validators.test.ts +30 -26
  278. package/src/types/staking.ts +9 -2
@@ -9,6 +9,7 @@ import type {
9
9
  LedgerExplorerOperation,
10
10
  } from '../types'
11
11
  import type { MemoNotSupported, Operation } from '@ledgerhq/coin-module-framework/api/types'
12
+ import type { Logger } from '@ledgerhq/coin-module-framework/config'
12
13
  import eip55 from 'eip55'
13
14
  import { safeBigInt, safeEncodeEIP55 } from '../logic-public'
14
15
  import { detectEvmStakingOperationType } from '../staking/detectOperationType'
@@ -20,11 +21,12 @@ import { detectEvmStakingOperationType } from '../staking/detectOperationType'
20
21
  export const ledgerOperationToOperations = (
21
22
  address: string,
22
23
  currencyId: string,
23
- ledgerOp: LedgerExplorerOperation
24
+ ledgerOp: LedgerExplorerOperation,
25
+ logger: Logger
24
26
  ): Array<Operation<MemoNotSupported>> => {
25
27
  const checksummedAddress = eip55.encode(address)
26
- const from = safeEncodeEIP55(ledgerOp.from)
27
- const to = safeEncodeEIP55(ledgerOp.to)
28
+ const from = safeEncodeEIP55(ledgerOp.from, logger)
29
+ const to = safeEncodeEIP55(ledgerOp.to, logger)
28
30
  const input = ledgerOp.input ?? undefined
29
31
  const methodId = input ? input.slice(0, 10) : undefined // 0x + 4-byte selector
30
32
  const failed = !ledgerOp.status
@@ -82,11 +84,12 @@ export const ledgerERC20EventToOperations = (
82
84
  address: string,
83
85
  coinOperation: Operation<MemoNotSupported>,
84
86
  event: LedgerExplorerERC20TransferEvent,
85
- index = 0
87
+ index = 0,
88
+ logger: Logger
86
89
  ): Array<Operation<MemoNotSupported>> => {
87
90
  const checksummedAddress = eip55.encode(address)
88
- const from = safeEncodeEIP55(event.from)
89
- const to = safeEncodeEIP55(event.to)
91
+ const from = safeEncodeEIP55(event.from, logger)
92
+ const to = safeEncodeEIP55(event.to, logger)
90
93
  const contract = eip55.encode(event.contract)
91
94
  const types: string[] = []
92
95
 
@@ -122,11 +125,12 @@ export const ledgerERC721EventToOperations = (
122
125
  address: string,
123
126
  coinOperation: Operation<MemoNotSupported>,
124
127
  event: LedgerExplorerER721TransferEvent,
125
- index = 0
128
+ index = 0,
129
+ logger: Logger
126
130
  ): Array<Operation<MemoNotSupported>> => {
127
131
  const checksummedAddress = eip55.encode(address)
128
- const from = safeEncodeEIP55(event.sender)
129
- const to = safeEncodeEIP55(event.receiver)
132
+ const from = safeEncodeEIP55(event.sender, logger)
133
+ const to = safeEncodeEIP55(event.receiver, logger)
130
134
  const contract = eip55.encode(event.contract)
131
135
  const types: string[] = []
132
136
 
@@ -163,11 +167,12 @@ export const ledgerERC1155EventToOperations = (
163
167
  address: string,
164
168
  coinOperation: Operation<MemoNotSupported>,
165
169
  event: LedgerExplorerER1155TransferEvent,
166
- index = 0
170
+ index = 0,
171
+ logger: Logger
167
172
  ): Array<Operation<MemoNotSupported>> => {
168
173
  const checksummedAddress = eip55.encode(address)
169
- const from = safeEncodeEIP55(event.sender)
170
- const to = safeEncodeEIP55(event.receiver)
174
+ const from = safeEncodeEIP55(event.sender, logger)
175
+ const to = safeEncodeEIP55(event.receiver, logger)
171
176
  const contract = eip55.encode(event.contract)
172
177
  const types: string[] = []
173
178
 
@@ -208,13 +213,14 @@ export const ledgerInternalTransactionToOperations = (
208
213
  address: string,
209
214
  coinOperation: Operation<MemoNotSupported>,
210
215
  action: LedgerExplorerInternalTransaction,
211
- index = 0
216
+ index = 0,
217
+ logger: Logger
212
218
  ): Array<Operation<MemoNotSupported>> => {
213
219
  if (coinOperation.tx.failed) return []
214
220
 
215
221
  const checksummedAddress = eip55.encode(address)
216
- const from = safeEncodeEIP55(action.from)
217
- const to = safeEncodeEIP55(action.to)
222
+ const from = safeEncodeEIP55(action.from, logger)
223
+ const to = safeEncodeEIP55(action.to, logger)
218
224
  const hasFailed = !!action.error // AFAIK this is not working, all actions contain error = null even when it reverted
219
225
  const value = safeBigInt(action.value)
220
226
  const types: string[] = []
@@ -11,6 +11,7 @@ import {
11
11
  mkLedgerExplorer,
12
12
  mkLedgerNode,
13
13
  } from '../fixtures/context.fixtures'
14
+ import { isNative } from '../types/assets'
14
15
  import { createApi } from './index'
15
16
 
16
17
  describe.each([
@@ -643,11 +644,11 @@ describe.each([
643
644
  tx: { feesPayer: expect.any(String) },
644
645
  })
645
646
  const senderAsset = senderTxOps[0].asset
646
- if (senderAsset.type !== 'native') {
647
+ if (!isNative(senderAsset)) {
647
648
  expect(senderAsset.assetReference?.toLowerCase()).toBe(contract.toLowerCase())
648
649
  expectAddressEq(senderTxOps[0].senders[0], sender)
649
650
  expectAddressEq(senderTxOps[0].recipients[0], recipient)
650
- expectAddressEq(senderAsset.assetOwner, sender)
651
+ expectAddressEq(senderAsset.assetOwner!, sender)
651
652
  }
652
653
  expectAddressEq(senderTxOps[0].tx.feesPayer!, sender)
653
654
  expect(senderTxOps[0].value).toBeGreaterThan(0n)
@@ -658,11 +659,11 @@ describe.each([
658
659
  asset: { type: 'erc20' },
659
660
  })
660
661
  const recipientAsset = recipientTxOps[0].asset
661
- if (recipientAsset.type !== 'native') {
662
+ if (!isNative(recipientAsset)) {
662
663
  expect(recipientAsset.assetReference?.toLowerCase()).toBe(contract.toLowerCase())
663
664
  expectAddressEq(recipientTxOps[0].senders[0], sender)
664
665
  expectAddressEq(recipientTxOps[0].recipients[0], recipient)
665
- expectAddressEq(recipientAsset.assetOwner, recipient)
666
+ expectAddressEq(recipientAsset.assetOwner!, recipient)
666
667
  }
667
668
  expect(recipientTxOps[0].value).toBe(senderTxOps[0].value)
668
669
  })
@@ -705,9 +706,9 @@ describe.each([
705
706
  tx: { feesPayer: expect.any(String) },
706
707
  })
707
708
  const tokenOpAsset = tokenOp!.asset
708
- if (tokenOpAsset.type !== 'native') {
709
+ if (!isNative(tokenOpAsset)) {
709
710
  expect(tokenOpAsset.assetReference?.toLowerCase()).toBe(lidoContract.toLowerCase())
710
- expectAddressEq(tokenOpAsset.assetOwner, sender)
711
+ expectAddressEq(tokenOpAsset.assetOwner!, sender)
711
712
  }
712
713
  expect(tokenOp!.senders[0].toLowerCase()).toBe(zeroAddress.toLowerCase())
713
714
  expectAddressEq(tokenOp!.recipients[0], sender)
@@ -144,9 +144,9 @@ describe('staking support capability', () => {
144
144
  const api = createApi('sei_evm')
145
145
 
146
146
  await expect(api.getValidators(mockEvmContext)).resolves.toEqual(expectedPage)
147
- expect(mockGetValidatorsPage).toHaveBeenCalledWith(expect.anything(), 'sei_evm', undefined)
147
+ expect(mockGetValidatorsPage).toHaveBeenCalledWith(mockEvmContext, 'sei_evm', undefined)
148
148
 
149
149
  await expect(api.getValidators(mockEvmContext, { cursor: '42' })).resolves.toEqual(expectedPage)
150
- expect(mockGetValidatorsPage).toHaveBeenCalledWith(expect.anything(), 'sei_evm', '42')
150
+ expect(mockGetValidatorsPage).toHaveBeenCalledWith(mockEvmContext, 'sei_evm', '42')
151
151
  })
152
152
  })
package/src/api/index.ts CHANGED
@@ -121,8 +121,7 @@ export function createApi(currencyId: string) {
121
121
  context: EvmContext,
122
122
  options?: { cursor?: Cursor }
123
123
  ): Promise<Page<Validator>> => {
124
- const config = await context.config(currencyId)
125
- return getValidatorsPage(config, currencyId, options?.cursor)
124
+ return getValidatorsPage(context, currencyId, options?.cursor)
126
125
  },
127
126
  getNextSequence: (context: EvmContext, address: string): Promise<bigint> =>
128
127
  getNextSequence(context, currencyId, address),
@@ -167,7 +167,7 @@ export async function prepareUnsignedTxParams(
167
167
  // Prepare staking intents once (can require async on-chain lookups). See: LIVE-32750
168
168
  const preparedStakingIntent = isSend
169
169
  ? undefined
170
- : await prepareStakingIntent(config, currencyId, transactionIntent)
170
+ : await prepareStakingIntent(config, currencyId, transactionIntent, logger)
171
171
 
172
172
  const { to, data, value } = isSend
173
173
  ? buildSendTxParams(transactionIntent)
@@ -81,16 +81,16 @@ async function getTokenBalances(
81
81
  if (extractKnownValIds) {
82
82
  const ops = await explorerApi.getOperations(
83
83
  config,
84
+ context.logger,
84
85
  currencyId,
85
86
  address,
86
87
  0,
87
88
  undefined,
88
89
  undefined,
89
90
  undefined,
90
- undefined,
91
- context.logger
91
+ undefined
92
92
  )
93
- knownValidatorIds = extractKnownValIds(currencyId, ops.lastCoinOperations)
93
+ knownValidatorIds = extractKnownValIds(currencyId, ops.lastCoinOperations, context.logger)
94
94
 
95
95
  discoveredAssets = []
96
96
  for (const operation of ops.lastTokenOperations) {
@@ -105,6 +105,7 @@ async function getTokenBalances(
105
105
 
106
106
  discoveredAssets = await explorerApi.discoverTokenAssets(
107
107
  config,
108
+ context.logger,
108
109
  currencyId,
109
110
  address,
110
111
  scanMinHeight
@@ -11,8 +11,8 @@ import type {
11
11
  BlockTransaction,
12
12
  TransferBlockOperation,
13
13
  } from '@ledgerhq/coin-module-framework/api/index'
14
+ import type { Logger } from '@ledgerhq/coin-module-framework/config'
14
15
  import { promiseAllBatched } from '@ledgerhq/coin-module-framework/promises'
15
- import { log } from '@ledgerhq/logs'
16
16
  import { rpcTransactionToBlockOperations } from '../adapters/blockOperations'
17
17
  import { DEFAULT_INTERNAL_TX_SOURCES } from '../config'
18
18
  import { UnsupportedRpcMethodError } from '../errors'
@@ -41,7 +41,8 @@ export async function getBlock(
41
41
  config,
42
42
  nodeApi,
43
43
  currencyId,
44
- internalTxSources
44
+ internalTxSources,
45
+ context.logger
45
46
  )
46
47
 
47
48
  const result = await nodeApi.getBlockByHeight(currencyId, height, true)
@@ -71,6 +72,7 @@ export async function getBlock(
71
72
  transactionHashes,
72
73
  nodeApi,
73
74
  result.height,
75
+ context.logger,
74
76
  result.transactions
75
77
  ),
76
78
  transactionHashes.length === 0
@@ -127,6 +129,7 @@ async function getTransactionsFromNode(
127
129
  transactionHashes: string[],
128
130
  nodeApi: ReturnType<typeof getNodeApi>,
129
131
  blockHeight: number,
132
+ logger: Logger,
130
133
  prefetchedTransactions?: PrefetchedBlockTransaction[]
131
134
  ): Promise<BlockTransaction[]> {
132
135
  if (transactionHashes.length === 0) return []
@@ -135,7 +138,8 @@ async function getTransactionsFromNode(
135
138
  currencyId,
136
139
  blockHeight,
137
140
  prefetchedTransactions,
138
- nodeApi
141
+ nodeApi,
142
+ logger
139
143
  )
140
144
  if (bulkTransactions) return bulkTransactions
141
145
 
@@ -150,7 +154,7 @@ async function getTransactionsFromNode(
150
154
  const transactionResults = await promiseAllBatched(
151
155
  MAX_CONCURRENCY,
152
156
  transactionHashes,
153
- (txHash: string) => getTransactionFromHash(currencyId, txHash, nodeApi)
157
+ (txHash: string) => getTransactionFromHash(currencyId, txHash, nodeApi, logger)
154
158
  )
155
159
 
156
160
  return transactionResults.filter((tx): tx is BlockTransaction => tx !== null)
@@ -160,7 +164,8 @@ async function getTransactionsFromPrefetchedData(
160
164
  currencyId: string,
161
165
  blockHeight: number,
162
166
  prefetchedTransactions: PrefetchedBlockTransaction[] | undefined,
163
- nodeApi: ReturnType<typeof getNodeApi>
167
+ nodeApi: ReturnType<typeof getNodeApi>,
168
+ logger: Logger
164
169
  ): Promise<BlockTransaction[] | null> {
165
170
  if (!prefetchedTransactions || prefetchedTransactions.length === 0 || !nodeApi.getBlockReceipts)
166
171
  return null
@@ -173,10 +178,15 @@ async function getTransactionsFromPrefetchedData(
173
178
  for (const tx of prefetchedTransactions) {
174
179
  const receipt = receiptsByHash.get(tx.hash)
175
180
  if (!receipt) return null
176
- const blockTx = prefetchedTransactionToBlockTransaction(tx, receipt)
181
+ const blockTx = prefetchedTransactionToBlockTransaction(tx, receipt, logger)
177
182
  transactions.push({
178
183
  ...blockTx,
179
- operations: applyChainSpecificCorrections(currencyId, blockTx.operations, receipt.type),
184
+ operations: applyChainSpecificCorrections(
185
+ currencyId,
186
+ blockTx.operations,
187
+ receipt.type,
188
+ logger
189
+ ),
180
190
  })
181
191
  }
182
192
 
@@ -185,7 +195,7 @@ async function getTransactionsFromPrefetchedData(
185
195
  if (!(error instanceof UnsupportedRpcMethodError) || error.method !== 'eth_getBlockReceipts')
186
196
  throw error
187
197
 
188
- log('warn', 'EVM getBlock fallback: eth_getBlockReceipts unsupported', {
198
+ logger('warn', 'EVM getBlock fallback: eth_getBlockReceipts unsupported', {
189
199
  currencyId,
190
200
  blockHeight,
191
201
  error: error.rawError,
@@ -196,7 +206,8 @@ async function getTransactionsFromPrefetchedData(
196
206
 
197
207
  function prefetchedTransactionToBlockTransaction(
198
208
  tx: PrefetchedBlockTransaction,
199
- receipt: BlockReceiptInfo
209
+ receipt: BlockReceiptInfo,
210
+ logger: Logger
200
211
  ): BlockTransaction {
201
212
  const failed = receipt.status === 0
202
213
  // Some EVM chains (e.g. Cronos) omit `gasPrice` from transaction
@@ -205,14 +216,17 @@ function prefetchedTransactionToBlockTransaction(
205
216
  const receiptGasPrice = BigInt(receipt.gasPrice)
206
217
  const gasPrice = receiptGasPrice > 0n ? receiptGasPrice : BigInt(tx.gasPrice)
207
218
  const fees = BigInt(receipt.gasUsed) * gasPrice + (receipt.l1Fee ? BigInt(receipt.l1Fee) : 0n)
208
- const operations = rpcTransactionToBlockOperations({
209
- from: tx.from,
210
- to: tx.to,
211
- value: tx.value,
212
- erc20Transfers: receipt.erc20Transfers,
213
- })
219
+ const operations = rpcTransactionToBlockOperations(
220
+ {
221
+ from: tx.from,
222
+ to: tx.to,
223
+ value: tx.value,
224
+ erc20Transfers: receipt.erc20Transfers,
225
+ },
226
+ logger
227
+ )
214
228
 
215
- const details = buildSmartContractDetails(tx.to, tx.input, receipt.contractAddress)
229
+ const details = buildSmartContractDetails(tx.to, tx.input, logger, receipt.contractAddress)
216
230
 
217
231
  return {
218
232
  hash: tx.hash,
@@ -227,7 +241,8 @@ function prefetchedTransactionToBlockTransaction(
227
241
  async function getTransactionFromHash(
228
242
  currencyId: string,
229
243
  txHash: string,
230
- nodeApi: ReturnType<typeof getNodeApi>
244
+ nodeApi: ReturnType<typeof getNodeApi>,
245
+ logger: Logger
231
246
  ): Promise<BlockTransaction | null> {
232
247
  const txInfo = await nodeApi.getTransaction(currencyId, txHash)
233
248
 
@@ -235,10 +250,10 @@ async function getTransactionFromHash(
235
250
  const fees =
236
251
  BigInt(txInfo.gasUsed) * BigInt(txInfo.gasPrice) + (txInfo.l1Fee ? BigInt(txInfo.l1Fee) : 0n)
237
252
 
238
- const rawOperations = rpcTransactionToBlockOperations(txInfo)
239
- const operations = applyChainSpecificCorrections(currencyId, rawOperations, txInfo.type)
253
+ const rawOperations = rpcTransactionToBlockOperations(txInfo, logger)
254
+ const operations = applyChainSpecificCorrections(currencyId, rawOperations, txInfo.type, logger)
240
255
 
241
- const details = buildSmartContractDetails(txInfo.to, txInfo.input, txInfo.contractAddress)
256
+ const details = buildSmartContractDetails(txInfo.to, txInfo.input, logger, txInfo.contractAddress)
242
257
 
243
258
  return {
244
259
  hash: txHash,
@@ -250,16 +265,15 @@ async function getTransactionFromHash(
250
265
  }
251
266
  }
252
267
 
253
- const ZKSYNC_MINT_PEER = safeEncodeEIP55('0x0000000000000000000000000000000000000000')
254
-
255
268
  function applyChainSpecificCorrections(
256
269
  currencyId: string,
257
270
  operations: BlockOperation[],
258
- receiptType: number | undefined
271
+ receiptType: number | undefined,
272
+ logger: Logger
259
273
  ): BlockOperation[] {
260
274
  switch (currencyId) {
261
275
  case 'zksync':
262
- return rewriteZkSyncL1ToL2DepositOps(operations, receiptType)
276
+ return rewriteZkSyncL1ToL2DepositOps(operations, receiptType, logger)
263
277
  default:
264
278
  return operations
265
279
  }
@@ -272,11 +286,13 @@ function applyChainSpecificCorrections(
272
286
  */
273
287
  function rewriteZkSyncL1ToL2DepositOps(
274
288
  operations: BlockOperation[],
275
- receiptType: number | undefined
289
+ receiptType: number | undefined,
290
+ logger: Logger
276
291
  ): BlockOperation[] {
277
292
  if (receiptType !== 0xff) return operations
293
+ const zkSyncMintPeer = safeEncodeEIP55('0x0000000000000000000000000000000000000000', logger)
278
294
  const withoutMintSource = operations.filter(
279
- (op) => op.type !== 'transfer' || op.address.toLowerCase() !== ZKSYNC_MINT_PEER.toLowerCase()
295
+ (op) => op.type !== 'transfer' || op.address.toLowerCase() !== zkSyncMintPeer.toLowerCase()
280
296
  )
281
297
  const nativeSelf = withoutMintSource.find(
282
298
  (op): op is TransferBlockOperation =>
@@ -290,7 +306,7 @@ function rewriteZkSyncL1ToL2DepositOps(
290
306
  const nativeCredit: TransferBlockOperation = {
291
307
  type: 'transfer',
292
308
  address: nativeSelf.address,
293
- peer: ZKSYNC_MINT_PEER,
309
+ peer: zkSyncMintPeer,
294
310
  asset: { type: 'native' },
295
311
  amount: nativeSelf.amount,
296
312
  }
@@ -30,9 +30,10 @@ export const getStakes = async (
30
30
  address,
31
31
  contractConfig,
32
32
  currencyId,
33
+ context.logger,
33
34
  options?.knownValidatorIds
34
35
  ),
35
- fetchUnbondings(config, currencyId, address).catch(() => []),
36
+ fetchUnbondings(config, currencyId, address, context.logger).catch(() => []),
36
37
  ])
37
38
  return { items: [...stakes, ...unbondings] }
38
39
  } catch {
@@ -5,7 +5,7 @@ import type { EvmConfigInfo } from '../config'
5
5
  import type { InternalTxSource } from '../internalTxSources'
6
6
  import type { NodeApi } from '../network/node/types'
7
7
  import type { BlockOperation } from '@ledgerhq/coin-module-framework/api/index'
8
- import { log } from '@ledgerhq/logs'
8
+ import type { Logger } from '@ledgerhq/coin-module-framework/config'
9
9
  import { traceBlockItemsToOperationsByHash } from '../adapters/blockOperations'
10
10
  import { internalTxsToOperationsByHash } from '../adapters/etherscan'
11
11
  import { SourceUnavailableError } from '../errors'
@@ -71,14 +71,15 @@ export function composeInternalTxsFetcher(
71
71
  export function makeSourceFetchers(
72
72
  config: EvmConfigInfo,
73
73
  nodeApi: NodeApi,
74
- currencyId: string
74
+ currencyId: string,
75
+ logger: Logger
75
76
  ): Record<InternalTxSource, SourceFetcher> {
76
77
  const { explorer } = config || {}
77
78
 
78
79
  return {
79
80
  trace_block: (height: number) => {
80
81
  if (nodeApi.traceBlockErigon === undefined) {
81
- log('coin-evm', 'debug: trace_block internal tx source unavailable', {
82
+ logger('coin-evm', 'debug: trace_block internal tx source unavailable', {
82
83
  currencyId,
83
84
  blockHeight: height,
84
85
  })
@@ -86,11 +87,13 @@ export function makeSourceFetchers(
86
87
  new SourceUnavailableError('trace_block is not supported by this RPC provider')
87
88
  )
88
89
  }
89
- return nodeApi.traceBlockErigon(currencyId, height).then(traceBlockItemsToOperationsByHash)
90
+ return nodeApi
91
+ .traceBlockErigon(currencyId, height)
92
+ .then((items) => traceBlockItemsToOperationsByHash(items, logger))
90
93
  },
91
94
  debug_traceBlockByNumber: (height: number) => {
92
95
  if (nodeApi.traceBlockGeth === undefined) {
93
- log('coin-evm', 'debug: debug_traceBlockByNumber internal tx source unavailable', {
96
+ logger('coin-evm', 'debug: debug_traceBlockByNumber internal tx source unavailable', {
94
97
  currencyId,
95
98
  blockHeight: height,
96
99
  })
@@ -100,7 +103,9 @@ export function makeSourceFetchers(
100
103
  )
101
104
  )
102
105
  }
103
- return nodeApi.traceBlockGeth(currencyId, height).then(traceBlockItemsToOperationsByHash)
106
+ return nodeApi
107
+ .traceBlockGeth(currencyId, height)
108
+ .then((items) => traceBlockItemsToOperationsByHash(items, logger))
104
109
  },
105
110
  explorer: (height: number) => {
106
111
  if (!isEtherscanLikeExplorerConfig(explorer)) {
@@ -111,9 +116,9 @@ export function makeSourceFetchers(
111
116
  )
112
117
  }
113
118
  return getInternalTransactionsByBlock(config, height)
114
- .then(internalTxsToOperationsByHash)
119
+ .then((txs) => internalTxsToOperationsByHash(txs, logger))
115
120
  .catch((error) => {
116
- log('coin-evm', 'debug: explorer internal txs failed, falling through', {
121
+ logger('coin-evm', 'debug: explorer internal txs failed, falling through', {
117
122
  currencyId,
118
123
  blockHeight: height,
119
124
  error,
@@ -129,7 +134,8 @@ export function createInternalTransactionsFetcher(
129
134
  config: EvmConfigInfo,
130
135
  nodeApi: NodeApi,
131
136
  currencyId: string,
132
- sources: readonly InternalTxSource[]
137
+ sources: readonly InternalTxSource[],
138
+ logger: Logger
133
139
  ): SourceFetcher {
134
- return composeInternalTxsFetcher(sources, makeSourceFetchers(config, nodeApi, currencyId))
140
+ return composeInternalTxsFetcher(sources, makeSourceFetchers(config, nodeApi, currencyId, logger))
135
141
  }
@@ -70,14 +70,14 @@ export async function listOperations(
70
70
  nextPagingToken,
71
71
  } = await explorerApi.getOperations(
72
72
  config,
73
+ context.logger,
73
74
  currencyId,
74
75
  address,
75
76
  options.minHeight,
76
77
  undefined,
77
78
  options.cursor,
78
79
  options.limit,
79
- explorerOrder,
80
- context.logger
80
+ explorerOrder
81
81
  )
82
82
 
83
83
  const tokenOrNftHashes = new Set(
@@ -427,6 +427,7 @@ describe('getBalance', () => {
427
427
  })
428
428
 
429
429
  expect(discoverTokenAssets).toHaveBeenCalledWith(
430
+ expect.anything(),
430
431
  expect.anything(),
431
432
  'currency',
432
433
  'address',
@@ -445,6 +446,7 @@ describe('getBalance', () => {
445
446
  // A resume without the known set drops every asset whose last transfer predates that
446
447
  // height, and the framework reads a missing asset as a zero balance on a held token.
447
448
  expect(discoverTokenAssets).toHaveBeenCalledWith(
449
+ expect.anything(),
448
450
  expect.anything(),
449
451
  'currency',
450
452
  'address',
@@ -550,9 +552,10 @@ describe('getBalance', () => {
550
552
 
551
553
  const result = await getBalance(context, 'monad', 'address')
552
554
 
553
- // The explorer's `getOperations` now takes the logger as its last argument; the walk this
555
+ // The explorer's `getOperations` takes the logger as its second argument; the walk this
554
556
  // branch reuses passes it like every other caller.
555
557
  expect(getOperations).toHaveBeenCalledWith(
558
+ expect.anything(),
556
559
  expect.anything(),
557
560
  'monad',
558
561
  'address',
@@ -560,8 +563,7 @@ describe('getBalance', () => {
560
563
  undefined,
561
564
  undefined,
562
565
  undefined,
563
- undefined,
564
- expect.anything()
566
+ undefined
565
567
  )
566
568
  expect(discoverTokenAssets).not.toHaveBeenCalled()
567
569
  expect(result).toEqual([
@@ -21,6 +21,7 @@ import {
21
21
  mkExternalNode,
22
22
  mkEtherscanExplorer,
23
23
  mkLedgerExplorer,
24
+ testLogger,
24
25
  } from '../../fixtures/context.fixtures'
25
26
  import { safeEncodeEIP55 } from '../../logic-public'
26
27
  import { getInternalTransactionsByBlock } from '../../network/explorer/etherscan'
@@ -325,7 +326,7 @@ describe('getBlock', () => {
325
326
  hash: '0xtx1',
326
327
  details: {
327
328
  contractInteraction: 'SmartContractInteraction',
328
- contractAddress: safeEncodeEIP55(address2),
329
+ contractAddress: safeEncodeEIP55(address2, testLogger),
329
330
  contractPayload: calldata,
330
331
  },
331
332
  })
@@ -370,7 +371,7 @@ describe('getBlock', () => {
370
371
  hash: '0xdeploy',
371
372
  details: {
372
373
  contractInteraction: 'SmartContractDeployment',
373
- contractAddress: safeEncodeEIP55(address2),
374
+ contractAddress: safeEncodeEIP55(address2, testLogger),
374
375
  contractPayload: initCode,
375
376
  },
376
377
  })
@@ -450,7 +451,7 @@ describe('getBlock', () => {
450
451
  hash: '0xtx1',
451
452
  details: {
452
453
  contractInteraction: 'SmartContractInteraction',
453
- contractAddress: safeEncodeEIP55(address2),
454
+ contractAddress: safeEncodeEIP55(address2, testLogger),
454
455
  contractPayload: calldata,
455
456
  },
456
457
  })
@@ -629,8 +630,8 @@ describe('getBlock', () => {
629
630
 
630
631
  const result = await getBlock(context, '', 12345)
631
632
 
632
- const encodedFrom = safeEncodeEIP55(address1)
633
- const encodedTo = safeEncodeEIP55(address2)
633
+ const encodedFrom = safeEncodeEIP55(address1, testLogger)
634
+ const encodedTo = safeEncodeEIP55(address2, testLogger)
634
635
  expect(result).toMatchObject({
635
636
  info: {
636
637
  height: 12345,
@@ -767,13 +768,13 @@ describe('getBlock', () => {
767
768
  expect(nativeOps).toEqual(
768
769
  expect.arrayContaining([
769
770
  expect.objectContaining({
770
- address: safeEncodeEIP55(address2),
771
- peer: safeEncodeEIP55(nestedRecipient),
771
+ address: safeEncodeEIP55(address2, testLogger),
772
+ peer: safeEncodeEIP55(nestedRecipient, testLogger),
772
773
  amount: -nestedAmount,
773
774
  }),
774
775
  expect.objectContaining({
775
- address: safeEncodeEIP55(nestedRecipient),
776
- peer: safeEncodeEIP55(address2),
776
+ address: safeEncodeEIP55(nestedRecipient, testLogger),
777
+ peer: safeEncodeEIP55(address2, testLogger),
777
778
  amount: nestedAmount,
778
779
  }),
779
780
  ])
@@ -814,8 +815,8 @@ describe('getBlock', () => {
814
815
  expect(mockGetInternalTransactionsByBlock).not.toHaveBeenCalled()
815
816
  expect(mockTraceBlock).toHaveBeenCalledWith(expect.anything(), 12345)
816
817
 
817
- const encodedFrom = safeEncodeEIP55(address1)
818
- const encodedTo = safeEncodeEIP55(address2)
818
+ const encodedFrom = safeEncodeEIP55(address1, testLogger)
819
+ const encodedTo = safeEncodeEIP55(address2, testLogger)
819
820
  expect(result.transactions[0].operations).toEqual(
820
821
  expect.arrayContaining([
821
822
  expect.objectContaining({
@@ -955,8 +956,8 @@ describe('getBlock', () => {
955
956
  const result = await getBlock(context, '', 12345)
956
957
 
957
958
  expect(mockTraceBlock).toHaveBeenCalledWith(expect.anything(), 12345)
958
- const encodedFrom = safeEncodeEIP55(address1)
959
- const encodedTo = safeEncodeEIP55(address2)
959
+ const encodedFrom = safeEncodeEIP55(address1, testLogger)
960
+ const encodedTo = safeEncodeEIP55(address2, testLogger)
960
961
  expect(result).toMatchObject({
961
962
  info: {
962
963
  height: 12345,
@@ -1113,8 +1114,8 @@ describe('getBlock', () => {
1113
1114
 
1114
1115
  expect(mockTraceBlockErigon).toHaveBeenCalledWith(expect.anything(), 12345)
1115
1116
  expect(mockTraceBlockGeth).toHaveBeenCalledWith(expect.anything(), 12345)
1116
- const encodedFrom = safeEncodeEIP55(address1)
1117
- const encodedTo = safeEncodeEIP55(address2)
1117
+ const encodedFrom = safeEncodeEIP55(address1, testLogger)
1118
+ const encodedTo = safeEncodeEIP55(address2, testLogger)
1118
1119
  expect(result.transactions[0].operations).toEqual(
1119
1120
  expect.arrayContaining([
1120
1121
  expect.objectContaining({