Skip to content

Commit

Permalink
merge (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brean0 authored Aug 25, 2024
2 parents 11b19af + ffad825 commit 6fb9df3
Show file tree
Hide file tree
Showing 341 changed files with 13,568 additions and 12,684 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/ci.protocol.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Protocol

on:
pull_request:
types: [opened, synchronize]
Expand Down Expand Up @@ -31,22 +30,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Protocol Tests
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Cache Node Modules
id: node-modules-cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
- run: yarn generate
working-directory: protocol
- run: yarn test

- name: Clear cache and reinstall on generate failure
if: steps.generate-with-cache.outcome == 'failure' && steps.node-modules-cache.outputs.cache-hit == 'true'
run: |
rm -rf **/node_modules
yarn install --no-immutable
- name: Generate (after potential cache clear)
if: steps.generate-with-cache.outcome == 'failure'
run: yarn generate
working-directory: protocol

- name: Run tests
run: yarn test
env:
FORKING_RPC: ${{ secrets.ANVIL_FORK_URL }}
working-directory: protocol
2 changes: 1 addition & 1 deletion .github/workflows/ci.subgraph-basin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: echo "There are uncommitted changes - execute 'yarn codegen' locally and commit the generated files!"

- name: Build Subgraph
run: yarn build
run: yarn build -- ethereum
working-directory: projects/subgraph-basin
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.subgraph-bean.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: echo "There are uncommitted changes - execute 'yarn codegen' locally and commit the generated files!"

- name: Build Subgraph
run: yarn build
run: yarn build -- ethereum
working-directory: projects/subgraph-bean
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.subgraph-beanft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: echo "There are uncommitted changes - execute 'yarn codegen' locally and commit the generated files!"

- name: Build Subgraph
run: yarn build
run: yarn build -- ethereum
working-directory: projects/subgraph-beanft
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.subgraph-beanstalk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: echo "There are uncommitted changes - execute 'yarn codegen' locally and commit the generated files!"

- name: Build Subgraph
run: yarn build
run: yarn build -- ethereum
working-directory: projects/subgraph-beanstalk
test:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions projects/cli/src/commands/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { table } from "table";

export const balance = async (sdk, { account, symbol }) => {
console.log(`${chalk.bold.whiteBright("Account:")} ${chalk.greenBright(account)}`);
let res = [[chalk.bold("Token"), chalk.bold("Internal"), chalk.bold("External"), chalk.bold("Total")]];
let res = [
[chalk.bold("Token"), chalk.bold("Internal"), chalk.bold("External"), chalk.bold("Total")]
];

if (symbol) {
res.push(await getBal(sdk, symbol, account));
Expand All @@ -18,7 +20,7 @@ export const balance = async (sdk, { account, symbol }) => {
"DAI",
"CRV3",
"UNRIPE_BEAN",
"UNRIPE_BEAN_WETH",
"UNRIPE_BEAN_wstETH",
"BEAN_CRV3_LP",
"BEAN_ETH_WELL_LP",
"ROOT"
Expand Down
21 changes: 18 additions & 3 deletions projects/cli/src/commands/setbalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,30 @@ export const setbalance = async (sdk, chain, { account, symbol, amount }) => {
if (!symbol) {
await chain.setAllBalances(account, amount);
} else {
const symbols = ["ETH", "WETH", "BEAN", "USDT", "USDC", "DAI", "CRV3", "BEAN3CRV", "BEANWETH", "urBEAN", "urBEANWETH", "ROOT"];
const symbols = [
"ETH",
"WETH",
"BEAN",
"USDT",
"USDC",
"DAI",
"CRV3",
"BEAN3CRV",
"BEANWETH",
"urBEAN",
"urBEANwstETH",
"ROOT"
];
if (!symbols.includes(symbol)) {
console.log(`${chalk.bold.red("Error")} - ${chalk.bold.white(symbol)} is not a valid token. Valid options are: `);
console.log(
`${chalk.bold.red("Error")} - ${chalk.bold.white(symbol)} is not a valid token. Valid options are: `
);
console.log(symbols.map((s) => chalk.green(s)).join(", "));
process.exit(-1);
}
let t = sdk.tokens[symbol] as Token;
if (symbol === "urBEAN") t = sdk.tokens.UNRIPE_BEAN;
if (symbol === "urBEANWETH") t = sdk.tokens.UNRIPE_BEAN_WETH;
if (symbol === "urBEANwstETH") t = sdk.tokens.UNRIPE_BEAN_WSTETH;
if (symbol === "BEAN3CRV") t = sdk.tokens.BEAN_CRV3_LP;
if (symbol === "BEANWETH") t = sdk.tokens.BEAN_ETH_WELL_LP;
if (typeof chain[`set${symbol}Balance`] !== "function")
Expand Down
5 changes: 4 additions & 1 deletion projects/cli/src/commands/sunrise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const sunrise = async (sdk, chain, { force }) => {
}

await callSunrise(sdk);
await sdk.provider.send("evm_mine", []);

if (diff > 1) {
console.log(`You are still behind by ${diff - 1} seasons. May need to call it again.`);
Expand All @@ -27,7 +28,9 @@ async function callSunrise(sdk: BeanstalkSDK) {
const res = await sdk.contracts.beanstalk.sunrise();
await res.wait();
const season = await sdk.contracts.beanstalk.season();
console.log(`${chalk.bold.greenBright("sunrise()")} called. New season is ${chalk.bold.yellowBright(season)}`);
console.log(
`${chalk.bold.greenBright("sunrise()")} called. New season is ${chalk.bold.yellowBright(season)}`
);
} catch (err: any) {
console.log(`sunrise() call failed: ${err.reason}`);
}
Expand Down
8 changes: 8 additions & 0 deletions projects/dex-ui/src/assets/images/tokens/BEANwstETHCP2w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions projects/dex-ui/src/assets/images/tokens/wstETH.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6fb9df3

Please sign in to comment.