Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add mode #59

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d3ccf9f
bumped to web6
8ball030 Oct 9, 2023
3ef2a33
[feat] deps
Oct 10, 2023
4218170
bumped to web3v6
8ball030 Oct 10, 2023
0656963
small improvements
8ball030 Oct 11, 2023
f858316
reverted testing changes
8ball030 Oct 11, 2023
0bcefb4
added test for graph
8ball030 Oct 11, 2023
1cc7137
[chore] ensured pep8 compliance
8ball030 Oct 11, 2023
5498b3e
[chore] ensured pep8 compliance
8ball030 Oct 11, 2023
e55ab2f
[chore] ensured pep8 compliance
8ball030 Oct 11, 2023
61c6efd
[chore] added dev deps group
8ball030 Oct 11, 2023
98bf435
[chore] added docs
8ball030 Oct 11, 2023
521fb53
added test for graph
8ball030 Oct 11, 2023
ebb6ac9
[feat] ensured commit matches
8ball030 Nov 16, 2023
baedb62
Merge pull request #1 from 8ball030/feat/syncing-changes-2
8ball030 Nov 16, 2023
8c1b44f
feat: added base
8ball030 Mar 28, 2024
dc7d0d7
feat: added base
8ball030 Mar 28, 2024
f845b54
feat: add apiEndpoint to balpy class
8ball030 May 27, 2024
ba00442
feat: relaxed dependencies
8ball030 Aug 11, 2024
c64e790
Merge pull request #3 from 8ball030/feat/improvments
8ball030 Aug 11, 2024
b83aa67
Merge pull request #4 from 8ball030/feat/stable
8ball030 Aug 11, 2024
c715f93
feat: relaxed dependencies
8ball030 Aug 11, 2024
c73beed
feat: updated for v3 api
Oct 4, 2024
4f57f1e
chore: relaxed deps
Oct 13, 2024
8af73de
Merge branch 'main' into feat/updated-upstream
8ball030 Oct 13, 2024
f3ad8d2
chore: regenerated poetry lock
Oct 13, 2024
0b5e9a1
Merge pull request #5 from 8ball030/feat/updated-upstream
8ball030 Oct 13, 2024
d00c791
feat:fixed import
Oct 13, 2024
5462bd7
chore: linters and api3 integration
Oct 15, 2024
ef17927
fix: retry to account for blocking
Oct 16, 2024
419b598
Merge branch 'main' into feat/updates
8ball030 Oct 23, 2024
a804c81
Merge pull request #6 from 8ball030/feat/updates
8ball030 Oct 23, 2024
86ef737
chore: removed unused code
Oct 23, 2024
4269105
chore: improve-balpy api response handling to advoid rpc
Oct 25, 2024
9dff00a
chore: improve copy of query
Oct 28, 2024
ea5392d
chore:workflows-and-github
Oct 28, 2024
d2cd8b0
Merge pull request #7 from 8ball030/feat/preparing-fork
8ball030 Oct 28, 2024
136d305
feat/ensured-passes-ci
Oct 28, 2024
55052fd
feat:tbump
Oct 28, 2024
b70a2be
Bump to 0.0.2
Oct 28, 2024
54743a2
Bump to 0.0.3
Oct 28, 2024
87f4759
feat:bumping
Oct 28, 2024
5e27278
Bump to 0.0.4
Oct 28, 2024
f0f4998
feat:bumping
Oct 28, 2024
294c3a8
Bump to 0.0.5
Oct 28, 2024
e75a06d
feat:added-common-checks
Oct 28, 2024
b1b3961
Bump to 0.0.6
Oct 28, 2024
2f0add9
feat:aligning-relase-versions
Oct 28, 2024
cfb4364
Bump to 0.0.7
Oct 28, 2024
db3bc9d
feat:refactor
Dec 23, 2024
0ee7aee
Merge pull request #8 from 8ball030/feat/extra-endpoints
8ball030 Dec 23, 2024
061fa7f
Bump to 0.0.8
Dec 23, 2024
4f9391b
Bump to 0.0.9
Dec 23, 2024
aaab40e
feat:Add MODE support in balpy
gauravlochab Jan 16, 2025
5c4b104
chore:version update to 0.1.0 for release
gauravlochab Jan 16, 2025
f2083dd
feat: Add mode.json for various tasks
gauravlochab Jan 16, 2025
e34ffb4
fix: resolve ci issue for lockfile
gauravlochab Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 57 additions & 0 deletions .github/workflows/common_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Code Quality
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
strategy:
fail-fast: false
matrix:
python-version: ["3.11",]
poetry-version: ["1.3.2"]
os: [ubuntu-20.04,]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: ${{ matrix.poetry-version }}
virtualenvs-create: true
installer-parallel: true
- name: Install
run: |
poetry install

- name: Format
run: |
make fmt

- name: Lint
run: |
make lint

- name: Tests
run: |
make test

- name: Lock
run: |
poetry lock

- name: Ensure lockfile is up to date
run: |
git diff --exit-code

66 changes: 66 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Publish package on main branch if it's tagged with 'v*'

name: release & publish workflow

# Controls when the action will run.
on:
# Triggers the workflow on push events but only for the master branch
push:
tags:
- 'v*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "release"
release:
name: Create Release
runs-on: ubuntu-20.04

strategy:
matrix:
python-versions: ["3.11"]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-versions }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry

- name: Build wheels and source tarball
run: >-
poetry build

