Fix swap fees ticker fallback
This commit is contained in:
@@ -31,6 +31,10 @@ void handle_get_printable_amount(get_printable_amount_parameters_t* params,
|
||||
}
|
||||
// If the amount is a fee, the ticker should be the chain's native currency
|
||||
if (params->is_fee) {
|
||||
// fallback mechanism in the absence of chain ID in swap config
|
||||
if (chain_id == 0) {
|
||||
chain_id = config->chainId;
|
||||
}
|
||||
strlcpy(ticker, get_displayable_ticker(&chain_id, config), sizeof(ticker));
|
||||
decimals = WEI_TO_ETHER;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,10 @@ bool copy_transaction_parameters(create_transaction_parameters_t* sign_transacti
|
||||
return false;
|
||||
}
|
||||
|
||||
// fallback mechanism in the absence of chain ID in swap config
|
||||
if (chain_id == 0) {
|
||||
chain_id = config->chainId;
|
||||
}
|
||||
// If the amount is a fee, its value is nominated in ETH even if we're doing an ERC20 swap
|
||||
strlcpy(ticker, get_displayable_ticker(&chain_id, config), sizeof(ticker));
|
||||
decimals = WEI_TO_ETHER;
|
||||
|
||||
Reference in New Issue
Block a user