Multiple ETH PRs (#289)

* adding Conflux espace

* adding Moonbeam

* kardiachain and bttc

* adding Wethio
This commit is contained in:
tjulien-ledger
2022-04-13 15:37:30 +02:00
committed by GitHub
parent 87fa920326
commit 6b24a045ce
19 changed files with 71 additions and 1 deletions

View File

@@ -58,7 +58,12 @@ typedef enum chain_kind_e {
CHAIN_KIND_BSC,
CHAIN_KIND_SONGBIRD,
CHAIN_KIND_POLYGON,
CHAIN_KIND_SHYFT
CHAIN_KIND_SHYFT,
CHAIN_KIND_CONFLUX_ESPACE,
CHAIN_KIND_MOONBEAM,
CHAIN_KIND_BTTC,
CHAIN_KIND_KARDIACHAIN,
CHAIN_KIND_WETHIO
} chain_kind_t;
typedef struct chain_config_s {

View File

@@ -269,6 +269,21 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_SHYFT:
numTokens = NUM_TOKENS_SHYFT;
break;
case CHAIN_KIND_CONFLUX_ESPACE:
numTokens = NUM_TOKENS_CONFLUX_ESPACE;
break;
case CHAIN_KIND_MOONBEAM:
numTokens = NUM_TOKENS_MOONBEAM;
break;
case CHAIN_KIND_KARDIACHAIN:
numTokens = NUM_TOKENS_KARDIACHAIN;
break;
case CHAIN_KIND_BTTC:
numTokens = NUM_TOKENS_BTTC;
break;
case CHAIN_KIND_WETHIO:
numTokens = NUM_TOKENS_WETHIO;
break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
@@ -380,6 +395,21 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_SHYFT:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_SHYFT[i]);
break;
case CHAIN_KIND_CONFLUX_ESPACE:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_CONFLUX_ESPACE[i]);
break;
case CHAIN_KIND_MOONBEAM:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_MOONBEAM[i]);
break;
case CHAIN_KIND_BTTC:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_BTTC[i]);
break;
case CHAIN_KIND_KARDIACHAIN:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_KARDIACHAIN[i]);
break;
case CHAIN_KIND_WETHIO:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_WETHIO[i]);
break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;

View File

@@ -194,4 +194,14 @@ const tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON] = {};
const tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT] = {};
const tokenDefinition_t const TOKENS_CONFLUX_ESPACE[NUM_TOKENS_CONFLUX_ESPACE] = {};
const tokenDefinition_t const TOKENS_MOONBEAM[NUM_TOKENS_MOONBEAM] = {};
const tokenDefinition_t const TOKENS_BTTC[NUM_TOKENS_BTTC] = {};
const tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN] = {};
const tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO] = {};
#endif

View File

@@ -101,6 +101,11 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#define NUM_TOKENS_MOONRIVER 0
#define NUM_TOKENS_POLYGON 0
#define NUM_TOKENS_SHYFT 0
#define NUM_TOKENS_CONFLUX_ESPACE 0
#define NUM_TOKENS_MOONBEAM 0
#define NUM_TOKENS_BTTC 0
#define NUM_TOKENS_KARDIACHAIN 0
#define NUM_TOKENS_WETHIO 0
extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
@@ -138,6 +143,11 @@ extern tokenDefinition_t const TOKENS_SONGBIRD[NUM_TOKENS_SONGBIRD];
extern tokenDefinition_t const TOKENS_MOONRIVER[NUM_TOKENS_MOONRIVER];
extern tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON];
extern tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT];
extern tokenDefinition_t const TOKENS_CONFLUX_ESPACE[NUM_TOKENS_CONFLUX_ESPACE];
extern tokenDefinition_t const TOKENS_MOONBEAM[NUM_TOKENS_MOONBEAM];
extern tokenDefinition_t const TOKENS_BTTC[NUM_TOKENS_BTTC];
extern tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN];
extern tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO];
#endif /* HAVE_TOKENS_LIST */