1- import type { Account , Client } from 'viem' ;
1+ import type { Account , PublicClient } from 'viem' ;
22import {
3- createClient ,
3+ createPublicClient ,
44 custom ,
55 hashTypedData ,
66 isAddress ,
@@ -19,7 +19,7 @@ import type { DeleGatorEnvironment, MetaMaskSmartAccount } from '../src/types';
1919import { SIGNABLE_USER_OP_TYPED_DATA } from '../src/userOp' ;
2020
2121describe ( 'MetaMaskSmartAccount' , ( ) => {
22- let client : Client ;
22+ let publicClient : PublicClient ;
2323 let alice : Account ;
2424 let bob : Account ;
2525 let environment : DeleGatorEnvironment ;
@@ -28,7 +28,8 @@ describe('MetaMaskSmartAccount', () => {
2828 const transport = custom ( {
2929 request : async ( ) => '0x' ,
3030 } ) ;
31- client = createClient ( { transport, chain } ) ;
31+ publicClient = createPublicClient ( { transport, chain } ) ;
32+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3233
3334 environment = {
3435 SimpleFactory : randomAddress ( ) ,
@@ -48,7 +49,7 @@ describe('MetaMaskSmartAccount', () => {
4849 // note derivation of the correctness of counterfactual account data is validated in counterfactualAccountData.test.ts
4950 it ( 'creates a MetaMaskSmartAccount for Hybrid implementation' , async ( ) => {
5051 const smartAccount = await toMetaMaskSmartAccount ( {
51- client,
52+ client : publicClient ,
5253 implementation : Implementation . Hybrid ,
5354 deployParams : [ alice . address , [ ] , [ ] , [ ] ] ,
5455 deploySalt : '0x0' ,
@@ -65,7 +66,7 @@ describe('MetaMaskSmartAccount', () => {
6566
6667 it ( 'creates a MetaMaskSmartAccount for MultiSig implementation' , async ( ) => {
6768 const smartAccount = await toMetaMaskSmartAccount ( {
68- client,
69+ client : publicClient ,
6970 implementation : Implementation . MultiSig ,
7071 deployParams : [ [ alice . address , bob . address ] , 2n ] ,
7172 deploySalt : '0x0' ,
@@ -82,7 +83,7 @@ describe('MetaMaskSmartAccount', () => {
8283
8384 it ( 'creates a MetaMaskSmartAccount for Stateless7702 implementation with existing address' , async ( ) => {
8485 const smartAccount = await toMetaMaskSmartAccount ( {
85- client,
86+ client : publicClient ,
8687 implementation : Implementation . Stateless7702 ,
8788 address : alice . address ,
8889 signatory : { account : alice } ,
@@ -102,7 +103,7 @@ describe('MetaMaskSmartAccount', () => {
102103 it ( 'throws error when creating Stateless7702 without address (counterfactual not supported)' , async ( ) => {
103104 await expect (
104105 toMetaMaskSmartAccount ( {
105- client,
106+ client : publicClient ,
106107 implementation : Implementation . Stateless7702 ,
107108 signatory : { account : alice } ,
108109 environment,
@@ -115,7 +116,7 @@ describe('MetaMaskSmartAccount', () => {
115116 it ( 'throws an error for unsupported implementation' , async ( ) => {
116117 await expect (
117118 toMetaMaskSmartAccount ( {
118- client,
119+ client : publicClient ,
119120 implementation : 99 as any as Implementation ,
120121 deployParams : [ alice . address , [ ] , [ ] , [ ] ] ,
121122 deploySalt : '0x0' ,
@@ -128,7 +129,7 @@ describe('MetaMaskSmartAccount', () => {
128129 it ( 'has a default for MetaMaskSmartAccount generic TImplementation parameter' , async ( ) => {
129130 // MetaMaskSmartAccount requires a generic parameter, and defaults to `Implementation` which covers all implementations
130131 const smartAccount : MetaMaskSmartAccount = await toMetaMaskSmartAccount ( {
131- client,
132+ client : publicClient ,
132133 implementation : Implementation . MultiSig ,
133134 deployParams : [ [ alice . address , bob . address ] , 2n ] ,
134135 deploySalt : '0x0' ,
@@ -142,7 +143,7 @@ describe('MetaMaskSmartAccount', () => {
142143 describe ( 'signUserOperation()' , ( ) => {
143144 it ( 'signs a user operation for MultiSig implementation' , async ( ) => {
144145 const smartAccount = await toMetaMaskSmartAccount ( {
145- client,
146+ client : publicClient ,
146147 implementation : Implementation . MultiSig ,
147148 deployParams : [ [ alice . address , bob . address ] , 2n ] ,
148149 deploySalt : '0x0' ,
@@ -188,7 +189,7 @@ describe('MetaMaskSmartAccount', () => {
188189
189190 it ( 'signs a user operation for Hybrid implementation' , async ( ) => {
190191 const smartAccount = await toMetaMaskSmartAccount ( {
191- client,
192+ client : publicClient ,
192193 implementation : Implementation . Hybrid ,
193194 deployParams : [ alice . address , [ ] , [ ] , [ ] ] ,
194195 deploySalt : '0x0' ,
@@ -234,7 +235,7 @@ describe('MetaMaskSmartAccount', () => {
234235
235236 it ( 'signs a user operation for Stateless7702 implementation' , async ( ) => {
236237 const smartAccount = await toMetaMaskSmartAccount ( {
237- client,
238+ client : publicClient ,
238239 implementation : Implementation . Stateless7702 ,
239240 address : alice . address ,
240241 signatory : { account : alice } ,
0 commit comments