From 8fbb99630c11c667dcf18eefeb6bf50602e842bb Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Thu, 4 Nov 2021 10:23:00 +0100 Subject: [PATCH] Ensure that starting a contract can only be done once --- test/Storage.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/Storage.test.js b/test/Storage.test.js index 5d9bace..8027b88 100644 --- a/test/Storage.test.js +++ b/test/Storage.test.js @@ -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 () {