Skip to content

Commit a834199

Browse files
[SDK] test: Refactor smart wallet signature verification tests (#5962)
1 parent be7759d commit a834199

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

packages/thirdweb/src/auth/verify-signature.test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import * as ox__Bytes from "ox/Bytes";
2-
import { describe, expect, it, test } from "vitest";
2+
import { beforeAll, describe, expect, it, test } from "vitest";
33
import { FORKED_ETHEREUM_CHAIN } from "../../test/src/chains.js";
44
import { TEST_CLIENT } from "../../test/src/test-clients.js";
55
import { TEST_ACCOUNT_A } from "../../test/src/test-wallets.js";
66
import { ethereum, mainnet } from "../chains/chain-definitions/ethereum.js";
77
import { sepolia } from "../chains/chain-definitions/sepolia.js";
8+
import type { Account } from "../wallets/interfaces/wallet.js";
89
import { smartWallet } from "../wallets/smart/smart-wallet.js";
910
import {
1011
verifyContractWalletSignature,
@@ -64,7 +65,7 @@ describe("verifyEOASignature", () => {
6465

6566
describe.runIf(process.env.TW_SECRET_KEY)(
6667
"verifyContractWalletSignature",
67-
async () => {
68+
() => {
6869
it("should verify a valid signature", async () => {
6970
expect(
7071
await verifySignature({
@@ -107,15 +108,19 @@ describe.runIf(process.env.TW_SECRET_KEY)(
107108

108109
describe.runIf(process.env.TW_SECRET_KEY)(
109110
"verifyContractWalletSignature",
110-
async () => {
111+
() => {
111112
const message = "Hakuna matata";
112113
const wallet = smartWallet({
113114
chain: ethereum,
114115
gasless: true,
115116
});
116-
const smartAccount = await wallet.connect({
117-
client: TEST_CLIENT,
118-
personalAccount: TEST_ACCOUNT_A,
117+
let smartAccount: Account;
118+
119+
beforeAll(async () => {
120+
smartAccount = await wallet.connect({
121+
client: TEST_CLIENT,
122+
personalAccount: TEST_ACCOUNT_A,
123+
});
119124
});
120125

121126
test("should verify a smart account signature", async () => {

0 commit comments

Comments
 (0)