Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add baseFeePerGas to block header from rpc + fix readme typo #1330

Merged
merged 4 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ and open a new PR with the changes. Be sure to update both the diagram and the e

## Getting Started

See our [monorepo](config/monorepo.md) documentation to get started on setting up the respository and installing dependencies. The [config](config/) folder gives an overview on shared configuration and scripts between packages.
See our [monorepo](config/monorepo.md) documentation to get started on setting up the repository and installing dependencies. The [config](config/) folder gives an overview on shared configuration and scripts between packages.

# EthereumJS

Expand Down
9 changes: 9 additions & 0 deletions packages/block/src/header-from-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export default function blockHeaderFromRpc(blockParams: any, options?: BlockOpti
nonce,
} = blockParams

let baseFeePerGas

// Check if the field baseFeePerGas is present in the block.
// This field was introduced after: https://eips.ethereum.org/EIPS/eip-1559
if ('baseFeePerGas' in blockParams) {
baseFeePerGas = blockParams.baseFeePerGas
}

const blockHeader = BlockHeader.fromHeaderData(
{
parentHash,
Expand All @@ -45,6 +53,7 @@ export default function blockHeaderFromRpc(blockParams: any, options?: BlockOpti
extraData,
mixHash,
nonce,
baseFeePerGas,
},
options
)
Expand Down