Ensure that starting a contract can only be done once

This commit is contained in:
Mark Spanbroek 2021-11-04 10:23:00 +01:00
parent aa673ff71c
commit 8fbb99630c
1 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,11 @@ describe("Storage", function () {
storage.connect(client).startContract(id)
).to.be.revertedWith("Only host can call this function")
})
it("can only be done once", async function () {
await storage.connect(host).startContract(id)
await expect(storage.connect(host).startContract(id)).to.be.reverted
})
})
describe("finishing the contract", function () {