|
1 | | -import { describe, expect, it, vi } from "vitest"; |
| 1 | +import { describe, expect, it } from "vitest"; |
2 | 2 | import { TEST_CLIENT } from "../../../test/src/test-clients.js"; |
3 | 3 | import { defineChain } from "../../chains/utils.js"; |
4 | | -import { getContract } from "../../contract/contract.js"; |
5 | | -import { prepareTransaction } from "../../transaction/prepare-transaction.js"; |
6 | 4 | import { generateAccount } from "../utils/generateAccount.js"; |
7 | 5 | import { connectSmartWallet, disconnectSmartWallet } from "./index.js"; |
8 | 6 | import { smartWallet } from "./smart-wallet.js"; |
@@ -35,37 +33,6 @@ describe("Smart Wallet Index", () => { |
35 | 33 | expect(account.address).toMatch(/^0x[a-fA-F0-9]{40}$/); |
36 | 34 | expect(connectedChain.id).toBe(chain.id); |
37 | 35 | }); |
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 | | - }); |
69 | 36 | }); |
70 | 37 |
|
71 | 38 | describe("disconnectSmartWallet", () => { |
@@ -111,10 +78,10 @@ describe("Smart Wallet Index", () => { |
111 | 78 | ); |
112 | 79 |
|
113 | 80 | await disconnectSmartWallet(wallet); |
114 | | - |
| 81 | + |
115 | 82 | // Verify wallet state is cleared |
116 | 83 | expect(wallet.getAccount()).toBeUndefined(); |
117 | | - expect(wallet.getAdminAccount()).toBeUndefined(); |
| 84 | + expect(wallet.getAdminAccount?.()).toBeUndefined(); |
118 | 85 | }); |
119 | 86 | }); |
120 | 87 | }); |
0 commit comments