You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first two tests are passing, but when I come to test where the tokens are indeed burned, the state of the ICO seems to change. To burn tokens, the ICO must have ended. So I start by checking the ICO state, and up to that point, the state is ended. When I call await ico.burn() the state seems to change and I get the error below.
What could I be doing wrong?
error
Error: VM Exception while processing transaction: reverted with custom error 'Ico__StateShouldBeEnded()'
describe("burning tokens",()=>{it("checks that the ico is ended before burning",async()=>{consticoState=awaitico.getState()assert.equal(icoState,1)// state [1] = afterEnd on our ICO.sol})it("only allows manager to call",async()=>{consticoInvestor1connected=ico.connect(inverstor1)awaitexpect(icoInvestor1connected.burn()).to.be.rejectedWith("not owner")})it("should burn tokens",async()=>{consticoState=awaitico.getState()assert.equal(icoState,1)// state [1] = afterEnd on our ICO.sol// up to this point the test passes. // it fails from the code below.awaitico.burn()constfounderBal=awaitico.getFounderBalance()assert.equal(founderBal.toString(),"0")})})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm writing tests for the burn func
The first two tests are passing, but when I come to test where the tokens are indeed burned, the state of the ICO seems to change. To burn tokens, the ICO must have ended. So I start by checking the ICO state, and up to that point, the state is ended. When I call
await ico.burn()
the state seems to change and I get the error below.What could I be doing wrong?
error
burn() func
test file
Repo
https://github.com/kihiuFrank/ICO
Beta Was this translation helpful? Give feedback.
All reactions