Skip to content

Commit

Permalink
Misc Upgrades with ebip 17 and master (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brean0 authored Jul 25, 2024
2 parents 9770e21 + 577d77b commit 7da5904
Show file tree
Hide file tree
Showing 498 changed files with 261,582 additions and 186,860 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/ci.subgraph-basin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Subgraph Basin

on:
pull_request:
types: [opened, synchronize]
paths:
- "projects/subgraph-basin/**"
- "projects/subgraph-core/**"

jobs:
compile:
runs-on: ubuntu-latest
name: Compile
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
- 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 The Graph CLI
run: npm install -g @graphprotocol/graph-cli
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-basin

# Generate code and check for uncommitted changes
# https://github.com/marketplace/actions/check-uncommitted-changes
- name: Generate Subgraph Code
run: yarn codegen
working-directory: projects/subgraph-basin
- name: Check for uncommitted changes
id: check-changes
uses: mskri/[email protected]
- name: Evaluate if there are changes
if: steps.check-changes.outputs.outcome == failure()
run: echo "There are uncommitted changes - execute 'yarn codegen' locally and commit the generated files!"

- name: Build Subgraph
run: yarn build
working-directory: projects/subgraph-basin
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
- 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 The Graph CLI
run: npm install -g @graphprotocol/graph-cli
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-basin

- name: Generate Subgraph Code
run: yarn codegen
working-directory: projects/subgraph-basin

- name: Run Tests
run: yarn test
working-directory: projects/subgraph-basin
38 changes: 33 additions & 5 deletions .github/workflows/ci.subgraph-bean.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize]
paths:
- "projects/subgraph-bean/**"
- "projects/subgraph-core/**"

jobs:
compile:
Expand All @@ -16,7 +17,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "20"
- name: Cache Node Modules
id: node-modules-cache
uses: actions/cache@v3
Expand All @@ -28,6 +29,7 @@ jobs:
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-bean

# Generate code and check for uncommitted changes
# https://github.com/marketplace/actions/check-uncommitted-changes
Expand All @@ -44,7 +46,33 @@ jobs:
- name: Build Subgraph
run: yarn build
working-directory: projects/subgraph-bean
# TODO: add matchstick test suite
#- name: Run Tests
# run: yarn test
# working-directory: "${{ matrix.value }}"
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
- 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 The Graph CLI
run: npm install -g @graphprotocol/graph-cli
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-bean

- name: Generate Subgraph Code
run: yarn codegen
working-directory: projects/subgraph-bean

- name: Run Tests
run: yarn test
working-directory: projects/subgraph-bean
78 changes: 78 additions & 0 deletions .github/workflows/ci.subgraph-beanft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Subgraph BeaNFT

on:
pull_request:
types: [opened, synchronize]
paths:
- "projects/subgraph-beanft/**"
- "projects/subgraph-core/**"

jobs:
compile:
runs-on: ubuntu-latest
name: Compile
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
- 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 The Graph CLI
run: npm install -g @graphprotocol/graph-cli
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-beanft

# Generate code and check for uncommitted changes
# https://github.com/marketplace/actions/check-uncommitted-changes
- name: Generate Subgraph Code
run: yarn codegen
working-directory: projects/subgraph-beanft
- name: Check for uncommitted changes
id: check-changes
uses: mskri/[email protected]
- name: Evaluate if there are changes
if: steps.check-changes.outputs.outcome == failure()
run: echo "There are uncommitted changes - execute 'yarn codegen' locally and commit the generated files!"

- name: Build Subgraph
run: yarn build
working-directory: projects/subgraph-beanft
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
- 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 The Graph CLI
run: npm install -g @graphprotocol/graph-cli
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-beanft

- name: Generate Subgraph Code
run: yarn codegen
working-directory: projects/subgraph-beanft

- name: Run Tests
run: yarn test
working-directory: projects/subgraph-beanft
38 changes: 33 additions & 5 deletions .github/workflows/ci.subgraph-beanstalk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize]
paths:
- "projects/subgraph-beanstalk/**"
- "projects/subgraph-core/**"

jobs:
compile:
Expand All @@ -16,7 +17,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "20"
- name: Cache Node Modules
id: node-modules-cache
uses: actions/cache@v3
Expand All @@ -28,6 +29,7 @@ jobs:
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-beanstalk

# Generate code and check for uncommitted changes
# https://github.com/marketplace/actions/check-uncommitted-changes
Expand All @@ -44,7 +46,33 @@ jobs:
- name: Build Subgraph
run: yarn build
working-directory: projects/subgraph-beanstalk
# TODO: add matchstick test suite
#- name: Run Tests
# run: yarn test
# working-directory: "${{ matrix.value }}"
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
- 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 The Graph CLI
run: npm install -g @graphprotocol/graph-cli
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: projects/subgraph-beanstalk

