Skip to content

Commit

Permalink
Merge pull request METADIUM#42 from cp-yoonjin/dev
Browse files Browse the repository at this point in the history
internal/ethapi: changed 'gasPrice' data type from BigInt to hexUtil.Big
  • Loading branch information
cp-khs authored Apr 25, 2023
2 parents 98e8bc5 + 7bff152 commit 34882d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,14 +693,14 @@ func (s *PublicBlockChainAPI) GetReceiptsByHash(ctx context.Context, blockHash c

// Assign the effective gas price paid
if !s.b.ChainConfig().IsLondon(bigblock) {
fields["effectiveGasPrice"] = txs[index].GasPrice()
fields["effectiveGasPrice"] = (*hexutil.Big)(txs[index].GasPrice())
} else {
header, err := s.b.HeaderByHash(ctx, blockHash)
if err != nil {
return nil, err
}
gasPrice := new(big.Int).Add(header.BaseFee, txs[index].EffectiveGasTipValue(header.BaseFee))
fields["effectiveGasPrice"] = gasPrice
fields["effectiveGasPrice"] = (*hexutil.Big)(gasPrice)
}
// Assign receipt status or post state.
if len(receipt.PostState) > 0 {
Expand Down Expand Up @@ -1697,14 +1697,14 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, ha
}
// Assign the effective gas price paid
if !s.b.ChainConfig().IsLondon(bigblock) {
fields["effectiveGasPrice"] = tx.GasPrice()
fields["effectiveGasPrice"] = (*hexutil.Big)(tx.GasPrice())
} else {
header, err := s.b.HeaderByHash(ctx, blockHash)
if err != nil {
return nil, err
}
gasPrice := new(big.Int).Add(header.BaseFee, tx.EffectiveGasTipValue(header.BaseFee))
fields["effectiveGasPrice"] = gasPrice
fields["effectiveGasPrice"] = (*hexutil.Big)(gasPrice)
}
// Assign receipt status or post state.
if len(receipt.PostState) > 0 {
Expand Down

0 comments on commit 34882d1

Please sign in to comment.