Skip to content

Commit

Permalink
Merge branch 'feat/LAPP-5-implement-minttoken-tests-2' of https://git…
Browse files Browse the repository at this point in the history
…hub.com/blooo-io/LedgerHQ-app-plugin-poap into feat/LAPP-5-implement-minttoken-tests-2
  • Loading branch information
lisaoulmi committed Nov 24, 2021
2 parents 6558b49 + 48a4270 commit de45202
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Empty file modified Makefile
100755 → 100644
Empty file.
5 changes: 3 additions & 2 deletions src/handle_provide_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ static void handle_beneficiary(const ethPluginProvideParameter_t *msg, poap_para
PRINTF("BENEFICIARY: %.*H\n", ADDRESS_LENGTH, context->beneficiary);
}

static void handle_token_received(const ethPluginProvideParameter_t *msg, poap_parameters_t *context) {
static void handle_token_received(const ethPluginProvideParameter_t *msg,
poap_parameters_t *context) {
memset(context->token_received, 0, sizeof(context->token_received));
memcpy(context->token_received,
&msg->parameter[PARAMETER_LENGTH - ADDRESS_LENGTH],
Expand All @@ -18,7 +19,7 @@ static void handle_token_received(const ethPluginProvideParameter_t *msg, poap_p

static void handle_mint_token(ethPluginProvideParameter_t *msg, poap_parameters_t *context) {
switch (context->next_param) {
case EVENT_ID:
case EVENT_ID:
context->next_param = TOKEN_RECEIVED;
break;
case TOKEN_RECEIVED: // path[1] -> id of the token received
Expand Down
4 changes: 3 additions & 1 deletion src/handle_provide_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ void handle_provide_token(void *parameters) {

if (msg->token1 != NULL) {
context->decimals = msg->token1->decimals;
strlcpy(context->ticker_received, (char *) msg->token1->ticker, sizeof(context->ticker_received));
strlcpy(context->ticker_received,
(char *) msg->token1->ticker,
sizeof(context->ticker_received));
context->tokens_found |= TOKEN_RECEIVED_FOUND;
} else {
context->decimals = DEFAULT_DECIMAL;
Expand Down
2 changes: 1 addition & 1 deletion src/handle_query_contract_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void handle_query_contract_ui(void *parameters) {
set_receive_ui(msg, context);
break;
case WARN_SCREEN:
set_warning_ui(msg, context);
set_beneficiary_ui(msg, context);
break;
case BENEFICIARY_SCREEN:
set_beneficiary_ui(msg, context);
Expand Down
11 changes: 5 additions & 6 deletions src/poap_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

#define TOKEN_RECEIVED_FOUND 1 << 1

typedef enum {
MINT_TOKEN
} poapSelector_t;
typedef enum { MINT_TOKEN } poapSelector_t;

extern const uint8_t *const POAP_SELECTORS[NUM_POAP_SELECTORS];

Expand All @@ -31,9 +29,10 @@ typedef enum {

// Would've loved to make this an enum but we don't have enough room because enums are `int` and not
// `uint8_t`.
#define EVENT_ID 0
#define TOKEN_RECEIVED 1
#define BENEFICIARY 2

#define EVENT_ID 0
#define TOKEN_RECEIVED 1
#define BENEFICIARY 2
#define NONE 3

// Number of decimals used when the token wasn't found in the CAL.
Expand Down

0 comments on commit de45202

Please sign in to comment.