Skip to content

Commit

Permalink
swap!
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Apr 21, 2024
1 parent f59fa1d commit a18e0f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/handler/sign_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "buffer.h"
#include "swap.h"

#include "swap_check.h"
#include "sign_tx.h"
#include "stellar/parser.h"
#include "stellar/formatter.h"
Expand All @@ -33,6 +32,7 @@
#include "../ui/display.h"
#include "../crypto.h"
#include "../helper/send_response.h"
#include "../swap/swap_check.h"

int handler_sign_tx(buffer_t *cdata, bool is_first_chunk, bool more) {
if (is_first_chunk) {
Expand Down
11 changes: 6 additions & 5 deletions src/swap/swap_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

#include "os.h"

#include "../globals.h"
#include "swap_check.h"
#include "stellar/printer.h"
#include "../globals.h"

bool swap_check() {
PRINTF("swap_check invoked.\n");
Expand All @@ -26,7 +27,7 @@ bool swap_check() {

// amount
if (G_context.tx_info.tx.op_details.payment_op.asset.type != ASSET_TYPE_NATIVE ||
G_context.tx_info.tx.op_details.payment_op.amount != (int64_t) G.swap_values.amount) {
G_context.tx_info.tx.op_details.payment_op.amount != (int64_t) G.swap.values.amount) {
return false;
}

Expand All @@ -39,7 +40,7 @@ bool swap_check() {
return false;
};

if (strcmp(tmp_buf, G.swap_values.destination) != 0) {
if (strcmp(tmp_buf, G.swap.values.destination) != 0) {
return false;
}

Expand All @@ -49,13 +50,13 @@ bool swap_check() {

// memo
if (G_context.tx_info.tx.memo.type != MEMO_TEXT ||
strcmp((char *) G_context.tx_info.tx.memo.text.text, G.swap_values.memo) != 0) {
strcmp((char *) G_context.tx_info.tx.memo.text.text, G.swap.values.memo) != 0) {
return false;
}

// fees
if (G_context.tx_info.network != NETWORK_TYPE_PUBLIC ||
G_context.tx_info.tx.fee != G.swap_values.fees) {
G_context.tx_info.tx.fee != G.swap.values.fees) {
return false;
}

Expand Down

0 comments on commit a18e0f1

Please sign in to comment.