- name: Generate Subgraph Code
run: yarn codegen
working-directory: projects/subgraph-beanstalk

- name: Run Tests
run: yarn test
working-directory: projects/subgraph-beanstalk
48 changes: 48 additions & 0 deletions .github/workflows/deploy.subgraph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy Subgraph

on:
workflow_dispatch:
inputs:
environment:
description: "Deployment environment (prod/dev/testing)"
required: true
subgraph:
description: "Subgraph name (beanstalk/bean/basin/beanft)"
required: true
branch:
description: "Branch name"
required: true

jobs:
validation:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.check_env.outputs.environment }}
steps:
- name: Validate environment input
id: check_env
run: |
# Check if the environment is prod/dev/testing/prev
if [[ "${{ github.event.inputs.environment }}" != "prod" && "${{ github.event.inputs.environment }}" != "dev" && "${{ github.event.inputs.environment }}" != "testing" && "${{ github.event.inputs.environment }}" != "prev" ]]; then
echo "Error: Environment must be one of 'prod', 'dev', 'testing'."
exit 1
fi
# Check if the subgraph is a valid selection
if [[ "${{ github.event.inputs.subgraph }}" != "beanstalk" && "${{ github.event.inputs.subgraph }}" != "bean" && "${{ github.event.inputs.subgraph }}" != "basin" && "${{ github.event.inputs.subgraph }}" != "beanft" ]]; then
echo "Error: Subgraph must be one of 'beanstalk', 'bean', 'basin', 'beanft'."
exit 1
fi
deploy:
needs: validation
runs-on: ubuntu-latest
steps:
- name: Install SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GRAPH_SERVER_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H ${{ secrets.GRAPH_SERVER_HOST }} >> ~/.ssh/known_hosts
- name: Execute Remote Deployment Script
run: ssh -i ~/.ssh/id_ed25519 github@${{ secrets.GRAPH_SERVER_HOST }} "bash /home/github/deploy.sh ${{ github.event.inputs.branch }} ${{ github.event.inputs.subgraph }} ${{ github.event.inputs.environment }}"
10 changes: 9 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
"printWidth": 100,
"singleQuote": false,
"semi": true,
"trailingComma": "none"
"trailingComma": "none",
"overrides": [
{
"files": "projects/subgraph-*/**",
"options": {
"printWidth": 140
}
}
]
}
8 changes: 8 additions & 0 deletions PROPOSALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ You can read more about BIPs [here](https://docs.bean.money/almanac/governance/p
* [BIP-39](https://bean.money/bip-39): Beanstalk Farms 2024 Development Budget
* [BIP-40](https://bean.money/bip-40): Beanstalk Farms 2024 Development Budget
* [BIP-41](https://bean.money/bip-41): Immunefi Program Update
* [BIP-42](https://bean.money/bip-42): Seed Gauge System
* [BIP-43](https://bean.money/bip-43): Hypernative
* [BIP-44](https://bean.money/bip-44): Seed Gauge System
* [BIP-45](https://bean.money/bip-45): Seed Gauge System
* [BIP-46](https://bean.money/bip-46): Hypernative
* [BIP-47](https://bean.money/bip-47): Adjust Quorum

## Emergency Beanstalk Improvement Proposal (EBIP)

Expand All @@ -72,6 +78,8 @@ You can read about the BCM's Emergency Response Procedures [here](https://docs.b
* [EBIP-12](https://bean.money/ebip-12): Remove Convert
* [EBIP-13](https://bean.money/ebip-13): Re-Add Convert
* [EBIP-14](https://bean.money/ebip-14): Remove Vesting Period
* [EBIP-15](https://bean.money/ebip-15): Seed Gauge System Fixes
* [EBIP-16](https://bean.money/ebip-16): Fix Germinating Earned Bean Deposits

## Beanstalk Operations Proposal (BOP)

Expand Down
2 changes: 1 addition & 1 deletion projects/cli/src/commands/setbalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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", "3CRV", "BEAN3CRV", "BEANWETH", "urBEAN", "urBEANWETH", "ROOT"];
const symbols = ["ETH", "WETH", "BEAN", "USDT", "USDC", "DAI", "CRV3", "BEAN3CRV", "BEANWETH", "urBEAN", "urBEANWETH", "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(symbols.map((s) => chalk.green(s)).join(", "));
Expand Down
Loading

0 comments on commit 7da5904

Please sign in to comment.