Skip to content

Commit 83d3b5b

Browse files
Fix swap fees ticker fallback
1 parent 729214f commit 83d3b5b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/handle_get_printable_amount.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ void handle_get_printable_amount(get_printable_amount_parameters_t* params,
3131
}
3232
// If the amount is a fee, the ticker should be the chain's native currency
3333
if (params->is_fee) {
34+
// fallback mechanism in the absence of chain ID in swap config
35+
if (chain_id == 0) {
36+
chain_id = config->chainId;
37+
}
3438
strlcpy(ticker, get_displayable_ticker(&chain_id, config), sizeof(ticker));
3539
decimals = WEI_TO_ETHER;
3640
}

src/handle_swap_sign_transaction.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ bool copy_transaction_parameters(create_transaction_parameters_t* sign_transacti
4949
return false;
5050
}
5151

52+
// fallback mechanism in the absence of chain ID in swap config
53+
if (chain_id == 0) {
54+
chain_id = config->chainId;
55+
}
5256
// If the amount is a fee, its value is nominated in ETH even if we're doing an ERC20 swap
5357
strlcpy(ticker, get_displayable_ticker(&chain_id, config), sizeof(ticker));
5458
decimals = WEI_TO_ETHER;

0 commit comments

Comments
 (0)