Skip to content

Commit

Permalink
Fix/minor cleanups for ledger submission 1 (#25)
Browse files Browse the repository at this point in the history
* Fix tx hash text; Fix show hash for known tx type
* Fix compilation error due to compiler internal error (1.72.0-nightly)
* Fix CI pipeline
  • Loading branch information
siy authored Jun 1, 2023
1 parent 89d4387 commit 6c7d50c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install toolchains
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2023-05-28
override: true
components: rust-src, clippy
- uses: actions/checkout@v2
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Install toolchains
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2023-05-28
override: true
components: rust-src, rustfmt
- uses: actions/checkout@v2
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Install toolchains
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2023-05-28
override: true
components: rust-src
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "babylon-ledger-app"
version = "0.3.1"
version = "0.3.2"
authors = ["siy"]
edition = "2021"
description = "Radix Babylon"
Expand Down
4 changes: 2 additions & 2 deletions app-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ RUN ls -la /root/

ENV PATH="/root/.cargo/bin:${PATH}"
ENV LEDGER_TARGETS=/app/target-config
RUN /root/.cargo/bin/rustup update
RUN /root/.cargo/bin/rustup toolchain remove stable
RUN /root/.cargo/bin/rustup default nightly-2023-05-28
RUN /root/.cargo/bin/rustup target install thumbv7m-none-eabi
RUN /root/.cargo/bin/rustup default nightly
RUN /root/.cargo/bin/rustup component add rust-src
RUN /root/.cargo/bin/cargo install --git https://github.com/radixdlt/cargo-ledger.git
RUN pip3 install --upgrade protobuf setuptools ecdsa && pip3 install ledgerwallet && pip3 install protobuf==3.20.3
Expand Down
10 changes: 8 additions & 2 deletions src/sign/tx_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<T> TxState<T> {
self.processor.set_show_instructions();
self.show_digest = match tx_type {
SignType::Ed25519 | SignType::Secp256k1 => comm.get_apdu_metadata().p1 == 1,
SignType::Ed25519Summary | SignType::Secp256k1Summary => true,
SignType::Ed25519Summary | SignType::Secp256k1Summary => false,
SignType::AuthEd25519 | SignType::AuthSecp256k1 => false,
};
self.show_introductory_screen(tx_type)?;
Expand Down Expand Up @@ -219,7 +219,7 @@ impl<T> TxState<T> {

fn show_digest(&mut self, digest: &Digest) {
if self.show_digest {
self.info_message(b"Digest:", &digest.as_hex());
self.info_message(b"TX Hash:", &digest.as_hex());
}
}

Expand All @@ -234,6 +234,12 @@ impl<T> TxState<T> {
SignType::Ed25519Summary | SignType::Secp256k1Summary => {
self.show_detected_tx_type(&detected_type);
self.show_transaction_fee(&detected_type);

self.show_digest = match detected_type {
DetectedTxType::Transfer | DetectedTxType::TransferWithFee(..) => false,
DetectedTxType::Other | DetectedTxType::OtherWithFee(..) => true,
};

self.show_digest(digest);
}
SignType::AuthEd25519 | SignType::AuthSecp256k1 => {}
Expand Down

0 comments on commit 6c7d50c

Please sign in to comment.