@ethereumjs/vm / BlockBuilder
• new BlockBuilder(vm
, opts
)
Name | Type |
---|---|
vm |
VM |
opts |
BuildBlockOpts |
• blobGasUsed: bigint
= BIGINT_0
The cumulative blob gas used by the blobs in a block
• gasUsed: bigint
= BIGINT_0
The cumulative gas used by the transactions added to the block.
• get
minerValue(): bigint
bigint
• get
transactionReceipts(): TxReceipt
[]
▸ addTransaction(tx
, __namedParameters?
): Promise
<RunTxResult
>
Run and add a transaction to the block being built. Please note that this modifies the state of the VM. Throws if the transaction’s gasLimit is greater than the remaining gas in the block.
Name | Type |
---|---|
tx |
TypedTransaction |
__namedParameters |
Object |
__namedParameters.skipHardForkValidation? |
boolean |
Promise
<RunTxResult
>
▸ build(sealOpts?
): Promise
<Block
>
This method returns the finalized block. It also:
nonce
and mixHash
,
which is validated along with the block number and difficulty by ethash.
For PoA, please pass blockOption.cliqueSigner
into the buildBlock constructor,
as the signer will be awarded the txs amount spent on gas as they are added.Name | Type |
---|---|
sealOpts? |
SealBlockOpts |
Promise
<Block
>
▸ getStatus(): BlockStatus
BlockStatus
▸ initState(): Promise
<void
>
Promise
<void
>
▸ logsBloom(): Uint8Array
Calculates and returns the logs bloom for the block.
Uint8Array
▸ receiptTrie(): Promise
<Uint8Array
>
Calculates and returns the receiptTrie for the block.
Promise
<Uint8Array
>
▸ revert(): Promise
<void
>
Reverts the checkpoint on the StateManager to reset the state from any transactions that have been run.
Promise
<void
>
▸ transactionsTrie(): Promise
<Uint8Array
>
Calculates and returns the transactionsTrie for the block.
Promise
<Uint8Array
>