-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from BalancerMaxis/issue/180
feat: add root gauges and refactor workflows
- Loading branch information
Showing
13 changed files
with
384 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Generate Core Pools JSON | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * 3" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
refersh_books: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Update Files | ||
id: update | ||
run: | | ||
pip3 install -r bal_addresses/requirements.txt | ||
python3 gen_core_pools.py | ||
git add -A | ||
- name: pull-request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: "Scheduled update from changes to monorepo" | ||
title: "Scheduled update from changes to monorepo" | ||
branch: "gha-addressbook" | ||
reviewers: "Tritum-VLK" | ||
assignees: "Tritum-VLK" | ||
labels: "Automatic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
query RootGauges($skip: Int!, $step_size: Int!) { | ||
rootGauges(skip: $skip, first: $step_size, where: { isKilled: false }) { | ||
id | ||
chain | ||
recipient | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import json | ||
|
||
from bal_addresses import AddrBook | ||
from bal_addresses.pools_gauges import BalPoolsGauges | ||
|
||
|
||
if __name__ == "__main__": | ||
chains = AddrBook.chains | ||
def main(): | ||
core_pools = {} | ||
|
||
# build core pools for every chain and dump result to json | ||
all_core_pools = {} | ||
with open("extras/chains.json", "r") as f: | ||
chains = json.load(f) | ||
for chain in chains["CHAIN_IDS_BY_NAME"]: | ||
gauge_info = BalPoolsGauges(chain) | ||
|
||
# core pools | ||
if chain in ["sepolia", "goerli"]: | ||
continue | ||
all_core_pools[chain] = BalPoolsGauges(chain).core_pools | ||
core_pools[chain] = gauge_info.core_pools | ||
|
||
# dump the collected dict to json file | ||
with open("outputs/core_pools.json", "w") as f: | ||
json.dump(core_pools, f, indent=2) | ||
|
||
json.dump(all_core_pools, open("outputs/core_pools.json", "w"), indent=2) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.