-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from LedgerHQ/fix/multifield_stack
rework MultiFieldReview to use less stack
- Loading branch information
Showing
7 changed files
with
224 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#![no_std] | ||
#![no_main] | ||
|
||
use core::panic::PanicInfo; | ||
#[panic_handler] | ||
fn panic(_: &PanicInfo) -> ! { | ||
ledger_device_sdk::exit_app(1); | ||
} | ||
|
||
use ledger_device_sdk::ui::bitmaps::*; | ||
use ledger_device_sdk::ui::gadgets::{Field, MultiFieldReview}; | ||
|
||
#[no_mangle] | ||
extern "C" fn sample_main() { | ||
let fields = [ | ||
Field { | ||
name: "Amount", | ||
value: "CRAB 666", | ||
}, | ||
Field { | ||
name: "Destination", | ||
value: "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", | ||
}, | ||
Field { | ||
name: "Memo", | ||
value: "This is a very long memo. It will force the app client to send the serialized transaction to be sent in chunk. As the maximum chunk size is 255 bytes we will make this memo greater than 255 characters. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam.", | ||
}, | ||
]; | ||
let review = MultiFieldReview::new( | ||
&fields, | ||
&["Review ", "Transaction"], | ||
Some(&EYE), | ||
"Approve", | ||
Some(&VALIDATE_14), | ||
"Reject", | ||
Some(&CROSSMARK), | ||
); | ||
review.show(); | ||
ledger_device_sdk::exit_app(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.