Clang-format

This commit is contained in:
pscott
2021-05-11 17:18:28 +02:00
parent 3b6fd0d169
commit 8592a22542
8 changed files with 52 additions and 36 deletions

View File

@@ -77,8 +77,7 @@ eth_plugin_result_t eth_plugin_perform_init(uint8_t *contractAddress,
PRINTF("External plugin will be used\n");
dataContext.tokenContext.pluginStatus = ETH_PLUGIN_RESULT_OK;
contractAddress = NULL;
}
else {
} else {
// Search internal plugin list
for (i = 0;; i++) {
uint8_t j;
@@ -87,7 +86,7 @@ eth_plugin_result_t eth_plugin_perform_init(uint8_t *contractAddress,
break;
}
for (j = 0; ((j < INTERNAL_ETH_PLUGINS[i].num_selectors) && (contractAddress != NULL));
j++) {
j++) {
if (memcmp(init->selector, (const void *) PIC(selectors[j]), SELECTOR_SIZE) == 0) {
if ((INTERNAL_ETH_PLUGINS[i].availableCheck == NULL) ||
((PluginAvailableCheck) PIC(INTERNAL_ETH_PLUGINS[i].availableCheck))()) {
@@ -110,8 +109,8 @@ eth_plugin_result_t eth_plugin_perform_init(uint8_t *contractAddress,
eth_plugin_result_t status = ETH_PLUGIN_RESULT_UNAVAILABLE;
if (contractAddress != NULL) {
PRINTF("No plugin available for %.*H\n", 20, contractAddress);
return status;
PRINTF("No plugin available for %.*H\n", 20, contractAddress);
return status;
}
PRINTF("eth_plugin_init\n");

View File

@@ -23,8 +23,7 @@ void plugin_ui_get_id() {
strings.tmp.tmp2,
sizeof(strings.tmp.tmp2));
// Query the original contract for ID if it's not an internal alias
if (!eth_plugin_call(ETH_PLUGIN_QUERY_CONTRACT_ID,
(void *) &pluginQueryContractID)) {
if (!eth_plugin_call(ETH_PLUGIN_QUERY_CONTRACT_ID, (void *) &pluginQueryContractID)) {
PRINTF("Plugin query contract ID call failed\n");
io_seproxyhal_touch_tx_cancel(NULL);
}

View File

@@ -44,21 +44,20 @@ extern tokenDefinition_t const TOKENS_EXTRA[NUM_TOKENS_EXTRA];
#ifndef LEDGER_TEST_PUBLIC_KEY
static const uint8_t const LEDGER_SIGNATURE_PUBLIC_KEY[] = {
// production key 2019-01-11 03:07PM (erc20signer)
0x04,
0x5e, 0x6c, 0x10, 0x20, 0xc1, 0x4d, 0xc4, 0x64, 0x42, 0xfe, 0x89, 0xf9, 0x7c, 0x0b, 0x68, 0xcd,
0xb1, 0x59, 0x76, 0xdc, 0x24, 0xf2, 0x4c, 0x31, 0x6e, 0x7b, 0x30, 0xfe, 0x4e, 0x8c, 0xc7, 0x6b,
0x14, 0x89, 0x15, 0x0c, 0x21, 0x51, 0x4e, 0xbf, 0x44, 0x0f, 0xf5, 0xde, 0xa5, 0x39, 0x3d, 0x83,
0xde, 0x53, 0x58, 0xcd, 0x09, 0x8f, 0xce, 0x8f, 0xd0, 0xf8, 0x1d, 0xaa, 0x94, 0x97, 0x91, 0x83
};
0x04, 0x5e, 0x6c, 0x10, 0x20, 0xc1, 0x4d, 0xc4, 0x64, 0x42, 0xfe, 0x89, 0xf9,
0x7c, 0x0b, 0x68, 0xcd, 0xb1, 0x59, 0x76, 0xdc, 0x24, 0xf2, 0x4c, 0x31, 0x6e,
0x7b, 0x30, 0xfe, 0x4e, 0x8c, 0xc7, 0x6b, 0x14, 0x89, 0x15, 0x0c, 0x21, 0x51,
0x4e, 0xbf, 0x44, 0x0f, 0xf5, 0xde, 0xa5, 0x39, 0x3d, 0x83, 0xde, 0x53, 0x58,
0xcd, 0x09, 0x8f, 0xce, 0x8f, 0xd0, 0xf8, 0x1d, 0xaa, 0x94, 0x97, 0x91, 0x83};
#else
static const uint8_t const LEDGER_SIGNATURE_PUBLIC_KEY[] = {
// test key 2019-01-11 03:07PM (erc20signer)
0x04,
0x20, 0xda, 0x62, 0x00, 0x3c, 0x0c, 0xe0, 0x97, 0xe3, 0x36, 0x44, 0xa1, 0x0f, 0xe4, 0xc3, 0x04,
0x54, 0x06, 0x9a, 0x44, 0x54, 0xf0, 0xfa, 0x9d, 0x4e, 0x84, 0xf4, 0x50, 0x91, 0x42, 0x9b, 0x52,
0x20, 0xaf, 0x9e, 0x35, 0xc0, 0xb2, 0xd9, 0x28, 0x93, 0x80, 0x13, 0x73, 0x07, 0xde, 0x4d, 0xd1,
0xd4, 0x18, 0x42, 0x8c, 0xf2, 0x1a, 0x93, 0xb3, 0x35, 0x61, 0xbb, 0x09, 0xd8, 0x8f, 0xe5, 0x79,
0x04, 0x20, 0xda, 0x62, 0x00, 0x3c, 0x0c, 0xe0, 0x97, 0xe3, 0x36, 0x44, 0xa1,
0x0f, 0xe4, 0xc3, 0x04, 0x54, 0x06, 0x9a, 0x44, 0x54, 0xf0, 0xfa, 0x9d, 0x4e,
0x84, 0xf4, 0x50, 0x91, 0x42, 0x9b, 0x52, 0x20, 0xaf, 0x9e, 0x35, 0xc0, 0xb2,
0xd9, 0x28, 0x93, 0x80, 0x13, 0x73, 0x07, 0xde, 0x4d, 0xd1, 0xd4, 0x18, 0x42,
0x8c, 0xf2, 0x1a, 0x93, 0xb3, 0x35, 0x61, 0xbb, 0x09, 0xd8, 0x8f, 0xe5, 0x79,
};
#endif

View File

@@ -74,7 +74,7 @@ uint32_t u32_from_BE(uint8_t *in, uint8_t size, bool strict) {
bool uint256_to_decimal(const uint8_t *value, char *out, size_t out_len) {
uint16_t n[16];
memcpy((uint8_t*)n, value, 32);
memcpy((uint8_t *) n, value, 32);
uint16_t *p = n;
for (int i = 0; i < 16; i++) {
n[i] = __builtin_bswap16(*p++);

View File

@@ -32,7 +32,7 @@ int local_strchr(char* string, char ch);
// throw if the size is > 4.
uint32_t u32_from_BE(uint8_t* in, uint8_t size, bool strict);
bool uint256_to_decimal(const uint8_t *value, char *out, size_t out_len);
bool uint256_to_decimal(const uint8_t* value, char* out, size_t out_len);
void amountToString(uint8_t* amount,
uint8_t amount_len,