We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f69c4a commit 7cb13c8Copy full SHA for 7cb13c8
1 file changed
docs/examples/fhe-counter.md
@@ -35,7 +35,7 @@ contract Counter {
35
36
/// @notice Decrements the counter by a specific value
37
function decrement(uint32 value) external {
38
- require(_count > value, "Counter: cannot decrement below zero");
+ require(_count >= value, "Counter: cannot decrement below zero");
39
_count -= value;
40
}
41
@@ -95,7 +95,7 @@ describe("Counter", function () {
95
96
it("decrement the counter by 1", async function () {
97
// First increment, count becomes 1
98
- let tx = await counterContract.connect(signers.alice).increment();
+ let tx = await counterContract.connect(signers.alice).increment(1);
99
await tx.wait();
100
// Then decrement, count goes back to 0
101
tx = await counterContract.connect(signers.alice).decrement(1);
0 commit comments