Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add waltonchain #418

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added icons/nanos_app_waltonchain.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/nanox_app_waltonchain.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions makefile_conf/chain/waltonchain.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
APP_LOAD_PARAMS += --path "44'/999999'"
DEFINES += CHAINID_UPCASE=\"WALTONCHAIN\" CHAINID_COINNAME=\"WTC\" CHAIN_KIND=CHAIN_KIND_WALTONCHAIN CHAIN_ID=15
APPNAME = "WaltonChain"
3 changes: 2 additions & 1 deletion src/chainConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ typedef enum chain_kind_e {
CHAIN_KIND_TECRA,
CHAIN_KIND_APOTHEMNETWORK,
CHAIN_KIND_ID4GOOD,
CHAIN_KIND_OASYS
CHAIN_KIND_OASYS,
CHAIN_KIND_WALTONCHAIN
} chain_kind_t;

typedef struct chain_config_s {
Expand Down
6 changes: 6 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_OASYS:
numTokens = NUM_TOKENS_OASYS;
break;
case CHAIN_KIND_WALTONCHAIN:
numTokens = NUM_TOKENS_WALTONCHAIN;
break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
Expand Down Expand Up @@ -459,6 +462,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_OASYS:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_OASYS[i]);
break;
case CHAIN_KIND_WALTONCHAIN:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_WALTONCHAIN[i]);
break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;
Expand Down
2 changes: 2 additions & 0 deletions src/tokens.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,6 @@ const tokenDefinition_t const TOKENS_APOTHEMNETWORK[NUM_TOKENS_APOTHEMNETWORK] =

const tokenDefinition_t const TOKENS_OASYS[NUM_TOKENS_OASYS] = {};

const tokenDefinition_t const TOKENS_WALTONCHAIN[NUM_TOKENS_WALTONCHAIN] = {};

#endif
2 changes: 2 additions & 0 deletions src/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#define NUM_TOKENS_TECRA 0
#define NUM_TOKENS_APOTHEMNETWORK 0
#define NUM_TOKENS_OASYS 0
#define NUM_TOKENS_WALTONCHAIN 0

extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
Expand Down Expand Up @@ -177,6 +178,7 @@ extern tokenDefinition_t const TOKENS_MULTIVAC[NUM_TOKENS_MULTIVAC];
extern tokenDefinition_t const TOKENS_TECRA[NUM_TOKENS_TECRA];
extern tokenDefinition_t const TOKENS_APOTHEMNETWORK[NUM_TOKENS_APOTHEMNETWORK];
extern tokenDefinition_t const TOKENS_OASYS[NUM_TOKENS_OASYS];
extern tokenDefinition_t const TOKENS_WALTONCHAIN[NUM_TOKENS_WALTONCHAIN];

#endif /* HAVE_TOKENS_LIST */

Expand Down