Skip to content

Commit

Permalink
Add partially incorrect integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
vrde committed Sep 5, 2023
1 parent b204ae0 commit 543b46a
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion test/Integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ describe("Integration", async () => {
expect(await voting.getVotingPower(user1.address)).equal(share.add(9));
});

it("internal and external token amounts", async () => {
it.only("internal and external token amounts", async () => {
async function check({
internalSupply = 0,
externalSupply = 0,
Expand Down Expand Up @@ -1376,6 +1376,8 @@ describe("Integration", async () => {
);
}

await governanceToken.setSettlementPeriod(3600 * 24 * 7);

await check({});

await _makeContributor(user1, 100);
Expand Down Expand Up @@ -1457,6 +1459,45 @@ describe("Integration", async () => {
reserveExternalBalance: 0, // tokens were burnt
reserveUsdcBalance: INITIAL_USDC - 20,
});

await tokenMock
.connect(user3)
.approve(internalMarket.address, MaxUint256);
await internalMarket.connect(user3).deposit(e(10));
await check({
internalSupply: 95,
externalSupply: 110,
marketInternalBalance: 0,
governanceTokenWrappedBalance: 95,
user1InternalBalance: 60,
user1UsdcBalance: INITIAL_USDC + 5 + 20,
user2InternalBalance: 35,
user2UsdcBalance: INITIAL_USDC - 5,
user3ExternalBalance: 15,
reserveExternalBalance: 0, // tokens were burnt
reserveUsdcBalance: INITIAL_USDC - 20,
});
// Settlement can be called after 7 days
await timeTravel(7, true);
// deposit is finalized
await governanceToken.settleTokens(user3.address);

await check({
// +10
internalSupply: 105,
// -10
externalSupply: 100,
marketInternalBalance: 0,
// -20
governanceTokenWrappedBalance: 95,
user1InternalBalance: 60,
user1UsdcBalance: INITIAL_USDC + 5 + 20,
user2InternalBalance: 35,
user2UsdcBalance: INITIAL_USDC - 5,
user3ExternalBalance: 5,
reserveExternalBalance: 0, // tokens were burnt
reserveUsdcBalance: INITIAL_USDC - 20,
});
});

it("total voting power for a resolution with exclusion doesn't include the voting power of the excluded contributor", async () => {
Expand Down

0 comments on commit 543b46a

Please sign in to comment.