Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brean0 committed Feb 14, 2024
1 parent 5c7c17f commit 6e61fe0
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 39 deletions.
226 changes: 197 additions & 29 deletions protocol/abi/Beanstalk.json
Original file line number Diff line number Diff line change
Expand Up @@ -5416,6 +5416,30 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOfFinishedGerminatingStalkAndRoots",
"outputs": [
{
"internalType": "uint256",
"name": "gStalk",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "gRoots",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -5459,6 +5483,30 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOfNewAndPartiallyGerminatedStalk",
"outputs": [
{
"internalType": "uint256",
"name": "paritallyGerminatedStalk",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "newlyGerminatedStalk",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -5666,13 +5714,18 @@
{
"inputs": [
{
"internalType": "uint32",
"name": "season",
"type": "uint32"
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "getGerminatingRootsForSeason",
"name": "getEvenGerminating",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
Expand All @@ -5690,8 +5743,13 @@
"type": "uint32"
}
],
"name": "getGerminatingStalkForSeason",
"name": "getGerminatingStalkAndRootsForSeason",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
Expand Down Expand Up @@ -5763,6 +5821,25 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "getLegacySeedsPerToken",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -5799,6 +5876,24 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getNewAndPartiallyGerminatedTotalStalk",
"outputs": [
{
"internalType": "uint256",
"name": "partiallyGerminatedStalk",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "newlyGerminatedStalk",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand All @@ -5807,8 +5902,13 @@
"type": "address"
}
],
"name": "getSeedsPerToken",
"name": "getOddGerminating",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
Expand Down Expand Up @@ -5856,6 +5956,44 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "getTotalGerminatingAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "getTotalGerminatingBdv",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalGerminatingStalk",
Expand Down Expand Up @@ -6166,6 +6304,12 @@
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
Expand Down Expand Up @@ -7025,19 +7169,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTwaLiquidityForWell",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getBeanGaugePointsPerBdv",
Expand Down Expand Up @@ -7147,6 +7278,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGrownStalkIssuedPerGp",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGrownStalkIssuedPerSeason",
Expand Down Expand Up @@ -7239,11 +7383,11 @@
},
{
"inputs": [],
"name": "",
"name": "getTotalBdv",
"outputs": [
{
"internalType": "uint256",
"name": "",
"name": "totalBdv",
"type": "uint256"
}
],
Expand All @@ -7252,11 +7396,11 @@
},
{
"inputs": [],
"name": "getTotalBdv",
"name": "getTotalUsdLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "totalBdv",
"name": "totalLiquidity",
"type": "uint256"
}
],
Expand All @@ -7265,20 +7409,26 @@
},
{
"inputs": [],
"name": "getTotalUsdLiquidity",
"name": "getTotalWeightedUsdLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "",
"name": "totalWeightedLiquidity",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getWeightedTwaLiquidityForWell",
"inputs": [
{
"internalType": "address",
"name": "well",
"type": "address"
}
],
"name": "getTwaLiquidityForWell",
"outputs": [
{
"internalType": "uint256",
Expand All @@ -7290,8 +7440,14 @@
"type": "function"
},
{
"inputs": [],
"name": "getWeightedTotalLiquidity",
"inputs": [
{
"internalType": "address",
"name": "well",
"type": "address"
}
],
"name": "getWeightedTwaLiquidityForWell",
"outputs": [
{
"internalType": "uint256",
Expand Down Expand Up @@ -7631,6 +7787,18 @@
"name": "season",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "well",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ contract SeasonGettersFacet {
/**
* @notice Returns the total twa liquidity of beanstalk.
*/
function getTotalLiquidity() external view returns (uint256 totalLiquidity) {
function getTotalUsdLiquidity() external view returns (uint256 totalLiquidity) {
address[] memory wells = LibWhitelistedTokens.getWhitelistedWellLpTokens();
for (uint i; i < wells.length; i++) {
totalLiquidity = totalLiquidity.add(getTwaLiquidityForWell(wells[i]));
Expand All @@ -298,7 +298,7 @@ contract SeasonGettersFacet {
* @notice returns the total weighted liquidity of beanstalk.
* @dev this is the liquidity
*/
function getTotalWeightedLiquidity() external view returns (uint256 totalWeightedLiquidity) {
function getTotalWeightedUsdLiquidity() external view returns (uint256 totalWeightedLiquidity) {
address[] memory wells = LibWhitelistedTokens.getWhitelistedWellLpTokens();
for (uint i; i < wells.length; i++) {
totalWeightedLiquidity = totalWeightedLiquidity.add(
Expand Down
4 changes: 2 additions & 2 deletions protocol/test/Gauge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('Gauge', function () {
expect(await this.seasonGetters.getTwaLiquidityForWell(BEAN_ETH_WELL)).to.be.equal(to18('1000000'))
expect(await this.seasonGetters.getTotalUsdLiquidity()).to.be.equal(to18('1000000'))
expect(await this.seasonGetters.getWeightedTwaLiquidityForWell(BEAN_ETH_WELL)).to.be.equal(to18('1000000'))
expect(await this.seasonGetters.getWeightedTotalLiquidity()).to.be.equal(to18('1000000'))
expect(await this.seasonGetters.getTotalWeightedUsdLiquidity()).to.be.equal(to18('1000000'))
})

it('inital state', async function () {
Expand Down Expand Up @@ -375,7 +375,7 @@ describe('Gauge', function () {
expect(await this.seasonGetters.getBeanEthGaugePointsPerBdv()).to.be.eq(to18('15.811392351684831136'))
expect(await this.seasonGetters.getBeanGaugePointsPerBdv()).to.be.eq(to18('11.858544263763623352'))
expect(await this.seasonGetters.getGrownStalkIssuedPerSeason()).to.be.eq(to6('489.736611'))
expect(await this.seasonGetters.()).to.be.eq(('224048'))
expect(await this.seasonGetters.getGrownStalkIssuedPerGp()).to.be.eq(('224048'))
expect((await this.siloGetters.tokenSettings(BEAN))[1]).to.be.eq(2656883) // 2.65 seeds per BDV
expect((await this.siloGetters.tokenSettings(BEAN_ETH_WELL))[1]).to.be.eq(3542510) // 3.54 seeds per BDV
expect((await this.siloGetters.tokenSettings(BEAN_3_CURVE))[1]).to.be.eq(1) // 1 seeds
Expand Down
Loading

0 comments on commit 6e61fe0

Please sign in to comment.