Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix access to fee market
  • Loading branch information
mholtzman committed Sep 1, 2023
commit e279e8d7f4d05788a485c5c6cbf73889488b488e
4 changes: 3 additions & 1 deletion app/tray/Account/Requests/TransactionRequest/TxFee/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class TxFee extends React.Component {
const serializedTransaction = utils.serializeTransaction(tx)

// Get current Ethereum gas price
const ethBaseFee = this.store('main.networksMeta.ethereum', 1, 'gas.fees.nextBaseFee')
const feeMarket = this.store('main.networksMeta.ethereum', 1, 'gas.fees') || {}
const { nextBaseFee: ethBaseFee } = feeMarket

const l1DataFee = calculateOptimismL1DataFee(serializedTransaction, ethBaseFee)

// Compute the L2 execution fee
Expand Down
9 changes: 5 additions & 4 deletions resources/Components/Monitor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,16 @@ class ChainSummaryComponent extends Component {
}))
}

feeEstimatesUSD({ chainId, displayFeeMarket, gasPrice }) {
feeEstimatesUSD({ chainId, gasPrice }) {
const type = 'ethereum'
const currentSymbol = this.store('main.networksMeta', type, chainId, 'nativeCurrency', 'symbol') || 'ETH'
const feeMarket = this.store('main.networksMeta', type, chainId, 'gas.fees')

if (!displayFeeMarket) {
if (!feeMarket) {
return this.txEstimates(type, chainId, gasPrice, null, currentSymbol)
}

const { nextBaseFee, maxPriorityFeePerGas } = this.store('main.networksMeta', type, chainId, 'gas.fees')
const { nextBaseFee, maxPriorityFeePerGas } = feeMarket
const calculatedFees = {
actualBaseFee: roundGwei(weiToGwei(hexToInt(nextBaseFee))),
priorityFee: levelDisplay(maxPriorityFeePerGas)
Expand Down Expand Up @@ -278,7 +279,7 @@ class ChainSummaryComponent extends Component {
</ClusterRow>
)}
<ClusterRow>
{this.feeEstimatesUSD({ chainId, displayFeeMarket, gasPrice }).map((estimate, i) => {
{this.feeEstimatesUSD({ chainId, gasPrice }).map((estimate, i) => {
return (
<ClusterValue key={i}>
<div className='gasEstimate'>
Expand Down