11import { beforeAll , describe , expect , it } from "vitest" ;
22import { TEST_CLIENT } from "../../../test/src/test-clients.js" ;
3- import { TEST_ACCOUNT_A } from "../../../test/src/test-wallets.js" ;
4- import { defineChain } from "../../chains/utils.js" ;
3+ import { arbitrumSepolia } from "../../chains/chain-definitions/arbitrum.js" ;
54import { type ThirdwebContract , getContract } from "../../contract/contract.js" ;
65import { balanceOf } from "../../extensions/erc1155/__generated__/IERC1155/read/balanceOf.js" ;
76import { claimTo } from "../../extensions/erc1155/drops/write/claimTo.js" ;
@@ -11,40 +10,38 @@ import { sendTransaction } from "../../transaction/actions/send-transaction.js";
1110import { prepareTransaction } from "../../transaction/prepare-transaction.js" ;
1211import type { Address } from "../../utils/address.js" ;
1312import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js" ;
14- import { setThirdwebDomains } from "../../utils/domains.js" ;
1513import type { Account , Wallet } from "../interfaces/wallet.js" ;
14+ import { generateAccount } from "../utils/generateAccount.js" ;
1615import { smartWallet } from "./smart-wallet.js" ;
17-
1816let wallet : Wallet ;
1917let smartAccount : Account ;
2018let smartWalletAddress : Address ;
2119let personalAccount : Account ;
2220let accountContract : ThirdwebContract ;
2321
24- const chain = defineChain ( 531050104 ) ;
22+ const chain = arbitrumSepolia ;
2523const client = TEST_CLIENT ;
2624const contract = getContract ( {
2725 client,
2826 chain,
2927 address : "0x6A7a26c9a595E6893C255C9dF0b593e77518e0c3" ,
3028} ) ;
31- describe . runIf ( process . env . TW_SECRET_KEY ) . skip . sequential (
29+ describe . runIf ( process . env . TW_SECRET_KEY ) . sequential (
3230 "SmartWallet policy tests" ,
3331 {
3432 retry : 0 ,
3533 timeout : 240_000 ,
3634 } ,
3735 ( ) => {
3836 beforeAll ( async ( ) => {
39- setThirdwebDomains ( {
40- rpc : "rpc.thirdweb-dev.com" ,
41- storage : "storage.thirdweb-dev.com" ,
42- bundler : "bundler.thirdweb-dev.com" ,
43- } ) ;
44- personalAccount = TEST_ACCOUNT_A ;
45- // personalAccount = await generateAccount({
46- // client,
37+ // setThirdwebDomains({
38+ // rpc: "rpc.thirdweb-dev.com",
39+ // storage: "storage.thirdweb-dev.com",
40+ // bundler: "bundler.thirdweb-dev.com",
4741 // });
42+ personalAccount = await generateAccount ( {
43+ client,
44+ } ) ;
4845 wallet = smartWallet ( {
4946 chain,
5047 gasless : true ,
@@ -65,13 +62,15 @@ describe.runIf(process.env.TW_SECRET_KEY).skip.sequential(
6562 expect ( smartWalletAddress ) . toHaveLength ( 42 ) ;
6663 } ) ;
6764
68- it . skip ( "can sign a msg" , async ( ) => {
69- await smartAccount . signMessage ( { message : "hello world" } ) ;
70- const isDeployed = await isContractDeployed ( accountContract ) ;
71- expect ( isDeployed ) . toEqual ( true ) ;
65+ it ( "can sign a msg" , async ( ) => {
66+ const signature = await smartAccount . signMessage ( {
67+ message : "hello world" ,
68+ } ) ;
69+ console . log ( "signature" , signature ) ;
70+ expect ( signature . length ) . toBeGreaterThan ( 0 ) ;
7271 } ) ;
7372
74- it . skip ( "should send a transaction" , async ( ) => {
73+ it ( "should send a transaction" , async ( ) => {
7574 const tx = prepareTransaction ( {
7675 client,
7776 chain,
@@ -106,7 +105,7 @@ describe.runIf(process.env.TW_SECRET_KEY).skip.sequential(
106105 expect ( balance ) . toEqual ( 1n ) ;
107106 } ) ;
108107
109- it ( "should deploy a published autofactory contract" , async ( ) => {
108+ it . skip ( "should deploy a published autofactory contract" , async ( ) => {
110109 const address = await deployPublishedContract ( {
111110 client : TEST_CLIENT ,
112111 chain,
0 commit comments