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/LDG-602-fix-this-test-test_sign_tx_transfer_with_schedul #25

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ services:
- "5000:5000" # api
- "40000:40000" # apdu
environment:
- GDB_DIRECTORY_LIST="/speculos/sources/common:/speculos/sources:/speculos/sources/apdu:/speculos/sources/handler:/speculos/sources/helper:/speculos/sources/transaction:/speculos/sources/ui"
- GDB_DIRECTORY_LIST="/speculos/sources/common:/speculos/sources/common/ui:/speculos/sources:/speculos/sources/apdu:/speculos/sources/handler:/speculos/sources/helper:/speculos/sources/transaction:/speculos/sources/ui"
command: "-d --model nanosp build/nanos2/bin/app.elf --display headless --apdu-port 40000"
# Add `--vnc-password "<password>"` for macos users to use built-in vnc client.
16 changes: 3 additions & 13 deletions src/app_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@ void app_main() {

// Structured APDU command
command_t cmd;

io_init();

ui_menu_main();

explicit_bzero(&global_tx_state, sizeof(global_tx_state));
ui_menu_main();

// Initialize the NVM data if required
if (N_storage.initialized != 0x01) {
Expand Down Expand Up @@ -101,19 +98,12 @@ void app_main() {
cmd.lc,
cmd.data);

// uint8_t INS = G_io_apdu_buffer[OFFSET_INS];
// uint8_t p1 = G_io_apdu_buffer[OFFSET_P1];
// uint8_t p2 = G_io_apdu_buffer[OFFSET_P2];
// uint8_t lc = G_io_apdu_buffer[OFFSET_LC];
// uint8_t *cdata = G_io_apdu_buffer + OFFSET_CDATA;

bool isInitialCall = false;
if (global_tx_state.currentInstruction == -1) {
explicit_bzero(&global_tx_state, sizeof(global_tx_state));
global_tx_state.currentInstruction = (int) cmd.ins;
explicit_bzero(&global, sizeof(global));
global_tx_state.currentInstruction = cmd.ins;
isInitialCall = true;
}

// else if (global_tx_state.currentInstruction != cmd.ins) {
// // Caller attempted to switch instruction in the middle
// // of a multi command flow. This is not allowed, as in the
Expand Down
Loading