Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

withdraw can't pass the test #4

Open
Bouqute opened this issue Mar 1, 2023 · 0 comments
Open

withdraw can't pass the test #4

Bouqute opened this issue Mar 1, 2023 · 0 comments

Comments

@Bouqute
Copy link

Bouqute commented Mar 1, 2023

the withdraw can't pass the test,

My code like this

describe("Withdrawing",()=>{
let balanceBefore;

beforeEach(async()=>{
  // list a item
  transaction = await dappazon.connect(deployer).list(
    ID,
    NAME,
    CATEGORY,
    IMAGE,
    COST,
    RATING,
    STOCK
  )
  await transaction.wait()

  // buy an item
  transaction = await dappazon.connect(buyer).buy(ID,{value:COST})
  await transaction.wait()

  // get deployer balance  before
  balanceBefore = await ethers.provider.getBalance(deployer.address);

  // withdraw
  transaction = await dappazon.connect(deployer).withdraw();
  await transaction.wait()  

})



it("Update the owner balance", async()=>{
  const balanceAfter = await ethers.provider.getBalance(buyer.address);
  expect(balanceAfter).to.be.greaterThan(balanceBefore)
})


it("Update the contract balance", async()=>{
  const result = await ethers.provider.getBalance(deployer.address);
  expect(result).to.equal(0)
})

})

i get the err, the err message like

AssertionError: expected 9994998096167587283777 to be above 9999982111701002581047. The numerical values of the given "ethers.BigNumber" and "ethers.BigNumber" inputs were compared, and they differed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant