Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: relax param req #326

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions contracts/child/NetworkParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ contract NetworkParams is Ownable2Step, Initializable {
initParams.newWithdrawalWaitPeriod != 0 &&
initParams.newBlockTime != 0 &&
initParams.newBlockTimeDrift != 0 &&
initParams.newVotingDelay != 0 &&
initParams.newVotingPeriod != 0 &&
initParams.newProposalThreshold != 0,
initParams.newVotingPeriod != 0,
"NetworkParams: INVALID_INPUT"
);
checkpointBlockInterval = initParams.newCheckpointBlockInterval;
Expand Down Expand Up @@ -206,7 +204,6 @@ contract NetworkParams is Ownable2Step, Initializable {
* @param newVotingDelay new voting delay
*/
function setNewVotingDelay(uint256 newVotingDelay) external onlyOwner {
require(newVotingDelay != 0, "NetworkParams: INVALID_VOTING_DELAY");
votingDelay = newVotingDelay;

emit NewVotingDelay(newVotingDelay);
Expand All @@ -230,7 +227,6 @@ contract NetworkParams is Ownable2Step, Initializable {
* @param newProposalThreshold new proposal threshold
*/
function setNewProposalThreshold(uint256 newProposalThreshold) external onlyOwner {
require(newProposalThreshold != 0, "NetworkParams: INVALID_PROPOSAL_THRESHOLD");
proposalThreshold = newProposalThreshold;

emit NewProposalThreshold(newProposalThreshold);
Expand Down
10 changes: 0 additions & 10 deletions test/child/NetworkParams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ describe("NetworkParams", () => {
await stopImpersonatingAccount(accounts[1].address);
});

it("set new voting delay fail: invalid input", async () => {
await expect(networkParams.setNewVotingDelay(0)).to.be.revertedWith("NetworkParams: INVALID_VOTING_DELAY");
});

it("set new voting delay success", async () => {
initParams.newVotingDelay = 10 ** Math.floor(Math.random() + 6);
await networkParams.setNewVotingDelay(initParams.newVotingDelay);
Expand Down Expand Up @@ -311,12 +307,6 @@ describe("NetworkParams", () => {
await stopImpersonatingAccount(accounts[1].address);
});

it("set new proposal threshold fail: invalid input", async () => {
await expect(networkParams.setNewProposalThreshold(0)).to.be.revertedWith(
"NetworkParams: INVALID_PROPOSAL_THRESHOLD"
);
});

it("set new proposal threshold success", async () => {
initParams.newProposalThreshold = 10 ** Math.floor(Math.random() + 6);
await networkParams.setNewProposalThreshold(initParams.newProposalThreshold);
Expand Down
Loading