Merge remote-tracking branch 'origin/master' into fix/version_adjustment

This commit is contained in:
Alexandre Paillier
2022-01-14 17:22:51 +01:00
8 changed files with 19 additions and 8 deletions
+7 -3
View File
@@ -30,7 +30,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'"
APPVERSION_M=1
APPVERSION_N=9
APPVERSION_P=15
APPVERSION_P=16
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION)
@@ -234,9 +234,13 @@ else ifeq ($(CHAIN),polygon)
APP_LOAD_PARAMS += --path "44'/60'"
DEFINES += CHAINID_UPCASE=\"POLYGON\" CHAINID_COINNAME=\"MATIC\" CHAIN_KIND=CHAIN_KIND_POLYGON CHAIN_ID=137
APPNAME = "Polygon"
else ifeq ($(CHAIN),shyft)
APP_LOAD_PARAMS += --path "44'/60'"
DEFINES += CHAINID_UPCASE=\"SHYFT\" CHAINID_COINNAME=\"SHFT\" CHAIN_KIND=CHAIN_KIND_SHYFT CHAIN_ID=7341
APPNAME = "Shyft"
else
ifeq ($(filter clean,$(MAKECMDGOALS)),)
$(error Unsupported CHAIN - use ethereum, ropsten, goerli, moonriver, ethereum_classic, expanse, poa, artis_sigma1, artis_tau1, rsk, rsk_testnet, ubiq, wanchain, kusd, musicoin, pirl, akroma, atheios, callisto, ethersocial, ellaism, ether1, ethergem, gochain, mix, reosc, hpb, tomochain, tobalaba, dexon, volta, ewc, webchain, thundercore, bsc, songbird, polygon)
$(error Unsupported CHAIN - use ethereum, ropsten, goerli, moonriver, ethereum_classic, expanse, poa, artis_sigma1, artis_tau1, rsk, rsk_testnet, ubiq, wanchain, kusd, musicoin, pirl, akroma, atheios, callisto, ethersocial, ellaism, ether1, ethergem, gochain, mix, reosc, hpb, tomochain, tobalaba, dexon, volta, ewc, webchain, thundercore, bsc, songbird, polygon, shyft)
endif
endif
@@ -417,4 +421,4 @@ include $(BOLOS_SDK)/Makefile.rules
dep/%.d: %.c Makefile
listvariants:
@echo VARIANTS CHAIN ethereum ropsten goerli moonriver ethereum_classic expanse poa rsk rsk_testnet ubiq wanchain pirl akroma atheios callisto ethersocial ether1 gochain musicoin ethergem mix ellaism reosc hpb tomochain dexon volta ewc thundercore bsc songbird polygon
@echo VARIANTS CHAIN ethereum ropsten goerli moonriver ethereum_classic expanse poa rsk rsk_testnet ubiq wanchain pirl akroma atheios callisto ethersocial ether1 gochain musicoin ethergem mix ellaism reosc hpb tomochain dexon volta ewc thundercore bsc songbird polygon shyft
Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

+2 -1
View File
@@ -57,7 +57,8 @@ typedef enum chain_kind_e {
CHAIN_KIND_FLARE,
CHAIN_KIND_BSC,
CHAIN_KIND_SONGBIRD,
CHAIN_KIND_POLYGON
CHAIN_KIND_POLYGON,
CHAIN_KIND_SHYFT
} chain_kind_t;
typedef struct chain_config_s {
+6
View File
@@ -266,6 +266,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_POLYGON:
numTokens = NUM_TOKENS_POLYGON;
break;
case CHAIN_KIND_SHYFT:
numTokens = NUM_TOKENS_SHYFT;
break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
@@ -374,6 +377,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_POLYGON:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_POLYGON[i]);
break;
case CHAIN_KIND_SHYFT:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_SHYFT[i]);
break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;
-4
View File
@@ -94,7 +94,6 @@ void pedersen(FieldElement res, /* out */
memcpy(res, hash + 1, FIELD_ELEMENT_SIZE);
}
#ifdef TARGET_NANOX
void shift_stark_hash(FieldElement hash) {
uint256_t hash256, final_hash256;
readu256BE(hash, &hash256);
@@ -112,7 +111,6 @@ void shift_stark_hash(FieldElement hash) {
THROW(0x6A80);
}
}
#endif // TARGET_NANOX
int stark_sign(uint8_t *signature, /* out */
uint8_t *privateKeyData,
@@ -137,9 +135,7 @@ int stark_sign(uint8_t *signature, /* out */
}
pedersen(hash, hash, msg);
PRINTF("Pedersen hash 2 %.*H\n", 32, hash);
#ifdef TARGET_NANOX
shift_stark_hash(hash);
#endif
cx_ecfp_init_private_key(CX_CURVE_Stark256, privateKeyData, 32, &privateKey);
io_seproxyhal_io_heartbeat();
int signatureLength = cx_ecdsa_sign(&privateKey,
+2
View File
@@ -192,4 +192,6 @@ const tokenDefinition_t const TOKENS_MOONRIVER[NUM_TOKENS_MOONRIVER] = {};
const tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON] = {};
const tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT] = {};
#endif
+2
View File
@@ -105,6 +105,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#define NUM_TOKENS_SONGBIRD 0
#define NUM_TOKENS_MOONRIVER 0
#define NUM_TOKENS_POLYGON 0
#define NUM_TOKENS_SHYFT 0
extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
@@ -141,6 +142,7 @@ extern tokenDefinition_t const TOKENS_BSC[NUM_TOKENS_BSC];
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];
#endif /* HAVE_TOKENS_LIST */