From 9c7e41f15bbce502d2596b351c66d9b8fae2d9e5 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 24 May 2016 22:14:10 +0100 Subject: [PATCH] Reorder fsm.c for logical grouping of signing methods --- firmware/fsm.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/firmware/fsm.c b/firmware/fsm.c index 3640fbf..3ab2304 100644 --- a/firmware/fsm.c +++ b/firmware/fsm.c @@ -419,6 +419,22 @@ void fsm_msgSignTx(SignTx *msg) signing_init(msg->inputs_count, msg->outputs_count, coin, node, msg->version, msg->lock_time); } +void fsm_msgTxAck(TxAck *msg) +{ + if (msg->has_tx) { + signing_txack(&(msg->tx)); + } else { + fsm_sendFailure(FailureType_Failure_SyntaxError, "No transaction provided"); + } +} + +void fsm_msgCancel(Cancel *msg) +{ + (void)msg; + recovery_abort(); + signing_abort(); + fsm_sendFailure(FailureType_Failure_ActionCancelled, "Aborted"); +} void fsm_msgEthereumSignTx(EthereumSignTx *msg) { @@ -432,23 +448,6 @@ void fsm_msgEthereumTxAck(EthereumTxAck *msg) fsm_sendFailure(FailureType_Failure_Other, "Unsupported feature"); } -void fsm_msgCancel(Cancel *msg) -{ - (void)msg; - recovery_abort(); - signing_abort(); - fsm_sendFailure(FailureType_Failure_ActionCancelled, "Aborted"); -} - -void fsm_msgTxAck(TxAck *msg) -{ - if (msg->has_tx) { - signing_txack(&(msg->tx)); - } else { - fsm_sendFailure(FailureType_Failure_SyntaxError, "No transaction provided"); - } -} - void fsm_msgCipherKeyValue(CipherKeyValue *msg) { if (!storage_isInitialized()) {