Skip to content

Commit

Permalink
remove 0 check on _initializeLatestProposalId
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Dec 12, 2024
1 parent 7a78f2f commit df16ef1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ abstract contract GovernorSequentialProposalId is Governor {
*/
error GovernorAlreadyInitializedLatestProposalId();

/**
* @dev The {latestProposalId} may only be set to a non-zero value.
*/
error GovernorInvalidLatestProposalId();

/**
* @dev See {IGovernor-getProposalId}.
*/
Expand Down Expand Up @@ -76,9 +71,6 @@ abstract contract GovernorSequentialProposalId is Governor {
if (_latestProposalId != 0) {
revert GovernorAlreadyInitializedLatestProposalId();
}
if (newLatestProposalId == 0) {
revert GovernorInvalidLatestProposalId();
}
_latestProposalId = newLatestProposalId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function deployToken(contractName) {
}
}

describe('GovernorSequentialProposalId', function () {
describe.only('GovernorSequentialProposalId', function () {
for (const { Token, mode } of TOKENS) {
const fixture = async () => {
const [owner, proposer, voter1, voter2, voter3, voter4, userEOA] = await ethers.getSigners();
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('GovernorSequentialProposalId', function () {
}
});

it('can only initialize proposal count from 0', async function () {
it('can only initialize latest proposal id from 0', async function () {
await this.helper.propose();
expect(this.mock.latestProposalId()).to.eventually.equal(1);
await expect(this.mock.$_initializeLatestProposalId(2)).to.be.revertedWithCustomError(
Expand Down

0 comments on commit df16ef1

Please sign in to comment.