Skip to content

Commit 25f9fce

Browse files
authored
Merge pull request LedgerHQ#21 from obsidiansystems/pending-support
Add pending message support
2 parents 8353047 + be61f59 commit 25f9fce

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ edition = "2021"
88
nanos_sdk = { git = "https://github.com/LedgerHQ/ledger-nanos-sdk.git" }
99
nanos_ui = { git = "https://github.com/LedgerHQ/ledger-nanos-ui.git" }
1010

11+
[patch."https://github.com/LedgerHQ/ledger-nanos-sdk.git".nanos_sdk]
12+
git = "https://github.com/alamgu/ledger-nanos-sdk"
13+
branch = "flag-for-pending"
14+
1115
[profile.release]
1216
opt-level = 'z'
1317
lto = true
1418

19+
[features]
20+
pending_review_screen = ["nanos_sdk/pending_review_screen"]
21+
1522
[package.metadata.nanos]
1623
curve = ["secp256k1"]
1724
flags = "0"

src/main.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,26 @@ fn sign_ui(message: &[u8]) -> Result<Option<([u8; 72], u32, u32)>, SyscallError>
8181
}
8282
}
8383

84+
#[no_mangle]
85+
extern "C" fn sample_pending() {
86+
let mut comm = io::Comm::new();
87+
88+
loop {
89+
ui::SingleMessage::new("Pending").show();
90+
match comm.next_event::<Ins>() {
91+
io::Event::Button(ButtonEvent::RightButtonRelease) => break,
92+
_ => (),
93+
}
94+
}
95+
loop {
96+
ui::SingleMessage::new("Ledger review").show();
97+
match comm.next_event::<Ins>() {
98+
io::Event::Button(ButtonEvent::BothButtonsRelease) => break,
99+
_ => (),
100+
}
101+
}
102+
}
103+
84104
#[no_mangle]
85105
extern "C" fn sample_main() {
86106
let mut comm = io::Comm::new();

0 commit comments

Comments
 (0)