mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
core/block: add BlobCount function
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
b135da2eac
commit
3982888562
1 changed files with 8 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ import (
|
|||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/ethereum/go-verkle"
|
||||
)
|
||||
|
|
@ -367,6 +368,13 @@ func (b *Block) Uncles() []*Header { return b.uncles }
|
|||
func (b *Block) Transactions() Transactions { return b.transactions }
|
||||
func (b *Block) Withdrawals() Withdrawals { return b.withdrawals }
|
||||
|
||||
func (b *Block) BlobCount() uint64 {
|
||||
if b.header.BlobGasUsed == nil {
|
||||
return 0
|
||||
}
|
||||
return *b.header.BlobGasUsed / params.BlobTxBlobGasPerBlob
|
||||
}
|
||||
|
||||
func (b *Block) Transaction(hash common.Hash) *Transaction {
|
||||
for _, transaction := range b.transactions {
|
||||
if transaction.Hash() == hash {
|
||||
|
|
|
|||
Loading…
Reference in a new issue