Apply clang-format

This commit is contained in:
TamtamHero
2020-12-01 16:20:13 +01:00
parent 1421a74be5
commit 17bd07a346
80 changed files with 8859 additions and 5091 deletions

View File

@@ -6,8 +6,8 @@
#include "string.h"
#include <stdint.h>
void handle_get_printable_amount( get_printable_amount_parameters_t* params, chain_config_t *config) {
void handle_get_printable_amount(get_printable_amount_parameters_t* params,
chain_config_t* config) {
uint8_t decimals;
char ticker[MAX_TICKER_LEN];
memset(params->printable_amount, 0, sizeof(params->printable_amount));
@@ -15,19 +15,27 @@ void handle_get_printable_amount( get_printable_amount_parameters_t* params, cha
PRINTF("Amount is too big, 32 bytes max but buffer has %u bytes", params->amount_length);
os_lib_end();
}
if(!parse_swap_config(params->coin_configuration, params->coin_configuration_length, ticker, &decimals)){
if (!parse_swap_config(params->coin_configuration,
params->coin_configuration_length,
ticker,
&decimals)) {
PRINTF("Error while parsing config\n");
os_lib_end();
}
// If the amount is a fee, its value is nominated in ETH even if we're doing an ERC20 swap
if(params->is_fee){
if (params->is_fee) {
uint8_t ticker_len = strnlen(config->coinName, sizeof(config->coinName));
memcpy(ticker, config->coinName, ticker_len);
ticker[ticker_len] = ' ';
ticker[ticker_len+1] = '\0';
ticker[ticker_len + 1] = '\0';
decimals = WEI_TO_ETHER;
}
amountToString(params->amount, params->amount_length, decimals, ticker, params->printable_amount, sizeof(params->printable_amount));
amountToString(params->amount,
params->amount_length,
decimals,
ticker,
params->printable_amount,
sizeof(params->printable_amount));
}