onflow-cadence

How to get transaction fees when testing using flow-js-testing


I have a mint tx that is paid which I am testing, and i expect this to be true:

usersBalanceAfterMinting == usersBalanceBeforeMinting - costOfMinting - txFee

However, when i print out the events from the tx, there is no feesDeducted event, and no info in the tx as to what the cost of the tx was...

How do I output the txFee using flow-js-testing?


Solution

  • You can start emulator with --transaction-fees flag like below:

    await emulator.start(port, { flags: "--transaction-fees", logging: false });
    

    Then you can see FeesDeducted events.