Gives error:
WalletZkApp › send Mina › should able to send Mina
Invalid fee excess.
This means that balance changes in your transaction do not sum up to the amount of fees needed.
Here's the list of balance changes:
Account update #1) -3.00 MINA
Account update #2) 2.00 MINA
Total change: -1.00 MINA
If there are no new accounts created in your transaction, then this sum should be equal to 0.00 MINA.
If you are creating new accounts -- by updating accounts that didn't exist yet --
then keep in mind the 1.00 MINA account creation fee, and make sure that the sum equals
-1.00 times the number of newly created accounts.
Raw list of errors: [[],[["Cancelled"]],[["Invalid_fee_excess"],["Update_not_permitted_access"]]]
describe('send Mina', () => {
it('should able to send Mina', async () => {
await localDeploy();
const amount = 2_000_000_000;
const transactionFee = 100_000_000;
const tx = await Mina.transaction({sender: senderAccount, fee: transactionFee}, () => {
let accountUpdate: AccountUpdate =
AccountUpdate.fundNewAccount(senderAccount);
accountUpdate.send({ to: zkAppAddress, amount: amount });
});
await tx.prove();
await tx.sign([senderKey]).send();
const updatedBalance = Mina.getBalance(zkApp.address);
expect(updatedBalance).toEqual(UInt64.from(1e9 * 2));
});
});