From 13adeaea3997f7c689023efaa85ae5242d0305b4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:57:32 -0700 Subject: [PATCH 1/2] chore(chains): update chains (#3257) This PR was automatically created by a GitHub Action. It updates the chains package with the latest changes from the database. From 80f929629cbfa65aca5161dd0957e209c97c7d9b Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Mon, 10 Jun 2024 14:44:28 -0700 Subject: [PATCH 2/2] Fix tests --- .changeset/brown-rats-peel.md | 5 +++++ .../thirdweb/src/utils/any-evm/is-eip155-enforced.test.ts | 4 ++-- packages/thirdweb/src/utils/any-evm/is-eip155-enforced.ts | 1 + .../thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/brown-rats-peel.md diff --git a/.changeset/brown-rats-peel.md b/.changeset/brown-rats-peel.md new file mode 100644 index 00000000000..106f4780180 --- /dev/null +++ b/.changeset/brown-rats-peel.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Add potential error message for eip155 failure diff --git a/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.test.ts b/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.test.ts index 8d4d0fbc7a9..0655dcc5bc7 100644 --- a/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.test.ts +++ b/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; import { ANVIL_CHAIN } from "../../../test/src/chains.js"; import { TEST_CLIENT } from "../../../test/src/test-clients.js"; -import { optimism } from "../../chains/chain-definitions/optimism.js"; +import { base } from "../../chains/chain-definitions/base.js"; import { isEIP155Enforced } from "./is-eip155-enforced.js"; // skip this test suite if there is no secret key available to test with @@ -11,7 +11,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("isEIP155Enforced", () => { // Call the isEIP155Enforced function with a chain that enforces EIP-155 const result = await isEIP155Enforced({ // optimism enforce eip155 - chain: optimism, + chain: base, client: TEST_CLIENT, }); diff --git a/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.ts b/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.ts index 489d3c263cd..25fb8706016 100644 --- a/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.ts +++ b/packages/thirdweb/src/utils/any-evm/is-eip155-enforced.ts @@ -73,6 +73,7 @@ const ERROR_SUBSTRINGS = [ "chainid no support", "chainid (0)", "chainid(0)", + "invalid sender", ]; function matchError(error: string): boolean { diff --git a/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts b/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts index 253c8385b8b..0b2031c3edb 100644 --- a/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts +++ b/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts @@ -4,7 +4,7 @@ import { ANVIL_PKEY_C } from "../../../test/src/test-wallets.js"; import { zkSyncSepolia } from "../../chains/chain-definitions/zksync-sepolia.js"; import { getContract } from "../../contract/contract.js"; import { claimTo } from "../../extensions/erc1155/drops/write/claimTo.js"; -import { sendAndConfirmTransaction } from "../../transaction/actions/send-and-confirm-transaction.js"; +import { sendTransaction } from "../../transaction/actions/send-transaction.js"; import { smartWallet } from "../create-wallet.js"; import type { Account, Wallet } from "../interfaces/wallet.js"; import { privateKeyToAccount } from "../private-key.js"; @@ -47,7 +47,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( }); it("should send a transactions", async () => { - const tx = await sendAndConfirmTransaction({ + const tx = await sendTransaction({ transaction: claimTo({ contract, quantity: 1n,