Skip to content

Commit

Permalink
fix: Update balance transfer tests to use CHARLETH_ADDRESS in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekkMA committed Jan 6, 2025
1 parent 12631ff commit 794001f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/suites/dev/moonbase/test-balance/test-balance-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "@moonbeam-network/api-augment";
import { beforeEach, describeSuite, expect } from "@moonwall/cli";
import {
ALITH_ADDRESS,
CHARLETH_ADDRESS,
BALTATHAR_ADDRESS,
BALTATHAR_PRIVATE_KEY,
CHARLETH_PRIVATE_KEY,
Expand Down Expand Up @@ -77,16 +78,17 @@ describeSuite({
id: "T03",
title: "should decrease from account",
test: async function () {
const balanceBefore = await context.viem().getBalance({ address: ALITH_ADDRESS });
const balanceBefore = await context.viem().getBalance({ address: CHARLETH_ADDRESS });
const fees = 21000n * GENESIS_BASE_FEE;
await context.createBlock(
await createRawTransfer(context, randomAddress, 512n, {
gas: 21000n,
gasPrice: GENESIS_BASE_FEE,
txnType: "legacy",
privateKey: CHARLETH_PRIVATE_KEY,
})
);
const balanceAfter = await context.viem().getBalance({ address: ALITH_ADDRESS });
const balanceAfter = await context.viem().getBalance({ address: CHARLETH_ADDRESS });
expect(balanceBefore - balanceAfter - fees).toBe(512n);
},
});
Expand Down Expand Up @@ -190,17 +192,18 @@ describeSuite({
id: "T08",
title: "should handle max_fee_per_gas",
test: async function () {
const balanceBefore = await checkBalance(context);
const balanceBefore = await checkBalance(context, CHARLETH_ADDRESS);
await context.createBlock(
await createRawTransfer(context, randomAddress, 1n * GLMR, {
gas: 21000n,
maxFeePerGas: GENESIS_BASE_FEE,
maxPriorityFeePerGas: parseGwei("0.2"),
gasPrice: GENESIS_BASE_FEE,
type: "eip1559",
privateKey: CHARLETH_PRIVATE_KEY,
})
);
const balanceAfter = await checkBalance(context);
const balanceAfter = await checkBalance(context, CHARLETH_ADDRESS);
const fee = 21000n * GENESIS_BASE_FEE;

expect(balanceAfter + fee + 1n * GLMR).toBe(balanceBefore);
Expand Down

0 comments on commit 794001f

Please sign in to comment.