Skip to content

Commit

Permalink
Merge branch 'subgraph-basin1.2.3' into feat/sk/subgraphs-wsteth
Browse files Browse the repository at this point in the history
  • Loading branch information
soilking committed Jul 23, 2024
2 parents f354830 + 38a68fd commit 2b01db5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 149 deletions.
48 changes: 27 additions & 21 deletions projects/subgraph-basin/tests/helpers/Functions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BigDecimal, BigInt, ethereum } from "@graphprotocol/graph-ts";
import { createMockedFunction } from "matchstick-as/assembly/index";
import { BEAN_3CRV, BEAN_ERC20, BEAN_WETH_CP2_WELL, CRV3_TOKEN, WETH } from "../../../subgraph-core/utils/Constants";
import { BEAN_3CRV, BEAN_ERC20, BEAN_WETH_CP2_WELL, BEANSTALK_PRICE_1, CRV3_TOKEN, WETH } from "../../../subgraph-core/utils/Constants";
import { BEAN_USD_PRICE, WELL } from "./Constants";
import { setMockCurvePrice, setMockWellPrice } from "../../../subgraph-core/tests/event-mocking/Price";
import { setMockBeanPrice } from "../../../subgraph-core/tests/event-mocking/Price";
import { ONE_BD, ZERO_BD } from "../../../subgraph-core/utils/Decimals";

let prevMocked = ZERO_BD;
Expand All @@ -15,26 +15,32 @@ export function createContractCallMocks(priceMultiple: BigDecimal = ONE_BD): voi

const price = BigInt.fromString(new BigDecimal(BEAN_USD_PRICE).times(priceMultiple).truncate(0).toString());

setMockCurvePrice({
contract: BEAN_3CRV,
tokens: [BEAN_ERC20, CRV3_TOKEN],
balances: [BigInt.fromString("14306013160240"), BigInt.fromString("12306817594155799426763734")],
setMockBeanPrice({
price: price,
liquidity: BigInt.fromString("26025239751318"),
deltaB: BigInt.fromString("-866349934591"),
lpUsd: BigInt.fromString("969328"),
lpBdv: BigInt.fromString("1032515")
});

setMockWellPrice({
contract: BEAN_WETH_CP2_WELL,
tokens: [BEAN_ERC20, WETH],
balances: [BigInt.fromString("2000000000"), BigInt.fromString("1500000000000000000")],
price: price,
liquidity: BigInt.fromString("26025239751318"),
deltaB: BigInt.fromString("-866349934591"),
lpUsd: BigInt.fromString("969328"),
lpBdv: BigInt.fromString("1032515")
liquidity: BigInt.fromString("26025239751318").times(BigInt.fromU32(2)),
deltaB: BigInt.fromString("-866349934591").times(BigInt.fromU32(2)),
ps: [
{
contract: BEAN_3CRV,
tokens: [BEAN_ERC20, CRV3_TOKEN],
balances: [BigInt.fromString("14306013160240"), BigInt.fromString("12306817594155799426763734")],
price: price,
liquidity: BigInt.fromString("26025239751318"),
deltaB: BigInt.fromString("-866349934591"),
lpUsd: BigInt.fromString("969328"),
lpBdv: BigInt.fromString("1032515")
},
{
contract: BEAN_WETH_CP2_WELL,
tokens: [BEAN_ERC20, WETH],
balances: [BigInt.fromString("2000000000"), BigInt.fromString("1500000000000000000")],
price: price,
liquidity: BigInt.fromString("26025239751318"),
deltaB: BigInt.fromString("-866349934591"),
lpUsd: BigInt.fromString("969328"),
lpBdv: BigInt.fromString("1032515")
}
]
});

createMockedFunction(BEAN_ERC20, "name", "name():(string)")
Expand Down
2 changes: 1 addition & 1 deletion projects/subgraph-beanstalk/tests/SeedGauge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from "./event-mocking/SeedGauge";
import { createWhitelistTokenV4Event } from "./event-mocking/Whitelist";
import { createTemperatureChangeEvent } from "./event-mocking/Field";
import { simpleMockPrice } from "../../subgraph-core/tests/event-mocking/Prices";
import { simpleMockPrice } from "../../subgraph-core/tests/event-mocking/Price";
import { loadSilo } from "../src/utils/SiloEntities";
import { mockBlock } from "../../subgraph-core/tests/event-mocking/Block";
import { dayFromTimestamp } from "../src/utils/Dates";
Expand Down
127 changes: 0 additions & 127 deletions projects/subgraph-core/tests/event-mocking/Prices.ts

This file was deleted.

0 comments on commit 2b01db5

Please sign in to comment.