fix: remove console.log, forceProgression bug
This commit is contained in:
parent
3402f957dd
commit
44224b1dca
|
@ -81,6 +81,7 @@ contract WakuRlnRegistry is Ownable {
|
|||
}
|
||||
|
||||
function forceProgress() external onlyOwner onlyUsableStorage {
|
||||
if (storages[usingStorageIndex + 1] == address(0)) revert NoStorageContractAvailable();
|
||||
usingStorageIndex += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
|||
solcInput: extendedArtifact.solcInput,
|
||||
devdoc: extendedArtifact.devdoc,
|
||||
};
|
||||
console.log(d);
|
||||
deployments.save(`WakuRlnStorage_${indexOfStorageToBeDeployed}`, d);
|
||||
};
|
||||
|
||||
|
|
|
@ -52,9 +52,11 @@ contract WakuRlnRegistryTest is Test {
|
|||
}
|
||||
|
||||
function test__forceProgression() public {
|
||||
wakuRlnRegistry.newStorage();
|
||||
wakuRlnRegistry.newStorage();
|
||||
wakuRlnRegistry.forceProgress();
|
||||
require(wakuRlnRegistry.usingStorageIndex() == 1);
|
||||
assertEq(wakuRlnRegistry.usingStorageIndex(), 1);
|
||||
assertEq(wakuRlnRegistry.nextStorageIndex(), 2);
|
||||
}
|
||||
|
||||
function test__SingleRegistration(uint256 commitment) public {
|
||||
|
@ -105,4 +107,11 @@ contract WakuRlnRegistryTest is Test {
|
|||
vm.expectRevert(NoStorageContractAvailable.selector);
|
||||
wakuRlnRegistry.register(commitments);
|
||||
}
|
||||
|
||||
function test__forceProgression__NoStorageContract() public {
|
||||
vm.expectRevert(NoStorageContractAvailable.selector);
|
||||
wakuRlnRegistry.forceProgress();
|
||||
assertEq(wakuRlnRegistry.usingStorageIndex(), 0);
|
||||
assertEq(wakuRlnRegistry.nextStorageIndex(), 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue