diff --git a/src/services/blockchain/__tests__/__snapshots__/eth-bc-service.test.ts.snap b/src/services/blockchain/__tests__/__snapshots__/eth-bc-service.test.ts.snap index 3fcf4b6ab..3aa477851 100644 --- a/src/services/blockchain/__tests__/__snapshots__/eth-bc-service.test.ts.snap +++ b/src/services/blockchain/__tests__/__snapshots__/eth-bc-service.test.ts.snap @@ -23,8 +23,8 @@ exports[`ETH service with mock wallet insufficient funds error 1`] = ` "data": "0x0f017112205d7fcd1a0999befdb062e6762c1f0f902f729b98304a2ef539412f53360d3d6a", "from": "abcd1234", "gasLimit": 10000n, - "maxFeePerGas": 2100n, - "maxPriorityFeePerGas": 1100n, + "maxFeePerGas": 2431n, + "maxPriorityFeePerGas": 1210n, "nonce": 5, "to": "abcd1234", } @@ -35,8 +35,8 @@ exports[`ETH service with mock wallet insufficient funds error 2`] = ` "data": "0x0f017112205d7fcd1a0999befdb062e6762c1f0f902f729b98304a2ef539412f53360d3d6a", "from": "abcd1234", "gasLimit": 10000n, - "maxFeePerGas": 2100n, - "maxPriorityFeePerGas": 1100n, + "maxFeePerGas": 2431n, + "maxPriorityFeePerGas": 1210n, "nonce": 5, "to": "abcd1234", } @@ -74,8 +74,8 @@ exports[`ETH service with mock wallet successful mocked transaction 1`] = ` "data": "0x0f017112205d7fcd1a0999befdb062e6762c1f0f902f729b98304a2ef539412f53360d3d6a", "from": "abcd1234", "gasLimit": 10000n, - "maxFeePerGas": 2000n, - "maxPriorityFeePerGas": 1000n, + "maxFeePerGas": 2310n, + "maxPriorityFeePerGas": 1100n, "nonce": 5, "to": "abcd1234", } @@ -122,7 +122,7 @@ exports[`setGasPrice legacy transaction 1`] = ` "data": "0x0f017112205d7fcd1a0999befdb062e6762c1f0f902f729b98304a2ef539412f53360d3d6a", "from": "abcd1234", "gasLimit": 10n, - "gasPrice": 1000n, + "gasPrice": 1100n, "nonce": undefined, "to": "abcd1234", } @@ -133,7 +133,7 @@ exports[`setGasPrice legacy transaction 2`] = ` "data": "0x0f017112205d7fcd1a0999befdb062e6762c1f0f902f729b98304a2ef539412f53360d3d6a", "from": "abcd1234", "gasLimit": 10n, - "gasPrice": 1100n, + "gasPrice": 1210n, "nonce": undefined, "to": "abcd1234", } @@ -144,7 +144,7 @@ exports[`setGasPrice legacy transaction 3`] = ` "data": "0x0f017112205d7fcd1a0999befdb062e6762c1f0f902f729b98304a2ef539412f53360d3d6a", "from": "abcd1234", "gasLimit": 10n, - "gasPrice": 1210n, + "gasPrice": 1331n, "nonce": undefined, "to": "abcd1234", } diff --git a/src/services/blockchain/__tests__/eth-bc-service.test.ts b/src/services/blockchain/__tests__/eth-bc-service.test.ts index e8cf45500..07eb7892c 100644 --- a/src/services/blockchain/__tests__/eth-bc-service.test.ts +++ b/src/services/blockchain/__tests__/eth-bc-service.test.ts @@ -346,7 +346,7 @@ describe('ETH service with mock wallet', () => { > mockTrySendTransaction .mockRejectedValueOnce({ code: 'TIMEOUT' }) - .mockRejectedValueOnce({ code: 'INSUFFICIENT_FUNDS' }) + .mockRejectedValue({ code: 'INSUFFICIENT_FUNDS' }) const cid = CID.parse('bafyreic5p7grucmzx363ayxgoywb6d4qf5zjxgbqjixpkokbf5jtmdj5ni') await expect(ethBc.sendTransaction(cid)).rejects.toThrow( diff --git a/src/services/blockchain/ethereum/ethereum-blockchain-service.ts b/src/services/blockchain/ethereum/ethereum-blockchain-service.ts index 711556e5c..9cc64eea9 100644 --- a/src/services/blockchain/ethereum/ethereum-blockchain-service.ts +++ b/src/services/blockchain/ethereum/ethereum-blockchain-service.ts @@ -53,20 +53,16 @@ async function attempt( ): Promise { let attempt = 0 while (attempt < max) { - try { - const result = await operation(attempt) - if (result) { - return result - } - } catch (e: any) { - logger.debug(e) + const result = await operation(attempt) + if (result) { + return result } attempt++ logger.warn(`Failed to send transaction; ${max - attempt} retries remain`) await Utils.delay(5000) } // All attempts spent - throw new Error('Failed to send transaction') + throw new Error("Failed to send transaction") } /**