Skip to content

Commit

Permalink
chore: update staked token tests
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Sep 14, 2021
1 parent 1ecfcd7 commit cee6790
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions contracts/governance/staking/GamifiedToken.sol
Expand Up @@ -52,6 +52,8 @@ abstract contract GamifiedToken is
/**
* @param _nexus System nexus
* @param _rewardsToken Token that is being distributed as a reward. eg MTA
* @param _questManager Centralised manager of quests
* @param _hasPriceCoeff true if raw staked amount is multiplied by price coeff to get staked amount. eg BPT Staked Token
*/
constructor(
address _nexus,
Expand Down
1 change: 1 addition & 0 deletions contracts/governance/staking/StakedToken.sol
Expand Up @@ -70,6 +70,7 @@ contract StakedToken is GamifiedVotingToken {
* @param _stakedToken Core token that is staked and tracked (e.g. MTA)
* @param _cooldownSeconds Seconds a user must wait after she initiates her cooldown before withdrawal is possible
* @param _unstakeWindow Window in which it is possible to withdraw, following the cooldown period
* @param _hasPriceCoeff true if raw staked amount is multiplied by price coeff to get staked amount. eg BPT Staked Token
*/
constructor(
address _nexus,
Expand Down
9 changes: 4 additions & 5 deletions test/governance/staking/staked-token.spec.ts
Expand Up @@ -1815,18 +1815,17 @@ describe("Staked Token", () => {
// Complete permanent quest
const signature = await signQuestUsers(newSeasonQuestId, [userAddress], sa.questSigner.signer)
await questManager.connect(sa.questSigner.signer).completeQuestUsers(newSeasonQuestId, [userAddress], signature)
const completeQuestTimestamp = await getTimestamp()

const afterData = await snapshotUserStakingData(userAddress)
expect(afterData.rawBalance.raw, "staked raw balance after").to.eq(stakedAmount)
expect(afterData.rawBalance.weightedTimestamp, "weighted timestamp after").to.eq(stakedTimestamp)
// expect(afterData.questBalance.lastAction, "last action after").to.eq(completeQuestTimestamp)
expect(afterData.questBalance.lastAction, "last action after").to.eq(stakedTimestamp)
expect(afterData.questBalance.permMultiplier, "perm multiplier after").to.eq(0)
expect(afterData.questBalance.seasonMultiplier, "season multiplier after").to.eq(50)
expect(afterData.rawBalance.timeMultiplier, "time multiplier after").to.eq(20)
const votesExpected = stakedAmount.mul(100 + 20 + 50).div(100)
// expect(afterData.scaledBalance, "staked balance after").to.eq(votesExpected)
// expect(afterData.votes, "staker votes after").to.eq(votesExpected)
const votesExpected = stakedAmount.mul(120).mul(150).div(10000)
expect(afterData.scaledBalance, "staked balance after").to.eq(votesExpected)
expect(afterData.votes, "staker votes after").to.eq(votesExpected)
})
context("should fail", () => {
let userAddress: string
Expand Down

0 comments on commit cee6790

Please sign in to comment.