Chapter 4: Testing your Walnut contract
Getting Started
packages/contracts/test/Walnut.t.sol// SPDX-License-Identifier: MIT License
pragma solidity ^0.8.13;
import {Test, console} from "forge-std/Test.sol";
import {Walnut} from "../src/Walnut.sol";
contract WalnutTest is Test {
Walnut public walnut;
function setUp() public {
// Initialize a Walnut with shell strength = 2 and kernel = 0
walnut = new Walnut(2, suint256(0));
}
}Writing Test Cases
Core functionalities
Restricting Actions
Complex scenarios
PreviousChapter 3: Reset Mechanism, Rounds, and a more conditional Kernel RevealNextDeploying your contract
Last updated

