Remove detailed fees display

This commit is contained in:
pscott
2021-06-24 18:46:18 +02:00
parent a944387c11
commit 0294c5e60f
9 changed files with 7 additions and 110 deletions

View File

@@ -251,32 +251,8 @@ void prepareAndCopyFees(txInt256_t *BEGasPrice, txInt256_t *BEGasLimit, char *di
feesToString(&rawFee, displayBuffer, displayBufferSize);
}
static void prepareAndCopyDetailedFees() {
uint256_t rawPriorityFee = {0};
uint256_t rawMaxFee = {0};
uint256_t rawBaseFee = {0};
// Compute the priorityFee and the maxFee.
computeFees(&tmpContent.txContent.maxPriorityFeePerGas, &tmpContent.txContent.startgas, &rawPriorityFee);
computeFees(&tmpContent.txContent.gasprice, &tmpContent.txContent.startgas, &rawMaxFee);
// Substract priorityFee from maxFee -> this is the baseFee
minus256(&rawMaxFee, &rawPriorityFee, &rawBaseFee);
// Transform priorityFee to string (with a ticker).
PRINTF("Computing priority fee\n");
feesToString(&rawPriorityFee, strings.common.priorityFee, sizeof(strings.common.priorityFee));
PRINTF("Computing base fee\n");
// Transform priorityFee to string (with a ticker).
feesToString(&rawBaseFee, strings.common.maxFee, sizeof(strings.common.maxFee));
}
void prepareFeeDisplay() {
if (N_storage.displayFeeDetails) {
prepareAndCopyDetailedFees();
} else {
prepareAndCopyFees(&tmpContent.txContent.gasprice, &tmpContent.txContent.startgas, strings.common.maxFee, sizeof(strings.common.maxFee));
}
prepareAndCopyFees(&tmpContent.txContent.gasprice, &tmpContent.txContent.startgas, strings.common.maxFee, sizeof(strings.common.maxFee));
}
uint32_t get_chainID() {

View File

@@ -216,20 +216,6 @@ UX_STEP_INIT(
display_next_plugin_item(false);
});
UX_STEP_NOCB(
ux_approval_base_fee_step,
bnnn_paging,
{
.title = "Base Fee",
.text = strings.common.maxFee,
});
UX_STEP_NOCB(
ux_approval_priority_fee_step,
bnnn_paging,
{
.title = "Priority Fee",
.text = strings.common.priorityFee,
});
UX_STEP_NOCB(
ux_approval_fees_step,
bnnn_paging,
@@ -321,12 +307,7 @@ void ux_approve_tx(bool fromPlugin) {
if (id != ETHEREUM_MAINNET_CHAINID) {
ux_approval_tx_flow[step++] = &ux_approval_chainid_step;
}
if (txContext.txType == EIP1559 && N_storage.displayFeeDetails) {
ux_approval_tx_flow[step++] = &ux_approval_base_fee_step;
ux_approval_tx_flow[step++] = &ux_approval_priority_fee_step;
} else {
ux_approval_tx_flow[step++] = &ux_approval_fees_step;
}
ux_approval_tx_flow[step++] = &ux_approval_fees_step;
ux_approval_tx_flow[step++] = &ux_approval_accept_step;
ux_approval_tx_flow[step++] = &ux_approval_reject_step;
ux_approval_tx_flow[step++] = FLOW_END_STEP;