diff --git a/deploy/002_deploy_rln_registry.ts b/deploy/002_deploy_rln_registry.ts index 71f266e..89b1694 100644 --- a/deploy/002_deploy_rln_registry.ts +++ b/deploy/002_deploy_rln_registry.ts @@ -16,9 +16,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { log: true, }); - let initializeAbi = ["function initialize(address _poseidonHasher)"]; + let initializeAbi = [ + "function initialize(address _poseidonHasher, uint40 _ttl)", + ]; let iface = new hre.ethers.utils.Interface(initializeAbi); - const data = iface.encodeFunctionData("initialize", [poseidonHasherAddress]); + const data = iface.encodeFunctionData("initialize", [ + poseidonHasherAddress, + 0, + ]); await deploy("WakuRlnRegistry_Proxy", { contract: "ERC1967Proxy", diff --git a/test/WakuRln.t.sol b/test/WakuRln.t.sol index 63feb9c..d062bde 100644 --- a/test/WakuRln.t.sol +++ b/test/WakuRln.t.sol @@ -16,13 +16,14 @@ contract WakuRlnTest is Test { uint256 public constant MEMBERSHIP_DEPOSIT = 1000000000000000; uint256 public constant DEPTH = 20; uint256 public constant SET_SIZE = 1048576; + uint40 public constant TTL = 100; uint256[8] public zeroedProof = [0, 0, 0, 0, 0, 0, 0, 0]; /// @dev Setup the testing environment. function setUp() public { poseidon = new PoseidonHasher(); - wakuRln = new WakuRln(address(poseidon), 0); + wakuRln = new WakuRln(address(poseidon), 0, TTL); } /// @dev Ensure that you can hash a value. diff --git a/test/WakuRlnRegistry.t.sol b/test/WakuRlnRegistry.t.sol index 3b07cab..2833228 100644 --- a/test/WakuRlnRegistry.t.sol +++ b/test/WakuRlnRegistry.t.sol @@ -19,7 +19,7 @@ contract WakuRlnRegistryTest is Test { function setUp() public { poseidonHasher = new PoseidonHasher(); address implementation = address(new WakuRlnRegistry()); - bytes memory data = abi.encodeCall(WakuRlnRegistry.initialize, address(poseidonHasher)); + bytes memory data = abi.encodeCall(WakuRlnRegistry.initialize, (address(poseidonHasher), 0)); address proxy = address(new ERC1967Proxy(implementation, data)); wakuRlnRegistry = WakuRlnRegistry(proxy); } @@ -29,14 +29,14 @@ contract WakuRlnRegistryTest is Test { } function test__RegisterStorage_BadIndex() public { - wakuRlnRegistry.registerStorage(address(new WakuRln(address(poseidonHasher), 0))); - address newStorage = address(new WakuRln(address(poseidonHasher), 0)); + wakuRlnRegistry.registerStorage(address(new WakuRln(address(poseidonHasher), 0, 0))); + address newStorage = address(new WakuRln(address(poseidonHasher), 0, 0)); vm.expectRevert(IncompatibleStorageIndex.selector); wakuRlnRegistry.registerStorage(newStorage); } function test__RegisterStorage_BadImpl() public { - address newStorage = address(new WakuRln(address(new PoseidonHasher()), 0)); + address newStorage = address(new WakuRln(address(new PoseidonHasher()), 0, 0)); vm.expectRevert(IncompatibleStorage.selector); wakuRlnRegistry.registerStorage(newStorage); }