Add support for Songbird (SGB)

This commit is contained in:
Markus Alvila
2021-08-05 19:27:53 +02:00
parent 4b5a2b1033
commit 779fae6058
8 changed files with 21 additions and 5 deletions

View File

@@ -55,7 +55,8 @@ typedef enum chain_kind_e {
CHAIN_KIND_THUNDERCORE,
CHAIN_KIND_FLARE,
CHAIN_KIND_THETA,
CHAIN_KIND_BSC
CHAIN_KIND_BSC,
CHAIN_KIND_SONGBIRD
} chain_kind_t;
typedef struct chain_config_s {

View File

@@ -256,6 +256,9 @@ tokenDefinition_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_BSC:
numTokens = NUM_TOKENS_BSC;
break;
case CHAIN_KIND_SONGBIRD:
numTokens = NUM_TOKENS_SONGBIRD;
break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
@@ -351,12 +354,16 @@ tokenDefinition_t *getKnownToken(uint8_t *contractAddress) {
break;
case CHAIN_KIND_FLARE:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_FLARE[i]);
break case CHAIN_KIND_THETA : currentToken =
(tokenDefinition_t *) PIC(&TOKENS_THETA[i]);
break;
case CHAIN_KIND_THETA:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_THETA[i]);
break;
case CHAIN_KIND_BSC:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_BSC[i]);
break;
case CHAIN_KIND_SONGBIRD:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_SONGBIRD[i]);
break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;

View File

@@ -4568,4 +4568,6 @@ const tokenDefinition_t const TOKENS_THETA[NUM_TOKENS_THETA] = {};
const tokenDefinition_t const TOKENS_BSC[NUM_TOKENS_BSC] = {};
const tokenDefinition_t const TOKENS_SONGBIRD[NUM_TOKENS_SONGBIRD] = {};
#endif

View File

@@ -97,6 +97,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#define NUM_TOKENS_FLARE 0
#define NUM_TOKENS_THETA 0
#define NUM_TOKENS_BSC 0
#define NUM_TOKENS_SONGBIRD 0
extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
@@ -131,6 +132,7 @@ extern tokenDefinition_t const TOKENS_THUNDERCORE[NUM_TOKENS_THUNDERCORE];
extern tokenDefinition_t const TOKENS_FLARE[NUM_TOKENS_FLARE];
extern tokenDefinition_t const TOKENS_THETA[NUM_TOKENS_THETA];
extern tokenDefinition_t const TOKENS_BSC[NUM_TOKENS_BSC];
extern tokenDefinition_t const TOKENS_SONGBIRD[NUM_TOKENS_SONGBIRD];
#endif /* HAVE_TOKENS_LIST */