Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #142 from Zondax/kusama_v10_v11
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni authored Mar 23, 2022
2 parents 94ec6af + 0a02dd7 commit 054ffc9
Show file tree
Hide file tree
Showing 19 changed files with 29,159 additions and 17,607 deletions.
58 changes: 47 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
export PATH=~/.cargo/bin:$PATH
cd tests_zemu && yarn testSR25519
build_package:
build_package_0:
needs: [ configure, build, build_ledger, test_zemu, test_zemu_sr25519 ]
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
Expand All @@ -164,14 +164,14 @@ jobs:
- name: Install deps
run: pip install ledgerblue

- name: Build NanoS light
- name: Build NanoS
shell: bash -l {0}
run: |
source $HOME/.cargo/env
make SUBSTRATE_PARSER_FULL=0
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh
- name: Set tag
id: nanos
id: nanos_light
run: echo ::set-output name=tag_name::$(./app/pkg/installer_nanos.sh version)
- name: Create or Update Release (1)
id: create_release_0
Expand All @@ -180,10 +180,29 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
files: ./app/pkg/installer_nanos.sh
tag_name: ${{ steps.nanos.outputs.tag_name }}
tag_name: ${{ steps.nanos_light.outputs.tag_name }}
draft: false
prerelease: false

build_package_1:
needs: [ configure, build, build_ledger, test_zemu, test_zemu_sr25519 ]
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install deps
run: pip install ledgerblue

- name: Build NanoS XL
shell: bash -l {0}
run: |
Expand All @@ -193,8 +212,8 @@ jobs:
- name: Set tag
id: nanos_xl
run: echo ::set-output name=tag_name::$(./app/pkg/installer_nanos_xl.sh version)
- name: Create or Update Release (1)
id: create_release_1
- name: Update Release
id: update_release_1
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
Expand All @@ -204,9 +223,26 @@ jobs:
draft: false
prerelease: false

build_package_2:
needs: [ configure, build, build_ledger, test_zemu, test_zemu_sr25519 ]
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanosplus-secure-sdk
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install deps
run: pip install ledgerblue

- name: Build NanoSP
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanosplus-secure-sdk
shell: bash -l {0}
run: |
source $HOME/.cargo/env
Expand All @@ -215,13 +251,13 @@ jobs:
- name: Set tag
id: nanosp
run: echo ::set-output name=tag_name::$(./app/pkg/installer_nanos_plus.sh version)
- name: Create or Update Release (1)
id: create_release_2
- name: Update Release
id: update_release_2
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
files: ./app/pkg/installer_nanos_plus.sh
tag_name: ${{ steps.nanosp.outputs.tag_name }}
draft: false
prerelease: false
prerelease: false
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=11
# This is the `spec_version` field of `Runtime`
APPVERSION_N=9180
# This is the patch version of this release
APPVERSION_P=0
APPVERSION_P=1
17 changes: 17 additions & 0 deletions app/src/substrate/substrate_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ parser_error_t _readMethod(
switch (c->tx_obj->transactionVersion) {
case 11:
return _readMethod_V11(c, moduleIdx, callIdx, &method->V11);
case 10:
return _readMethod_V10(c, moduleIdx, callIdx, &method->V10);
default:
return parser_tx_version_not_supported;
}
Expand All @@ -38,6 +40,8 @@ uint8_t _getMethod_NumItems(uint32_t transactionVersion, uint8_t moduleIdx, uint
switch (transactionVersion) {
case 11:
return _getMethod_NumItems_V11(moduleIdx, callIdx);
case 10:
return _getMethod_NumItems_V10(moduleIdx, callIdx);
default:
return parser_tx_version_not_supported;
}
Expand All @@ -48,6 +52,8 @@ const char* _getMethod_ModuleName(uint32_t transactionVersion, uint8_t moduleIdx
switch (transactionVersion) {
case 11:
return _getMethod_ModuleName_V11(moduleIdx);
case 10:
return _getMethod_ModuleName_V10(moduleIdx);
default:
return NULL;
}
Expand All @@ -58,6 +64,8 @@ const char* _getMethod_Name(uint32_t transactionVersion, uint8_t moduleIdx, uint
switch (transactionVersion) {
case 11:
return _getMethod_Name_V11(moduleIdx, callIdx);
case 10:
return _getMethod_Name_V10(moduleIdx, callIdx);
default:
return 0;
}
Expand All @@ -68,6 +76,8 @@ const char* _getMethod_ItemName(uint32_t transactionVersion, uint8_t moduleIdx,
switch (transactionVersion) {
case 11:
return _getMethod_ItemName_V11(moduleIdx, callIdx, itemIdx);
case 10:
return _getMethod_ItemName_V10(moduleIdx, callIdx, itemIdx);
default:
return NULL;
}
Expand All @@ -81,6 +91,9 @@ parser_error_t _getMethod_ItemValue(uint32_t transactionVersion, pd_Method_t* m,
case 11:
return _getMethod_ItemValue_V11(&m->V11, moduleIdx, callIdx, itemIdx, outValue,
outValueLen, pageIdx, pageCount);
case 10:
return _getMethod_ItemValue_V10(&m->V10, moduleIdx, callIdx, itemIdx, outValue,
outValueLen, pageIdx, pageCount);
default:
return parser_tx_version_not_supported;
}
Expand All @@ -91,6 +104,8 @@ bool _getMethod_ItemIsExpert(uint32_t transactionVersion, uint8_t moduleIdx, uin
switch (transactionVersion) {
case 11:
return _getMethod_ItemIsExpert_V11(moduleIdx, callIdx, itemIdx);
case 10:
return _getMethod_ItemIsExpert_V10(moduleIdx, callIdx, itemIdx);
default:
return false;
}
Expand All @@ -101,6 +116,8 @@ bool _getMethod_IsNestingSupported(uint32_t transactionVersion, uint8_t moduleId
switch (transactionVersion) {
case 11:
return _getMethod_IsNestingSupported_V11(moduleIdx, callIdx);
case 10:
return _getMethod_IsNestingSupported_V10(moduleIdx, callIdx);
default:
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/substrate/substrate_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extern "C" {

#include "parser_common.h"
#include "stdbool.h"
#include "substrate_dispatch_V10.h"
#include "substrate_dispatch_V11.h"
#include <stddef.h>
#include <stdint.h>
Expand All @@ -35,6 +36,9 @@ extern "C" {
case 11: \
return PD_CALL_##CALL##_V11; \
\
case 10: \
return PD_CALL_##CALL##_V10; \
\
default: \
return 0; \
} \
Expand Down
Loading

0 comments on commit 054ffc9

Please sign in to comment.