@@ -347,20 +347,9 @@ describe('@discrepancies - Nonce Test Suite', async () => {
347
347
const snBefore = await getServicesNonce ( signers [ 0 ] . address ) ;
348
348
const mnBefore = await getMirrorNodeNonce ( signers [ 0 ] . address ) ;
349
349
350
- try {
351
- const tx = await erc20Contract
352
- . connect ( signers [ 0 ] )
353
- . transfer (
354
- tokenAddress ,
355
- signers [ 1 ] . address ,
356
- amount ,
357
- Constants . GAS_LIMIT_1_000_000
358
- ) ;
359
- await tx . wait ( ) ;
360
- } catch ( e ) {
361
- expect ( e ) . to . exist ;
362
- expect ( e . code ) . to . eq ( Constants . CALL_EXCEPTION ) ;
363
- }
350
+ await Utils . expectToFail (
351
+ erc20Contract . transfer ( tokenAddress , signers [ 1 ] . address , amount , Constants . GAS_LIMIT_1_000_000 )
352
+ ) ;
364
353
365
354
const snAfter = await getServicesNonce ( signers [ 0 ] . address ) ;
366
355
const mnAfter = await getMirrorNodeNonce ( signers [ 0 ] . address ) ;
@@ -439,7 +428,7 @@ describe('@discrepancies - Nonce Test Suite', async () => {
439
428
expectIncrementedNonce ( snBefore , mnBefore , snAfter , mnAfter ) ;
440
429
} ) ;
441
430
442
- it ( 'should not update nonces when deploying on an address with an already existing account ' , async function ( ) {
431
+ it ( 'should reset nonce when an account has been deleted and created again ' , async function ( ) {
443
432
// create a hollow account
444
433
const wallet = await createNewAccountWithBalance ( ethers . parseEther ( '3.1' ) ) ;
445
434
const snAfterCreate = await getServicesNonce ( wallet . address ) ;
@@ -477,7 +466,7 @@ describe('@discrepancies - Nonce Test Suite', async () => {
477
466
expectNonIncrementedNonce ( snAfterNewCreate , mnAfterNewCreate , 0 , 0 ) ;
478
467
} ) ;
479
468
480
- it ( 'Nonce should NOT be incremented upon static call' , async function ( ) {
469
+ it ( 'should not increment nonce upon static call' , async function ( ) {
481
470
const snBeforeTransfer = await getServicesNonce ( signers [ 0 ] . address ) ;
482
471
const mnBeforeTransfer = await getMirrorNodeNonce ( signers [ 0 ] . address ) ;
483
472
const tx = await internalCallerContract . staticCallExternalFunction . staticCall ( signers [ 1 ] . address )
@@ -488,8 +477,7 @@ describe('@discrepancies - Nonce Test Suite', async () => {
488
477
expectNonIncrementedNonce ( snBeforeTransfer , mnBeforeTransfer , snAfterTransfer , mnAfterTransfer )
489
478
} ) ;
490
479
491
- it ( 'Nonce should NOT be incremented upon unsuccessfull sent with Direct call - not enough balance' , async function ( ) {
492
- const initialValue = 100000 * Utils . tinybarToWeibarCoef
480
+ it ( 'should not increment nonce upon unsuccessful sent with direct call - not enough balance' , async function ( ) {
493
481
const initialWalletBalance = Utils . tinybarToWeibarCoef ;
494
482
495
483
const newWallet = await createNewAccountWithBalance ( initialWalletBalance ) ;
@@ -511,7 +499,7 @@ describe('@discrepancies - Nonce Test Suite', async () => {
511
499
expectNonIncrementedNonce ( snWallet1Before , mnWallet1Before , snWallet1After , mnWallet1After )
512
500
} ) ;
513
501
514
- it ( 'should update signer nonce upon transfer to non-existing account with enough gas limit >600K ' , async function ( ) {
502
+ it ( 'should update nonce upon transfer to non-existing account with enough gas limit > 600k (hollow account creation) ' , async function ( ) {
515
503
const snBeforeTransfer = await getServicesNonce ( signers [ 0 ] . address ) ;
516
504
const mnBeforeTransfer = await getMirrorNodeNonce ( signers [ 0 ] . address ) ;
517
505
@@ -529,7 +517,7 @@ describe('@discrepancies - Nonce Test Suite', async () => {
529
517
expectIncrementedNonce ( snBeforeTransfer , mnBeforeTransfer , snAfterCreate , mnAfterCreate ) ;
530
518
} ) ;
531
519
532
- it ( 'should not update nonce upon unsuccessfull transaction due to wrong chain id' , async function ( ) {
520
+ it ( 'should not update nonce upon unsuccessful transaction due to wrong chain id' , async function ( ) {
533
521
const wallet1 = ethers . Wallet . createRandom ( ) ;
534
522
const snBeforeTransfer = await getServicesNonce ( signers [ 0 ] . address ) ;
535
523
const mnBeforeTransfer = await getMirrorNodeNonce ( signers [ 0 ] . address ) ;
@@ -630,7 +618,7 @@ describe('@discrepancies - Nonce Test Suite', async () => {
630
618
expectIncrementedNonce ( snBeforeTransfer , mnBeforeTransfer , snAfterCreate , mnAfterCreate ) ;
631
619
} ) ;
632
620
633
- it ( 'hollow account that is finalized with the same transaction that should upgrade its nonce ' , async function ( ) {
621
+ it ( 'should update nonce on hollow account finalization ' , async function ( ) {
634
622
const wallet = await createNewAccountWithBalance ( ethers . parseEther ( '10' ) ) ;
635
623
const wallet2 = ethers . Wallet . createRandom ( ) . connect ( ethers . provider ) ;
636
624
@@ -656,7 +644,7 @@ describe('@discrepancies - Nonce Test Suite', async () => {
656
644
expectIncrementedNonce ( snBeforeTransfer , mnBeforeTransfer , snAfterCreate , mnAfterCreate ) ;
657
645
} ) ;
658
646
659
- it ( 'hollow account that is finilized with the same transaction that should not upgrade its nonce when offered gas price and and allowance fail check ' , async function ( ) {
647
+ it ( 'should not update nonce on hollow account finalization due to reversion when offered gas price and allowance fail check' , async function ( ) {
660
648
const wallet = await createNewAccountWithBalance ( ethers . parseEther ( '10' ) ) ;
661
649
662
650
let infoBefore = await Utils . getAccountInfo ( wallet . address , sdkClient ) ;
0 commit comments