Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Jul 30, 2024
1 parent 258ac8e commit e3b36ad
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/ForkTestSimulateUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ describe("ForkTestSimulateUpgrade", function () {
expect(await governorBravoDelegator.timelock()).to.equal(
"0x6d903f6003cca6255D85CcA4D3B5E5146dC33925"
);
expect(await governorBravoDelegator.whitelistGuardian()).to.equal(
"0xbbf3f1421D886E9b2c5D716B5192aC998af2012c"
);
});

it("Grant COMP proposal", async function () {
Expand Down Expand Up @@ -176,4 +179,35 @@ describe("ForkTestSimulateUpgrade", function () {
.to.emit(governorBravoDelegator, "VoteCast")
.withArgs(signer.address, proposalId, 1, BigInt("1000"), "Great Idea!");
});

it("Set proposal guardian", async function () {
const { governorBravoDelegator, proposingSigner } = await loadFixture(
deployFixtures
);
const [signer] = await ethers.getSigners();
const setProposalGuardianSelector = ethers
.id("_setProposalGuardian(address)")
.substring(0, 10);
const setProposalGuardianData =
setProposalGuardianSelector +
ethers.AbiCoder.defaultAbiCoder()
.encode(["address"], [signer.address])
.slice(2);

expect(await governorBravoDelegator.proposalGuardian()).to.equal(
ethers.ZeroAddress
);

await proposeAndExecute(
governorBravoDelegator.connect(proposingSigner),
[await governorBravoDelegator.getAddress()],
[0],
[setProposalGuardianData],
"Set Proposal Guardian"
);

expect(await governorBravoDelegator.proposalGuardian()).to.equal(
signer.address
);
});
});

0 comments on commit e3b36ad

Please sign in to comment.