Skip to content

Commit

Permalink
Fixing comments
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Stefanov <[email protected]>
  • Loading branch information
stefan-stefanooov committed Nov 7, 2023
1 parent 32b23c3 commit ecf43c5
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions test/solidity/simple-auction/simple-auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,16 @@ describe('Solidity Simple Auction example', function () {
})

it('should confirm bid not high enough scenario works: BidNotHighEnough', async function () {
try {
const tr = await contract.bid({ value: bidAmountSmall })
const receipt = await tr.wait();
expect(receipt).to.not.be.null
} catch (error) {
hasError = true
expect(error.code).to.be.equal('CALL_EXCEPTION')
}

expect(hasError).to.equal(true)
const tr = await contract.bid({ value: bidAmountSmall })
await expect(tr.wait()).to.eventually.be.rejected.and.have.property('code', 'CALL_EXCEPTION')
})

it('should revert a bid with "AuctionAlreadyEnded" error', async function () {
try {
console.log("Waiting for the next block")
await sleep(5000)
console.log("Done")
const tr = await contractShortLived.bid({ value: bidAmountSmall })
await tr.wait()
} catch (error) {
hasError = true
}

expect(hasError).to.equal(true)
console.log("Waiting for the next block")
await sleep(5000)
console.log("Done")
const tr = await contractShortLived.bid({ value: bidAmountSmall })
await expect(tr.wait()).to.eventually.be.rejected
})

it('should confirm "withdraw" function works', async function () {
Expand Down

0 comments on commit ecf43c5

Please sign in to comment.