Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilbe27 committed Apr 29, 2024
1 parent 24f4f87 commit b52f442
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/sdk/utils/math.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,24 @@ describe("computeAPR", () => {
expected: 6.016763389193883,
},
{
name: "NaN",
name: "real - no stake",
in: {
myStake: 0,
totalStaked: 10_000_000,
params,
period: 0,
},
expected: 6.016769405957272,
},
{
name: "infinity",
in: {
myStake: 0,
totalStaked: 0,
params,
period: 0,
},
expected: NaN,
expected: Infinity,
},
]

Expand Down
2 changes: 1 addition & 1 deletion src/sdk/utils/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const calculateEpochMintProvision = (

return polynomialValue.lt(0) ||
params.epochsPerPeriod.eq(0) ||
period.gt(params.maxPeriod.toString()).toString()
period.gt(params.maxPeriod.toString())
? BigNumber(0)
: polynomialValue
}
Expand Down

0 comments on commit b52f442

Please sign in to comment.