From 73158a0bb6be8d77f039bb437805b727c2d51fdd Mon Sep 17 00:00:00 2001 From: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:35:59 +0200 Subject: [PATCH] Update viem, fix gas estimation in viem test Fixes #78, since this was fixed in upstream viem in version 2.9.9 --- e2e_test/js-tests/package-lock.json | 6 +++--- e2e_test/js-tests/test_viem_tx.mjs | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/e2e_test/js-tests/package-lock.json b/e2e_test/js-tests/package-lock.json index ff4a902226..e9d3322a24 100644 --- a/e2e_test/js-tests/package-lock.json +++ b/e2e_test/js-tests/package-lock.json @@ -953,9 +953,9 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/viem": { - "version": "2.9.6", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.9.6.tgz", - "integrity": "sha512-VVFWjGQei2wnWTvAB/xrIf22m6flCwxeBr8LnwejXMTSSi1EORWEswrw2lfKTmw3TlRPSG4uSiQMa/d0l0DKRg==", + "version": "2.9.15", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.9.15.tgz", + "integrity": "sha512-7kcmHqybc3JhpjL8gKY7YxBYpZt1//qhoTZIU5Ez9JdyRCnYMMnJu20s7wd7Gv6a3zPbq8jV8dCp94a/NLJJcA==", "funding": [ { "type": "github", diff --git a/e2e_test/js-tests/test_viem_tx.mjs b/e2e_test/js-tests/test_viem_tx.mjs index 1753466b79..e6f66cb28a 100644 --- a/e2e_test/js-tests/test_viem_tx.mjs +++ b/e2e_test/js-tests/test_viem_tx.mjs @@ -107,6 +107,21 @@ describe("viem send tx", () => { serializedTransaction: signature, }); const receipt = await publicClient.waitForTransactionReceipt({ hash }); + assert.equal(receipt.status, 'success', "receipt status 'failure'") + }).timeout(10_000); + + it("send tx with gas estimation and check receipt", async () => { + const request = await walletClient.prepareTransactionRequest({ + account, + to: "0x00000000000000000000000000000000DeaDBeef", + value: 1, + }); + const signature = await walletClient.signTransaction(request); + const hash = await walletClient.sendRawTransaction({ + serializedTransaction: signature, + }); + const receipt = await publicClient.waitForTransactionReceipt({ hash }); + assert.equal(receipt.status, 'success', "receipt status 'failure'") }).timeout(10_000); it("send fee currency tx and check receipt", async () => { @@ -124,6 +139,7 @@ describe("viem send tx", () => { serializedTransaction: signature, }); const receipt = await publicClient.waitForTransactionReceipt({ hash }); + assert.equal(receipt.status, 'success', "receipt status 'failure'") }).timeout(10_000); it("send overlapping nonce tx in different currencies", async () => {