77 DeclareDeployUDCResponse ,
88 Provider ,
99 ProviderInterface ,
10- RpcError ,
1110 TransactionType ,
1211 cairo ,
1312 constants ,
@@ -363,29 +362,6 @@ describe('deploy and test Wallet', () => {
363362 expect ( balance . low ) . toStrictEqual ( toBigInt ( 990 ) ) ;
364363 } ) ;
365364
366- test ( 'execute with and without deprecated abis parameter' , async ( ) => {
367- const transaction = {
368- contractAddress : erc20Address ,
369- entrypoint : 'transfer' ,
370- calldata : [ erc20 . address , '10' , '0' ] ,
371- } ;
372- const details : Parameters < ( typeof account ) [ 'execute' ] > [ 2 ] = { nonce : 0 } ;
373-
374- let error1 : RpcError | undefined ;
375- // eslint-disable-next-line no-return-assign
376- await account . execute ( transaction , details ) . catch ( ( e ) => ( error1 = e ) ) ;
377- expect ( error1 ) . toBeDefined ( ) ;
378- expect ( error1 ) . toBeInstanceOf ( RpcError ) ;
379- expect ( error1 ! . isType ( 'TRANSACTION_EXECUTION_ERROR' ) ) . toBe ( true ) ;
380-
381- let error2 : RpcError | undefined ;
382- // eslint-disable-next-line no-return-assign
383- await account . execute ( transaction , undefined , details ) . catch ( ( e ) => ( error2 = e ) ) ;
384- expect ( error2 ) . toBeDefined ( ) ;
385- expect ( error2 ) . toBeInstanceOf ( RpcError ) ;
386- expect ( error2 ! . isType ( 'TRANSACTION_EXECUTION_ERROR' ) ) . toBe ( true ) ;
387- } ) ;
388-
389365 test ( 'execute with custom nonce' , async ( ) => {
390366 const result = await account . getNonce ( ) ;
391367 const nonce = toBigInt ( result ) ;
@@ -395,7 +371,6 @@ describe('deploy and test Wallet', () => {
395371 entrypoint : 'transfer' ,
396372 calldata : [ account . address , '10' , '0' ] ,
397373 } ,
398- undefined ,
399374 { nonce }
400375 ) ;
401376
@@ -433,14 +408,14 @@ describe('deploy and test Wallet', () => {
433408 const r2 = toBigInt ( r ) + 123n ;
434409
435410 const signature2 = new Signature ( toBigInt ( r2 . toString ( ) ) , toBigInt ( s ) ) ;
436-
437411 if ( ! signature2 ) return ;
438412
439- const verifMessageResponse : boolean = await account . verifyMessage (
413+ const verifyMessageResponse : boolean = await account . verifyMessageInStarknet (
440414 typedDataExample ,
441- signature2
415+ signature2 ,
416+ account . address
442417 ) ;
443- expect ( verifMessageResponse ) . toBe ( false ) ;
418+ expect ( verifyMessageResponse ) . toBe ( false ) ;
444419
445420 const wrongAccount = new Account (
446421 provider ,
@@ -449,14 +424,17 @@ describe('deploy and test Wallet', () => {
449424 undefined ,
450425 TEST_TX_VERSION
451426 ) ; // non existing account
452- await expect ( wrongAccount . verifyMessage ( typedDataExample , signature2 ) ) . rejects . toThrow ( ) ;
427+ await expect (
428+ wrongAccount . verifyMessageInStarknet ( typedDataExample , signature2 , wrongAccount . address )
429+ ) . rejects . toThrow ( ) ;
453430 } ) ;
454431
455432 test ( 'sign and verify message' , async ( ) => {
456433 const signature = await account . signMessage ( typedDataExample ) ;
457- const verifMessageResponse : boolean = await account . verifyMessage (
434+ const verifMessageResponse : boolean = await account . verifyMessageInStarknet (
458435 typedDataExample ,
459- signature
436+ signature ,
437+ account . address
460438 ) ;
461439 expect ( verifMessageResponse ) . toBe ( true ) ;
462440 } ) ;
0 commit comments