- name: create github release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
body: ${{ steps.changelog_reader.outputs.changes }}
files: dist/*.whl
draft: false
prerelease: false

- name: publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.nix-venv
# Taken from https://github.com/github/gitignore/blob/dd9c41b6088bb200e53d4c4ba4d72f8218b2e898/Python.gitignore

# Byte-compiled / optimized / DLL files
Expand Down Expand Up @@ -154,4 +155,4 @@ cython_debug/
#.idea/

# MacOS
.DS_Store
.DS_Store
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ See release on PyPI: https://pypi.org/project/balpy/
```bash
# Install in virtual environment using poetry
git clone https://github.com/balancer-labs/balpy.git
# checkout submodules
git submodule update --init --recursive

cd balpy
poetry install # Install dependencies and package
# You can enter the virtual environment using
Expand Down Expand Up @@ -62,3 +65,32 @@ You also must set AT LEAST one of these environment variables to connect to the

## Samples
See README.md in samples/ for more information.

## DEV

# Formatting

```bash
make fmt
```

## Linting

```bash
make lint
```

Check all linters and formaters and tests.

## Tests

A small number of tests are included for functionaly demonstration.

```bash
make test
```



```bash
make all
3 changes: 0 additions & 3 deletions balpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from .balancerErrors import handleException
from balpy import balpy

1 change: 0 additions & 1 deletion balpy/balancer-deployments
Submodule balancer-deployments deleted from 3269cd
2 changes: 2 additions & 0 deletions balpy/balancer-deployments/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
11 changes: 11 additions & 0 deletions balpy/balancer-deployments/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier", "mocha-no-only"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
rules: {
"comma-spacing": ["error", {before: false, after: true}],
"prettier/prettier": "error",
"mocha-no-only/mocha-no-only": ["error"],
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Deployment preparation: <!-- Deployment title: contract or feature (e.g. `ManagedPool`) -->

<!-- Specify commit at which `build-info` was generated for this deployment -->

## Deployment preparation tasks checklist:

- [ ] Deployments `README` is updated with the new task name and link
- [ ] Task `README` has a description and links to the artifacts
- [ ] `build-info` is updated with artifacts compiled at the specified commit
- [ ] Artifacts are generated from `build-info`
- [ ] New task has a working fork test <!-- This implies index and input scripts are correct -->

## Deprecating old tasks checklist: <!-- Only if applicable -->

- [ ] Old task was moved to `deprecated/` directory
- [ ] Deployments `README` is updated: old task is moved to the 'deprecated' section, and links are updated with the `deprecated/` prefix
- [ ] Old task imports in `index.ts`, `input.ts` and fork tests are updated
- [ ] Old task `README` is updated with a warning sign, a link to the replacement task and a short description <!-- Explain why it was deprecated -->

## Code checklist:

- [ ] The diff is legible and has no extraneous changes <!-- There shouldn't be any changes to code outside of the deployment task in this PR -->
- [ ] Complex code has been commented in tests and scripts
- [ ] Fork test block number and test cases are appropriate for this deployment
- [ ] The base branch is either `master`, or there's a description of how to merge

## Issue Resolution

<!-- If this PR addresses an issue, note that here: e.g., Closes/Fixes/Resolves #1346. -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Deployment: <!-- Deployment title: contract or feature (e.g. `ManagedPool`) -->

## Deployment tasks checklist:

- [ ] Contract(s) deployed to all target networks / testnets
- [ ] TX IDs are properly generated
- [ ] Action IDs are generated after deployment (if applicable) <!-- This includes contracts deployed by contracts (e.g. mock pools deployed by factories) -->
- [ ] Outputs for all target networks are generated, and linked in the task `readme`
- [ ] Addresses files are up to date with the new deployment <!-- yarn build-address-lookup -->
- [ ] Contracts are verified in every network <!-- This includes contracts deployed by contracts (e.g. mock pools deployed by factories) -->
- [ ] Deployments `CHANGELOG` is updated
- [ ] There are no code changes of any kind

## Issue Resolution

<!-- If this PR addresses an issue, note that here: e.g., Closes/Fixes/Resolves #1346. -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Check Action IDs'
inputs:
network-name:
required: true
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Prepare Config
run: yarn ci:prepare-config
shell: bash
- name: Check Action IDs
run: yarn check-network-action-ids ${{ inputs.network-name }}
shell: bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Check Deployment Addresses'
inputs:
network-name:
required: true
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Prepare Config
run: yarn ci:prepare-config
shell: bash
- name: Check Deployment Addresses
run: yarn check-network-deployments ${{ inputs.network-name }}
shell: bash
19 changes: 19 additions & 0 deletions balpy/balancer-deployments/.github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup

runs:
using: composite
steps:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18.15
- name: Cache
uses: actions/cache@v3
id: cache
with:
path: '**/node_modules'
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install
run: yarn --immutable
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
31 changes: 31 additions & 0 deletions balpy/balancer-deployments/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- If this is deployment-related, please go the the Preview tab and select the appropriate sub-template. -->
<!-- Otherwise, delete everything before #Description -->

* [Deployment preparation template](?expand=1&template=deployment-preparation-template.md)
* [Deployment template](?expand=1&template=deployment-template.md)

# Description

<!-- Describe the changes introduced in this pull request. -->
<!-- Include any context necessary for understanding the PR's purpose. -->

## Type of change

- [ ] Bug fix <!-- (non-breaking change which fixes an issue) -->
- [ ] New feature <!-- (non-breaking change which adds functionality) -->
- [ ] Breaking change <!-- (would cause existing functionality to not work as expected) -->
- [ ] Dependency changes
- [ ] Code refactor / cleanup
- [ ] Documentation or wording changes
- [ ] Other

## Checklist:

- [ ] The diff is legible and has no extraneous changes
- [ ] Complex code has been commented, including external interfaces
- [ ] Tests are included for all code paths
- [ ] The base branch is either `master`, or there's a description of how to merge

## Issue Resolution

<!-- If this PR addresses an issue, note that here: e.g., Closes/Fixes/Resolves #1346. -->
Loading