@@ -60,7 +60,7 @@ async function waitForBalance(baseUrl: string, address: string, expected: bigint
6060function computeFeeFromDeltas ( beforeSender : bigint , afterSender : bigint , amount : bigint ) : bigint {
6161 const debited = beforeSender - afterSender ;
6262 const fee = debited - amount ;
63- return fee > 0n ? fee : 0n ;
63+ return fee > BigInt ( 0 ) ? fee : BigInt ( 0 ) ;
6464}
6565
6666async function performTransferAndAssert ( simUrl : string , apiUrl : string , sender : string , receiver : string , amount : bigint ) {
@@ -85,9 +85,9 @@ async function performTransferAndAssert(simUrl: string, apiUrl: string, sender:
8585 const fee = computeFeeFromDeltas ( beforeSender , afterSender , amount ) ;
8686 expect ( afterSender ) . toBe ( beforeSender - amount - fee ) ;
8787 // Sanity-check fee is > 0 and not absurdly large
88- expect ( fee ) . toBeGreaterThan ( 0n ) ;
88+ expect ( fee ) . toBeGreaterThan ( BigInt ( 0 ) ) ;
8989 // Fee should be < 0.1 EGLD in simulator settings
90- expect ( fee ) . toBeLessThan ( 100000000000000000n ) ;
90+ expect ( fee ) . toBeLessThan ( BigInt ( '100000000000000000' ) ) ;
9191
9292 return { fee, afterSender, afterReceiver, hash } ;
9393}
@@ -142,8 +142,8 @@ describe('State changes: native EGLD transfers reflect in balances', () => {
142142 BigInt ( '300000000000000000' ) , // 0.3 EGLD
143143 ] ;
144144
145- let totalSent = 0n ;
146- let totalFees = 0n ;
145+ let totalSent = BigInt ( 0 ) ;
146+ let totalFees = BigInt ( 0 ) ;
147147 for ( const amt of amounts ) {
148148 const { fee } = await performTransferAndAssert ( sim , api , alice , bob , amt ) ;
149149 totalSent += amt ;
@@ -165,15 +165,13 @@ describe('State changes: native EGLD transfers reflect in balances', () => {
165165 const startNonce : number = nonceResp ?. data ?. data ?. nonce ?? 0 ;
166166
167167 const amount = BigInt ( '1000000000000000' ) ; // 0.001 EGLD
168- const hash = await sendTransaction ( new SendTransactionArgs ( {
168+ await sendTransaction ( new SendTransactionArgs ( {
169169 chainSimulatorUrl : sim ,
170170 sender : alice ,
171171 receiver : bob ,
172172 value : amount . toString ( ) ,
173173 dataField : '' ,
174174 } ) ) ;
175- // Ensure simulator included the tx
176- await fetchTxFeeFromSimulator ( sim , hash ) ;
177175
178176 // Nonce should increase by 1
179177 let newNonce = startNonce ;
0 commit comments