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 {
|
function forceProgress() external onlyOwner onlyUsableStorage {
|
||||||
|
if (storages[usingStorageIndex + 1] == address(0)) revert NoStorageContractAvailable();
|
||||||
usingStorageIndex += 1;
|
usingStorageIndex += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
||||||
solcInput: extendedArtifact.solcInput,
|
solcInput: extendedArtifact.solcInput,
|
||||||
devdoc: extendedArtifact.devdoc,
|
devdoc: extendedArtifact.devdoc,
|
||||||
};
|
};
|
||||||
console.log(d);
|
|
||||||
deployments.save(`WakuRlnStorage_${indexOfStorageToBeDeployed}`, d);
|
deployments.save(`WakuRlnStorage_${indexOfStorageToBeDeployed}`, d);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,11 @@ contract WakuRlnRegistryTest is Test {
|
||||||
}
|
}
|
||||||
|
|
||||||
function test__forceProgression() public {
|
function test__forceProgression() public {
|
||||||
|
wakuRlnRegistry.newStorage();
|
||||||
wakuRlnRegistry.newStorage();
|
wakuRlnRegistry.newStorage();
|
||||||
wakuRlnRegistry.forceProgress();
|
wakuRlnRegistry.forceProgress();
|
||||||
require(wakuRlnRegistry.usingStorageIndex() == 1);
|
assertEq(wakuRlnRegistry.usingStorageIndex(), 1);
|
||||||
|
assertEq(wakuRlnRegistry.nextStorageIndex(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
function test__SingleRegistration(uint256 commitment) public {
|
function test__SingleRegistration(uint256 commitment) public {
|
||||||
|
@ -105,4 +107,11 @@ contract WakuRlnRegistryTest is Test {
|
||||||
vm.expectRevert(NoStorageContractAvailable.selector);
|
vm.expectRevert(NoStorageContractAvailable.selector);
|
||||||
wakuRlnRegistry.register(commitments);
|
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