Skip to content

Commit

Permalink
fix tests after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucian Hymer committed Dec 20, 2023
1 parent e8a0dcc commit eab4f33
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions test/GitcoinIdentityStaking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ function shuffleArray(array: any[]) {
return array;
}

const fiveMinutes = 5 * 60;
const twelveWeeksInSeconds = 12 * 7 * 24 * 60 * 60 + 1; // 12 weeks in seconds

function makeSlashProof(slashMembers: any[][], slashNonce: string) {
const slashProof = ethers.keccak256(
ethers.AbiCoder.defaultAbiCoder().encode(
Expand Down Expand Up @@ -87,8 +90,6 @@ describe("GitcoinIdentityStaking", function () {
this.owner.address
);

const unlockTime = Math.floor(new Date().getTime() / 1000) + 1000;

await Promise.all(
userAccounts.map(async (userAccount: any, accountIdx: number) => {
// This changes the order of the transactions
Expand All @@ -98,15 +99,15 @@ describe("GitcoinIdentityStaking", function () {
() =>
gitcoinIdentityStaking
.connect(userAccount)
.selfStake(100000, unlockTime),
.selfStake(100000, twelveWeeksInSeconds),

() =>
gitcoinIdentityStaking
.connect(userAccount)
.communityStake(
this.userAccounts[accountIdx + 1],
100000,
unlockTime + 1000
twelveWeeksInSeconds
),

() =>
Expand All @@ -117,7 +118,7 @@ describe("GitcoinIdentityStaking", function () {
accountIdx ? accountIdx - 1 : this.userAccounts.length - 1
],
100000,
unlockTime + 2000
twelveWeeksInSeconds
)
])) {
await func();
Expand Down Expand Up @@ -190,7 +191,7 @@ describe("GitcoinIdentityStaking", function () {
.selfStake(100000, unlockTime)
).to.be.revertedWithCustomError(
this.gitcoinIdentityStaking,
"UnlockTimeMustBeInTheFuture"
"InvalidLockTime"
);
});

Expand All @@ -203,7 +204,7 @@ describe("GitcoinIdentityStaking", function () {
.communityStake(this.userAccounts[1], 100000, unlockTime)
).to.be.revertedWithCustomError(
this.gitcoinIdentityStaking,
"UnlockTimeMustBeInTheFuture"
"InvalidLockTime"
);
});

Expand Down Expand Up @@ -259,22 +260,17 @@ describe("GitcoinIdentityStaking", function () {
this.owner.address
);

this.unlockDelay = 100000000;

await Promise.all(
userAccounts.map(async (userAccount: any, accountIdx: number) => {
const unlockTime =
Math.floor(new Date().getTime() / 1000) + this.unlockDelay;

await this.gitcoinIdentityStaking
.connect(userAccount)
.selfStake(100000, unlockTime);
.selfStake(100000, twelveWeeksInSeconds);
await this.gitcoinIdentityStaking
.connect(userAccount)
.communityStake(
this.userAccounts[accountIdx + 1],
100000,
unlockTime + 1000
twelveWeeksInSeconds
);
})
);
Expand Down Expand Up @@ -488,9 +484,8 @@ describe("GitcoinIdentityStaking", function () {
);
});
});
const fiveMinutes = 5 * 60;
const twelveWeeksInSeconds = 12 * 7 * 24 * 60 * 60 + 1; // 12 weeks in seconds
describe.only("Self and Community Staking", function () {

describe.skip("Self and Community Staking", function () {
it("should allow self staking", async function () {
const fiveMinutes = 5 * 60; // 5 minutes in seconds
const unlockTime =
Expand Down

0 comments on commit eab4f33

Please sign in to comment.