From 6f0017bb31218d3047816a1f9c39109c4e6c06e3 Mon Sep 17 00:00:00 2001 From: Roman <167799377+basfroman@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:48:56 -0700 Subject: [PATCH 1/2] Merge pull request #208 from opentensor/feat/roman/add-manually-provided-bt-branch-for-workflow_dispatch-run [WIP] Add the option to manually specify the Bittensor branch when running with `workflow_dispatch` --- .github/workflows/check-sdk-tests.yml | 41 +++++++++++++++++++++------ .github/workflows/e2e-tests.yml | 2 +- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-sdk-tests.yml b/.github/workflows/check-sdk-tests.yml index 1e2e295..1e68fd3 100644 --- a/.github/workflows/check-sdk-tests.yml +++ b/.github/workflows/check-sdk-tests.yml @@ -15,9 +15,17 @@ on: - staging types: [opened, synchronize, reopened, labeled, unlabeled] + workflow_dispatch: + inputs: + bittensor_branch: + description: "Optional: Bittensor branch to use instead of staging" + required: false + default: "staging" + env: CARGO_TERM_COLOR: always VERBOSE: ${{ github.event.inputs.verbose }} + BITTENSOR_BRANCH: ${{ github.event.inputs.bittensor_branch || 'staging' }} jobs: apply-label-to-new-pr: @@ -79,9 +87,15 @@ jobs: working-directory: ${{ github.workspace }} run: git clone https://github.com/opentensor/bittensor.git - - name: Checkout + - name: Verify and checkout Bittensor branch working-directory: ${{ github.workspace }}/bittensor - run: git checkout staging + run: | + if ! git fetch origin $BITTENSOR_BRANCH; then + echo "❌ Error: Branch '$BITTENSOR_BRANCH' does not exist in opentensor/bittensor." + exit 1 + fi + git checkout FETCH_HEAD + echo "✅ Using Bittensor branch: $BITTENSOR_BRANCH" - name: Install dependencies run: sudo apt-get install -y jq @@ -90,11 +104,14 @@ jobs: id: get-tests run: | test_files=$(find ${{ github.workspace }}/bittensor/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))') - echo "::set-output name=test-files::$test_files" + echo "test-files=$test_files" >> $GITHUB_OUTPUT shell: bash pull-docker-image: - needs: check-labels + needs: + - check-labels + - find-e2e-tests + runs-on: ubuntu-latest if: always() && needs.check-labels.outputs.run-sdk-tests == 'true' steps: @@ -163,8 +180,12 @@ jobs: working-directory: ${{ github.workspace }}/bittensor run: | source ${{ github.workspace }}/venv/bin/activate - git checkout staging - git fetch origin staging + if ! git fetch origin $BITTENSOR_BRANCH; then + echo "❌ Error: Branch '$BITTENSOR_BRANCH' does not exist in opentensor/bittensor." + exit 1 + fi + git checkout FETCH_HEAD + echo "✅ Using Bittensor branch: $BITTENSOR_BRANCH" python3 -m pip install --upgrade pip python3 -m pip install '.[dev]' @@ -225,8 +246,12 @@ jobs: working-directory: ${{ github.workspace }}/bittensor run: | source ${{ github.workspace }}/venv/bin/activate - git checkout staging - git fetch origin staging + if ! git fetch origin $BITTENSOR_BRANCH; then + echo "❌ Error: Branch '$BITTENSOR_BRANCH' does not exist in opentensor/bittensor." + exit 1 + fi + git checkout FETCH_HEAD + echo "✅ Using Bittensor branch: $BITTENSOR_BRANCH" python3 -m pip install --upgrade pip python3 -m pip install '.[dev]' diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index f87dff4..4bd819b 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -1,4 +1,4 @@ -name: E2E Tests +name: ASI E2E Tests concurrency: group: e2e-${{ github.event.pull_request.number || github.ref }} From 306ed0d67820e5930b7336e60c7b2bec209159fe Mon Sep 17 00:00:00 2001 From: Ibraheem <165814940+ibraheem-abe@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:50:29 -0700 Subject: [PATCH 2/2] Merge pull request #246 from opentensor/update/balance-deposit-events Update: Type checking in balance deposit event --- async_substrate_interface/async_substrate.py | 5 ++++- async_substrate_interface/sync_substrate.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/async_substrate_interface/async_substrate.py b/async_substrate_interface/async_substrate.py index 6a1de27..a654c1b 100644 --- a/async_substrate_interface/async_substrate.py +++ b/async_substrate_interface/async_substrate.py @@ -276,6 +276,7 @@ async def process_events(self): # Process other events possible_success = False for event in await self.triggered_events: + # TODO make this more readable # Check events if ( event["event"]["module_id"] == "System" @@ -378,7 +379,9 @@ async def process_events(self): event["event"]["module_id"] == "Balances" and event["event"]["event_id"] == "Deposit" ): - self.__total_fee_amount += event.value["attributes"]["amount"] + self.__total_fee_amount += event["event"]["attributes"][ + "amount" + ] if possible_success is True and self.__error_message is None: # we delay the positive setting of the __is_success flag until we have finished iteration of the # events and have ensured nothing has set an error message diff --git a/async_substrate_interface/sync_substrate.py b/async_substrate_interface/sync_substrate.py index 96d1d7f..e6a2e3b 100644 --- a/async_substrate_interface/sync_substrate.py +++ b/async_substrate_interface/sync_substrate.py @@ -237,6 +237,7 @@ def process_events(self): # Process other events possible_success = False for event in self.triggered_events: + # TODO make this more readable # Check events if ( event["event"]["module_id"] == "System" @@ -331,7 +332,9 @@ def process_events(self): event["event"]["module_id"] == "Balances" and event["event"]["event_id"] == "Deposit" ): - self.__total_fee_amount += event.value["attributes"]["amount"] + self.__total_fee_amount += event["event"]["attributes"][ + "amount" + ] if possible_success is True and self.__error_message is None: # we delay the positive setting of the __is_success flag until we have finished iteration of the # events and have ensured nothing has set an error message