Skip to content

Commit daa4fbc

Browse files
committed
test(sdk): simple smart account tests
1 parent 95541cf commit daa4fbc

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

packages/thirdweb/src/wallets/smart/smart.test.ts

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, expect, it, vi } from "vitest";
1+
import { describe, expect, it } from "vitest";
22
import { TEST_CLIENT } from "../../../test/src/test-clients.js";
33
import { defineChain } from "../../chains/utils.js";
4-
import { getContract } from "../../contract/contract.js";
5-
import { prepareTransaction } from "../../transaction/prepare-transaction.js";
64
import { generateAccount } from "../utils/generateAccount.js";
75
import { connectSmartWallet, disconnectSmartWallet } from "./index.js";
86
import { smartWallet } from "./smart-wallet.js";
@@ -35,37 +33,6 @@ describe("Smart Wallet Index", () => {
3533
expect(account.address).toMatch(/^0x[a-fA-F0-9]{40}$/);
3634
expect(connectedChain.id).toBe(chain.id);
3735
});
38-
39-
it("should handle transaction requests", async () => {
40-
const personalAccount = await generateAccount({ client });
41-
const wallet = smartWallet({
42-
chain,
43-
gasless: true,
44-
});
45-
46-
const [account] = await connectSmartWallet(
47-
wallet,
48-
{
49-
client,
50-
personalAccount,
51-
},
52-
{
53-
chain,
54-
gasless: true,
55-
},
56-
);
57-
58-
const tx = prepareTransaction({
59-
chain,
60-
client,
61-
to: "0x0000000000000000000000000000000000000000",
62-
value: 0n,
63-
});
64-
65-
const result = await account.sendTransaction(tx);
66-
expect(result.transactionHash).toBeDefined();
67-
expect(result.transactionHash).toMatch(/^0x[a-fA-F0-9]{64}$/);
68-
});
6936
});
7037

7138
describe("disconnectSmartWallet", () => {
@@ -111,10 +78,10 @@ describe("Smart Wallet Index", () => {
11178
);
11279

11380
await disconnectSmartWallet(wallet);
114-
81+
11582
// Verify wallet state is cleared
11683
expect(wallet.getAccount()).toBeUndefined();
117-
expect(wallet.getAdminAccount()).toBeUndefined();
84+
expect(wallet.getAdminAccount?.()).toBeUndefined();
11885
});
11986
});
12087
});

0 commit comments

Comments
 (0)