Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a388a66e97 |
@@ -231,11 +231,10 @@ function showTxFee(approvedTx) {
|
|||||||
const feePerGas = BigInt(approvedTx.maxFeePerGas || approvedTx.gasPrice);
|
const feePerGas = BigInt(approvedTx.maxFeePerGas || approvedTx.gasPrice);
|
||||||
// Through formatFee(), as the confirmation screen's fee is, so the same
|
// Through formatFee(), as the confirmation screen's fee is, so the same
|
||||||
// fee reads the same on both. In the native currency of the network shown
|
// fee reads the same on both. In the native currency of the network shown
|
||||||
// above, and at the price on it, as the value is.
|
// above, as the value is.
|
||||||
$("approve-tx-fee").textContent = formatFee(
|
$("approve-tx-fee").textContent = formatFee(
|
||||||
gasLimit * feePerGas,
|
gasLimit * feePerGas,
|
||||||
nativeCurrencyByChainId(approvedTx.chainId),
|
nativeCurrencyByChainId(approvedTx.chainId),
|
||||||
approvedTx.chainId,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let detail =
|
let detail =
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
// The USD value on the approval screen's Value and Network fee lines, for a
|
// The USD value on the approval screen's Value line, for a site's ETH send.
|
||||||
// site's ETH send.
|
|
||||||
//
|
//
|
||||||
// It was worked out from the four-decimal figure the line shows, at the price
|
// It was worked out from the four-decimal figure the line shows, at the price
|
||||||
// on the active network, so the same value read a few cents different here than
|
// on the active network, so the same value read a few cents different here than
|
||||||
// on the confirmation screen, which prices the exact amount at the price on the
|
// on the confirmation screen, which prices the exact amount at the price on the
|
||||||
// transaction's own network, and a transaction on another network than the
|
// transaction's own network, and a transaction on another network than the
|
||||||
// active one was priced at the active one's rate, its fee too
|
// active one was priced at the active one's rate
|
||||||
// (https://git.eeqj.de/sneak/AutistMask/issues/614).
|
// (https://git.eeqj.de/sneak/AutistMask/issues/614).
|
||||||
//
|
//
|
||||||
// Driven through the real approval screen, against a minimal DOM stub in the
|
// Driven through the real approval screen, against a minimal DOM stub in the
|
||||||
@@ -169,24 +168,3 @@ test.each([
|
|||||||
expect(state.currentView).toBe("approve-tx");
|
expect(state.currentView).toBe("approve-tx");
|
||||||
expect(node("approve-tx-value").textContent).toBe(expected);
|
expect(node("approve-tx-value").textContent).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
// The Network fee line is priced on the transaction's network too. 21000 gas at
|
|
||||||
// up to 2 gwei is 0.000042 ETH, $0.08 at $2,000.
|
|
||||||
test.each([
|
|
||||||
[
|
|
||||||
"the fee of a mainnet transaction shown with Sepolia active is priced at the mainnet price",
|
|
||||||
NETWORKS.mainnet.chainId,
|
|
||||||
"sepolia",
|
|
||||||
"0.00004 ETH ($0.08)",
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"the fee of a Sepolia transaction shown with mainnet active has no USD value",
|
|
||||||
NETWORKS.sepolia.chainId,
|
|
||||||
"mainnet",
|
|
||||||
"0.00004 SepoliaETH",
|
|
||||||
],
|
|
||||||
])("%s", async (_label, chainId, networkId, expected) => {
|
|
||||||
await showEthSend(chainId, networkId);
|
|
||||||
expect(state.currentView).toBe("approve-tx");
|
|
||||||
expect(node("approve-tx-fee").textContent).toBe(expected);
|
|
||||||
});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user