7
7
DeclareDeployUDCResponse ,
8
8
Provider ,
9
9
ProviderInterface ,
10
- RpcError ,
11
10
TransactionType ,
12
11
cairo ,
13
12
constants ,
@@ -363,29 +362,6 @@ describe('deploy and test Wallet', () => {
363
362
expect ( balance . low ) . toStrictEqual ( toBigInt ( 990 ) ) ;
364
363
} ) ;
365
364
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
-
389
365
test ( 'execute with custom nonce' , async ( ) => {
390
366
const result = await account . getNonce ( ) ;
391
367
const nonce = toBigInt ( result ) ;
@@ -395,7 +371,6 @@ describe('deploy and test Wallet', () => {
395
371
entrypoint : 'transfer' ,
396
372
calldata : [ account . address , '10' , '0' ] ,
397
373
} ,
398
- undefined ,
399
374
{ nonce }
400
375
) ;
401
376
@@ -433,14 +408,14 @@ describe('deploy and test Wallet', () => {
433
408
const r2 = toBigInt ( r ) + 123n ;
434
409
435
410
const signature2 = new Signature ( toBigInt ( r2 . toString ( ) ) , toBigInt ( s ) ) ;
436
-
437
411
if ( ! signature2 ) return ;
438
412
439
- const verifMessageResponse : boolean = await account . verifyMessage (
413
+ const verifyMessageResponse : boolean = await account . verifyMessageInStarknet (
440
414
typedDataExample ,
441
- signature2
415
+ signature2 ,
416
+ account . address
442
417
) ;
443
- expect ( verifMessageResponse ) . toBe ( false ) ;
418
+ expect ( verifyMessageResponse ) . toBe ( false ) ;
444
419
445
420
const wrongAccount = new Account (
446
421
provider ,
@@ -449,14 +424,17 @@ describe('deploy and test Wallet', () => {
449
424
undefined ,
450
425
TEST_TX_VERSION
451
426
) ; // 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 ( ) ;
453
430
} ) ;
454
431
455
432
test ( 'sign and verify message' , async ( ) => {
456
433
const signature = await account . signMessage ( typedDataExample ) ;
457
- const verifMessageResponse : boolean = await account . verifyMessage (
434
+ const verifMessageResponse : boolean = await account . verifyMessageInStarknet (
458
435
typedDataExample ,
459
- signature
436
+ signature ,
437
+ account . address
460
438
) ;
461
439
expect ( verifMessageResponse ) . toBe ( true ) ;
462
440
} ) ;
0 commit comments