-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels