Skip to content

Commit

Permalink
Merge branch 'main' into feat/LAPP-5-implement-minttoken-tests-2
Browse files Browse the repository at this point in the history
  • Loading branch information
lisaoulmi authored Nov 24, 2021
2 parents 53ba097 + 0f75ce4 commit 48a4270
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 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
14 changes: 7 additions & 7 deletions src/poap_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
#define RUN_APPLICATION 1

#define NUM_POAP_SELECTORS 1
#define SELECTOR_SIZE 4

#define SELECTOR_SIZE 4

#define PLUGIN_NAME "Poap"

#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 @@ -32,9 +31,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
Empty file modified tests/elfs/ethereum_nanos.elf
100755 → 100644
Empty file.
Empty file modified tests/elfs/ethereum_nanox.elf
100755 → 100644
Empty file.
Binary file modified tests/elfs/poap_nanos.elf
100755 → 100644
Binary file not shown.

0 comments on commit 48a4270

Please sign in to comment.