Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
karim-en committed Jul 3, 2024
1 parent eef0f33 commit 3f3f420
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions eth-custodian/test/EthCustodian.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,13 @@ describe('EthCustodian contract', () => {
});

it('Admin receive eth and transfer eth', async () => {
const replenishBalanceValue = 1_500_000;
const replenishBalanceValue = BigInt(1_500_000);

const options = { value: replenishBalanceValue };
await ethCustodian
await expect(ethCustodian
.connect(adminAccount)
.adminReceiveEth(options);
.adminReceiveEth(options))
.not.to.be.reverted;

const recipientBalanceBefore = await ethers.provider.getBalance(user2.address);
const contractBalanceBefore = await ethers.provider.getBalance(await ethCustodian.getAddress());
Expand All @@ -618,17 +619,18 @@ describe('EthCustodian contract', () => {

// Send eth using admin access
const amountToTransfer = BigInt(4000); // wei
await ethCustodian
await expect(ethCustodian
.connect(adminAccount)
.adminSendEth(user2.address, amountToTransfer);
.adminSendEth(user2.address, amountToTransfer))
.not.to.be.reverted;

const recipientBalanceAfter = await ethers.provider.getBalance(user2.address);
const contractBalanceAfter = await ethers.provider.getBalance(await ethCustodian.getAddress());

expect(recipientBalanceAfter)
.to
.be
.equal(recipientBalanceBefore - amountToTransfer);
.equal(recipientBalanceBefore + amountToTransfer);
expect(contractBalanceAfter)
.to
.be
Expand Down

0 comments on commit 3f3f420

Please sign in to comment.