File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,29 @@ describe("SafeTransactions", () => {
171171 } ) ;
172172 } ) ;
173173 } ) ;
174+
175+ describe ( "constructor" , ( ) => {
176+ it ( "throws error when wallet client has no chain ID" , ( ) => {
177+ chai . Assertion . expectAssertions ( 2 ) ;
178+
179+ const invalidWalletClient = { ...walletClient , chain : undefined } ;
180+
181+ try {
182+ new SafeTransactions (
183+ safeAddress ,
184+ invalidWalletClient as any ,
185+ {
186+ address : contractAddress ,
187+ abi : HypercertMinterAbi ,
188+ } as any ,
189+ ) ;
190+ expect . fail ( "Should throw Error" ) ;
191+ } catch ( e ) {
192+ expect ( e ) . to . be . instanceOf ( Error ) ;
193+ expect ( ( e as Error ) . message ) . to . eq ( "No chain ID found in wallet client" ) ;
194+ }
195+ } ) ;
196+ } ) ;
174197} ) ;
175198
176199function createConnectedSafeStub ( contractAddress : string , mockTxHash : `0x${string } `, mockSignature : `0x${string } `) {
You can’t perform that action at this time.
0 commit comments