Skip to content

Commit

Permalink
Start resolution #25 (#61)
Browse files Browse the repository at this point in the history
First resolution is #25, to keep id progression from before hard fork.
  • Loading branch information
sirnicolaz authored Apr 28, 2023
1 parent 446f3b1 commit fc131be
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion contracts/ResolutionManager/ResolutionManagerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ abstract contract ResolutionManagerBase {
_addResolutionType("routine", 51, 3 days, 2 days, true);
_addResolutionType("genesis", 100, 0 days, 4 days, false);

_currentResolutionId = 1;
_currentResolutionId = 25;
}

modifier onlyPending(uint256 resolutionId) {
Expand Down
2 changes: 1 addition & 1 deletion test/Integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe("Integration", async () => {
describe("integration", async () => {
var currentResolution: number;
beforeEach(async () => {
currentResolution = 0;
currentResolution = 24;
});

async function _mintTokens(user: SignerWithAddress, tokens: number) {
Expand Down
66 changes: 33 additions & 33 deletions test/ResolutionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const DAY = 60 * 60 * 24;
describe("Resolution", async () => {
let snapshotId: string;

let resolutionId = 1;
let resolutionId = 25;
let resolutionSnapshotId = 42;

let managingBoardStatus: string;
Expand Down Expand Up @@ -1440,10 +1440,10 @@ describe("Resolution", async () => {
setupUser(user1, 51);
await setupResolution(100);

await resolution.connect(user1).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);
await mineEVMBlock();

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);
expect(result).true;
});

Expand All @@ -1453,22 +1453,22 @@ describe("Resolution", async () => {

await setupResolution(100);

await resolution.connect(user1).vote(1, true);
await resolution.connect(user2).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);
await resolution.connect(user2).vote(resolutionId, true);
await mineEVMBlock();

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);
expect(result).true;
});

it("should return false when minimum quorum is not achieved - 1 user", async () => {
setupUser(user1, 50);
await setupResolution(100);

await resolution.connect(user1).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);
await mineEVMBlock();

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);
expect(result).false;
});

Expand All @@ -1478,11 +1478,11 @@ describe("Resolution", async () => {

await setupResolution(100);

await resolution.connect(user1).vote(1, true);
await resolution.connect(user2).vote(1, false);
await resolution.connect(user1).vote(resolutionId, true);
await resolution.connect(user2).vote(resolutionId, false);
await mineEVMBlock();

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);

expect(result).false;
});
Expand All @@ -1491,17 +1491,17 @@ describe("Resolution", async () => {
setupUser(user1, 51);
await setupResolution(100, true);

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);
expect(result).true;
});

it("should return false when minimum quorum is not achieved - 1 user, negative resolution", async () => {
setupUser(user1, 51);
await setupResolution(100, true);

await resolution.connect(user1).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);
expect(result).false;
});

Expand All @@ -1510,9 +1510,9 @@ describe("Resolution", async () => {
setupUser(user2, 1);
await setupResolution(100, true);

await resolution.connect(user1).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);
expect(result).true;
});

Expand All @@ -1521,10 +1521,10 @@ describe("Resolution", async () => {
setupUser(user2, 1);
await setupResolution(100, true);

await resolution.connect(user1).vote(1, true);
await resolution.connect(user2).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);
await resolution.connect(user2).vote(resolutionId, true);

const result = await resolution.getResolutionResult(1);
const result = await resolution.getResolutionResult(resolutionId);
expect(result).false;
});
});
Expand Down Expand Up @@ -1557,7 +1557,7 @@ describe("Resolution", async () => {
[dataSimpleFunction(0), dataSimpleFunction(1)]
);

const result = await resolution.getExecutionDetails(1);
const result = await resolution.getExecutionDetails(resolutionId);

expect(result[0][0]).equal(resolutionExecutorMock.address);
expect(result[0][1]).equal(user2.address);
Expand All @@ -1575,7 +1575,7 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await resolution.executeResolution(1);
await resolution.executeResolution(resolutionId);
});

it("should pass the given single parameter to the executor", async () => {
Expand All @@ -1588,7 +1588,7 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp + DAY * 2);
await mineEVMBlock();

await expect(resolution.executeResolution(1))
await expect(resolution.executeResolution(resolutionId))
.to.emit(resolutionExecutorMock, "MockExecutionSimple")
.withArgs(42);
});
Expand All @@ -1603,7 +1603,7 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await expect(resolution.executeResolution(1))
await expect(resolution.executeResolution(resolutionId))
.to.emit(resolutionExecutorMock, "MockExecutionArray")
.withArgs([42, 43]);
});
Expand All @@ -1617,12 +1617,12 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await resolution.connect(user1).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);

await setEVMTimestamp(votingTimestamp + DAY * 2);
await mineEVMBlock();

await expect(resolution.executeResolution(1)).revertedWith(
await expect(resolution.executeResolution(resolutionId)).revertedWith(
"Resolution: nothing to execute"
);
});
Expand All @@ -1643,12 +1643,12 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await resolution.connect(user1).vote(1, true);
await resolution.connect(user1).vote(resolutionId, true);

await setEVMTimestamp(votingTimestamp + DAY * 2);
await mineEVMBlock();

await expect(resolution.executeResolution(1))
await expect(resolution.executeResolution(resolutionId))
.to.emit(resolutionExecutorMock, "MockExecutionSimple")
.withArgs(42)
.to.emit(resolutionExecutorMock, "MockExecutionSimple")
Expand All @@ -1668,7 +1668,7 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await expect(resolution.executeResolution(1)).revertedWith(
await expect(resolution.executeResolution(resolutionId)).revertedWith(
"Resolution: not ended"
);
});
Expand All @@ -1684,7 +1684,7 @@ describe("Resolution", async () => {
[dataSimpleFunction(0)]
);

await expect(resolution.executeResolution(1)).revertedWith(
await expect(resolution.executeResolution(resolutionId)).revertedWith(
"Resolution: not approved"
);
});
Expand All @@ -1703,7 +1703,7 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await expect(resolution.executeResolution(1)).revertedWith(
await expect(resolution.executeResolution(resolutionId)).revertedWith(
"Resolution: not passed"
);
});
Expand All @@ -1718,9 +1718,9 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await resolution.executeResolution(1);
await resolution.executeResolution(resolutionId);

await expect(resolution.executeResolution(1)).revertedWith(
await expect(resolution.executeResolution(resolutionId)).revertedWith(
"Resolution: already executed"
);
});
Expand All @@ -1737,7 +1737,7 @@ describe("Resolution", async () => {
await setEVMTimestamp(votingTimestamp);
await mineEVMBlock();

await expect(resolution.executeResolution(1)).revertedWith(
await expect(resolution.executeResolution(resolutionId)).revertedWith(
"Resolution: execution failed"
);
});
Expand Down
2 changes: 1 addition & 1 deletion test/Upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe("Upgrade", () => {
describe("upgrades", async () => {
var currentResolution: number;
beforeEach(async () => {
currentResolution = 0;
currentResolution = 24;
});

async function _mintTokens(user: SignerWithAddress, tokens: number) {
Expand Down

0 comments on commit fc131be

Please sign in to comment.