adding astar&shiden

This commit is contained in:
Alexandre Paillier
2022-06-15 13:33:40 +02:00
parent c74ca70a1f
commit b483804ff4
11 changed files with 32 additions and 2 deletions

View File

@@ -65,7 +65,9 @@ typedef enum chain_kind_e {
CHAIN_KIND_KARDIACHAIN,
CHAIN_KIND_WETHIO,
CHAIN_KIND_OKC,
CHAIN_KIND_CUBE
CHAIN_KIND_CUBE,
CHAIN_KIND_SHIDEN,
CHAIN_KIND_ASTAR
} chain_kind_t;
typedef struct chain_config_s {

View File

@@ -290,6 +290,12 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_CUBE:
numTokens = NUM_TOKENS_CUBE;
break;
case CHAIN_KIND_SHIDEN:
numTokens = NUM_TOKENS_SHIDEN;
break;
case CHAIN_KIND_ASTAR:
numTokens = NUM_TOKENS_ASTAR;
break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
@@ -422,6 +428,12 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_CUBE:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_CUBE[i]);
break;
case CHAIN_KIND_SHIDEN:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_SHIDEN[i]);
break;
case CHAIN_KIND_ASTAR:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_ASTAR[i]);
break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;

View File

@@ -208,4 +208,8 @@ const tokenDefinition_t const TOKENS_OKC[NUM_TOKENS_OKC] = {};
const tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE] = {};
const tokenDefinition_t const TOKENS_ASTAR[NUM_TOKENS_ASTAR] = {};
const tokenDefinition_t const TOKENS_SHIDEN[NUM_TOKENS_SHIDEN] = {};
#endif

View File

@@ -108,6 +108,8 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#define NUM_TOKENS_WETHIO 0
#define NUM_TOKENS_OKC 0
#define NUM_TOKENS_CUBE 0
#define NUM_TOKENS_ASTAR 0
#define NUM_TOKENS_SHIDEN 0
extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
@@ -151,6 +153,8 @@ 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];
extern tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE];
extern tokenDefinition_t const TOKENS_ASTAR[NUM_TOKENS_ASTAR];
extern tokenDefinition_t const TOKENS_SHIDEN[NUM_TOKENS_SHIDEN];
#endif /* HAVE_TOKENS_LIST */