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

fix: ledger workflows #75

Merged
merged 13 commits into from
Oct 7, 2024
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-11-10
toolchain: stable
components: rust-src
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ copy-files:

.PHONY: rust_tests
rust_tests:
cd app && cargo test --no-default-features
cd app && cargo +stable test --no-default-features

60 changes: 30 additions & 30 deletions app/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "ledger-ironfish-dkg"
name = "ironfish-dkg"
version = "0.0.0" # The version is being taken from Makefile.version file
edition = "2021"

[[bin]]
name = "ledger-ironfish-dkg"
name = "ironfish-dkg"
test = false
path = "bin-app/app.rs"

Expand Down Expand Up @@ -91,7 +91,7 @@ icon = "nanox_icon.gif"
icon = "stax_icon.gif"

[package.metadata.ledger.flex]
icon = "stax_icon.gif"
icon = "flex_icon.gif"

# TODO: This change shouldn't be necessary, the ledger targets clearly define atomics as only supporting 32 not 64 (as seen in /opt/rustup/toolchains/1.75.0-aarch64-unknown-linux-musl/lib/rustlib/nanosplus/target.json)
# solve why this is happening rather than using modified radium
Expand Down
34 changes: 17 additions & 17 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ endif
include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.app_testing

ifndef COIN
COIN=IRON
COIN=IRON_DKG
endif

include $(CURDIR)/Makefile.version

$(info COIN = [$(COIN)])

ifeq ($(COIN),IRON)
ifeq ($(COIN),IRON_DKG)
# Main app configuration
APPNAME = "Ironfish DKG"
APPPATH = "44'/1338'"
Expand Down Expand Up @@ -88,23 +88,23 @@ include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.side_loading

.PHONY: buildX
buildX:
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=s" cargo +nightly-2023-11-10 ledger build nanox
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=s" cargo ledger build nanox
FOLDER=nanox make post-build

.PHONY: buildS2
buildS2:
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=s" cargo +nightly-2023-11-10 ledger build nanosplus
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=s" cargo ledger build nanosplus
FOLDER=nanosplus make post-build

.PHONY: buildST
buildST:
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=z" cargo +nightly-2023-11-10 ledger build stax
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=z" cargo ledger build stax
FOLDER=stax make post-build


.PHONY: buildFL
buildFL:
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=z" cargo +nightly-2023-11-10 ledger build flex
BOLOS_SDK= APPVERSION_STR=$(APPVERSION_STR) PRODUCTION_BUILD=$(PRODUCTION_BUILD) RUSTFLAGS="-C opt-level=z" cargo ledger build flex
FOLDER=flex make post-build


Expand Down Expand Up @@ -134,45 +134,45 @@ format:

.PHONY: lint-nanosplus
lint-nanosplus:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target nanosplus -- -Dwarnings
APPVERSION=$(APPVERSION) cargo clippy --target nanosplus -- -Dwarnings

.PHONY: lint-nanox
lint-nanox:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target nanox -- -Dwarnings
APPVERSION=$(APPVERSION) cargo clippy --target nanox -- -Dwarnings

.PHONY: lint-flex
lint-flex:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target flex -- -Dwarnings
APPVERSION=$(APPVERSION) cargo clippy --target flex -- -Dwarnings

.PHONY: lint-stax
lint-stax:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target stax -- -Dwarnings
APPVERSION=$(APPVERSION) cargo clippy --target stax -- -Dwarnings


.PHONY: lint-nanosplus-fix
lint-nanosplus-fix:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target nanosplus --fix
APPVERSION=$(APPVERSION) cargo clippy --target nanosplus --fix

.PHONY: lint-nanox-fix
lint-nanox-fix:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target nanox --fix
APPVERSION=$(APPVERSION) cargo clippy --target nanox --fix

.PHONY: lint-flex-fix
lint-flex-fix:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target flex --fix
APPVERSION=$(APPVERSION) cargo clippy --target flex --fix

.PHONY: lint-stax-fix
lint-stax-fix:
APPVERSION=$(APPVERSION) cargo +nightly-2023-11-10 clippy --target stax --fix
APPVERSION=$(APPVERSION) cargo clippy --target stax --fix

.PHONY: post-build
post-build: move-files-to-output read-params-from-json get-icon-hex create-install-script

.PHONY: move-files-to-output
move-files-to-output:
cp target/$(FOLDER)/release/ledger-ironfish-dkg bin/app.elf
cp target/$(FOLDER)/release/ledger-ironfish-dkg.hex bin/app.hex
cp target/$(FOLDER)/release/ledger-ironfish-dkg.apdu bin/app.apdu
cp target/$(FOLDER)/release/ironfish-dkg bin/app.elf
cp target/$(FOLDER)/release/ironfish-dkg.hex bin/app.hex
cp target/$(FOLDER)/release/ironfish-dkg.apdu bin/app.apdu

.PHONY: read-params-from-json
read-params-from-json:
Expand Down
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=0
# This is the minor version
APPVERSION_N=5
# This is the patch version
APPVERSION_P=3
APPVERSION_P=4
4 changes: 2 additions & 2 deletions app/bin-app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#![no_std]
#![no_main]

use ironfish_dkg::{context::TxContext, AppSW};
use ledger_device_sdk::io::{Comm, Event};
use ledger_ironfish_dkg::{context::TxContext, AppSW};

use ledger_ironfish_dkg::ledger::*;
use ironfish_dkg::ledger::*;

#[cfg(any(target_os = "stax", target_os = "flex"))]
use ledger_device_sdk::nbgl::init_comm;
Expand Down
4 changes: 2 additions & 2 deletions app/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
# channel = "nightly-2023-11-10"
channel = "stable"
channel = "nightly-2023-11-10"
#channel = "stable"
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/parser/transaction.rs
assertion_line: 355
expression: reduced
input_file: src/parser/testvectors/transaction_simple.json
---
Expand Down
2 changes: 1 addition & 1 deletion tests_zemu/tests/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Basic', function () {
expect(resp.testMode).toBe(false)
expect(resp.major).toBe(0)
expect(resp.minor).toBe(5)
expect(resp.patch).toBe(3)
expect(resp.patch).toBe(4)
} finally {
await sim.close()
}
Expand Down
Loading