Skip to content

Commit

Permalink
Merge pull request #80 from hoodieshq/feat/add-spl-tickers
Browse files Browse the repository at this point in the history
Add whitelisted SPL tokens to show proper tickers
  • Loading branch information
fbeutin-ledger authored Aug 14, 2024
2 parents fb0a337 + 05c059d commit 4d88a45
Show file tree
Hide file tree
Showing 6 changed files with 643 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ APPNAME = "Solana"
# Application version
APPVERSION_M = 1
APPVERSION_N = 5
APPVERSION_P = 0
APPVERSION_P = 1
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

# Application source files
Expand Down
10 changes: 5 additions & 5 deletions libsol/message_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ void test_process_message_body_spl_token_transfer() {
42, 0, 0, 0, 0, 0, 0, 0,
9
};
process_message_body_and_sanity_check(message, sizeof(message), 5);
process_message_body_and_sanity_check(message, sizeof(message), 6);
}

void test_process_message_body_spl_token_approve() {
Expand All @@ -1606,7 +1606,7 @@ void test_process_message_body_spl_token_approve() {
42, 0, 0, 0, 0, 0, 0, 0,
9
};
process_message_body_and_sanity_check(message, sizeof(message), 5);
process_message_body_and_sanity_check(message, sizeof(message), 6);
}

void test_process_message_body_spl_token_revoke() {
Expand Down Expand Up @@ -1687,7 +1687,7 @@ void test_process_message_body_spl_token_burn() {
42, 0, 0, 0, 0, 0, 0, 0,
9
};
process_message_body_and_sanity_check(message, sizeof(message), 4);
process_message_body_and_sanity_check(message, sizeof(message), 5);
}

void test_process_message_body_spl_token_close_account() {
Expand Down Expand Up @@ -1819,7 +1819,7 @@ void test_process_message_body_spl_associated_token_create_with_transfer() {
0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09
};
process_message_body_and_sanity_check(message, sizeof(message), 9);
process_message_body_and_sanity_check(message, sizeof(message), 10);
}

void test_process_message_body_spl_associated_token_create_with_transfer_and_assert_owner() {
Expand Down Expand Up @@ -1858,7 +1858,7 @@ void test_process_message_body_spl_associated_token_create_with_transfer_and_ass
0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09
};
process_message_body_and_sanity_check(message, sizeof(message), 9);
process_message_body_and_sanity_check(message, sizeof(message), 10);
}

/* clang-format on */
Expand Down
15 changes: 11 additions & 4 deletions libsol/spl_token_instruction.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ int print_spl_token_transfer_info(const SplTokenTransferInfo* info,
symbol,
info->body.decimals);

item = transaction_summary_general_item();
summary_item_set_pubkey(item, "Mint", info->mint_account);

item = transaction_summary_general_item();
summary_item_set_pubkey(item, "From", info->src_account);

Expand All @@ -528,6 +531,9 @@ static int print_spl_token_approve_info(const SplTokenApproveInfo* info,
symbol,
info->body.decimals);

item = transaction_summary_general_item();
summary_item_set_pubkey(item, "Mint", info->mint_account);

item = transaction_summary_general_item();
summary_item_set_pubkey(item, "From", info->token_account);

Expand Down Expand Up @@ -591,10 +597,8 @@ static int print_spl_token_mint_to_info(const SplTokenMintToInfo* info,
symbol,
info->body.decimals);

if (print_config->expert_mode) {
item = transaction_summary_general_item();
summary_item_set_pubkey(item, "From", info->mint_account);
}
item = transaction_summary_general_item();
summary_item_set_pubkey(item, "Mint", info->mint_account);

item = transaction_summary_general_item();
summary_item_set_pubkey(item, "To", info->token_account);
Expand All @@ -618,6 +622,9 @@ static int print_spl_token_burn_info(const SplTokenBurnInfo* info,
symbol,
info->body.decimals);

item = transaction_summary_general_item();
summary_item_set_pubkey(item, "Mint", info->mint_account);

item = transaction_summary_general_item();
summary_item_set_pubkey(item, "From", info->token_account);

Expand Down
Loading

0 comments on commit 4d88a45

Please sign in to comment.