mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
graphql: add blobGasUsed,excessBlobGas for block
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
0add9d0175
commit
05070803a8
1 changed files with 24 additions and 0 deletions
|
|
@ -1067,6 +1067,30 @@ func (b *Block) Withdrawals(ctx context.Context) (*[]*Withdrawal, error) {
|
||||||
return &ret, nil
|
return &ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *Block) BlobGasUsed(ctx context.Context) (*hexutil.Uint64, error) {
|
||||||
|
header, err := b.resolveHeader(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if header.BlobGasUsed == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
ret := hexutil.Uint64(*header.BlobGasUsed)
|
||||||
|
return &ret, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (b *Block) ExcessBlobGas(ctx context.Context) (*hexutil.Uint64, error) {
|
||||||
|
header, err := b.resolveHeader(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if header.ExcessBlobGas == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
ret := hexutil.Uint64(*header.ExcessBlobGas)
|
||||||
|
return &ret, nil
|
||||||
|
}
|
||||||
|
|
||||||
// BlockFilterCriteria encapsulates criteria passed to a `logs` accessor inside
|
// BlockFilterCriteria encapsulates criteria passed to a `logs` accessor inside
|
||||||
// a block.
|
// a block.
|
||||||
type BlockFilterCriteria struct {
|
type BlockFilterCriteria struct {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue