Commit 55f603e4 authored by Joshua Gutow's avatar Joshua Gutow

op-service/eth: Expose GasLimit from the header in BlockInfo

parent 6cce3728
...@@ -20,6 +20,7 @@ type BlockInfo interface { ...@@ -20,6 +20,7 @@ type BlockInfo interface {
BaseFee() *big.Int BaseFee() *big.Int
ReceiptHash() common.Hash ReceiptHash() common.Hash
GasUsed() uint64 GasUsed() uint64
GasLimit() uint64
// HeaderRLP returns the RLP of the block header as per consensus rules // HeaderRLP returns the RLP of the block header as per consensus rules
// Returns an error if the header RLP could not be written // Returns an error if the header RLP could not be written
...@@ -100,6 +101,10 @@ func (h headerBlockInfo) GasUsed() uint64 { ...@@ -100,6 +101,10 @@ func (h headerBlockInfo) GasUsed() uint64 {
return h.Header.GasUsed return h.Header.GasUsed
} }
func (h headerBlockInfo) GasLimit() uint64 {
return h.Header.GasLimit
}
func (h headerBlockInfo) HeaderRLP() ([]byte, error) { func (h headerBlockInfo) HeaderRLP() ([]byte, error) {
return rlp.EncodeToBytes(h.Header) return rlp.EncodeToBytes(h.Header)
} }
......
...@@ -78,6 +78,10 @@ func (h headerInfo) GasUsed() uint64 { ...@@ -78,6 +78,10 @@ func (h headerInfo) GasUsed() uint64 {
return h.Header.GasUsed return h.Header.GasUsed
} }
func (h headerInfo) GasLimit() uint64 {
return h.Header.GasLimit
}
func (h headerInfo) HeaderRLP() ([]byte, error) { func (h headerInfo) HeaderRLP() ([]byte, error) {
return rlp.EncodeToBytes(h.Header) return rlp.EncodeToBytes(h.Header)
} }
......
...@@ -23,6 +23,7 @@ type MockBlockInfo struct { ...@@ -23,6 +23,7 @@ type MockBlockInfo struct {
InfoBaseFee *big.Int InfoBaseFee *big.Int
InfoReceiptRoot common.Hash InfoReceiptRoot common.Hash
InfoGasUsed uint64 InfoGasUsed uint64
InfoGasLimit uint64
InfoHeaderRLP []byte InfoHeaderRLP []byte
} }
...@@ -66,6 +67,10 @@ func (l *MockBlockInfo) GasUsed() uint64 { ...@@ -66,6 +67,10 @@ func (l *MockBlockInfo) GasUsed() uint64 {
return l.InfoGasUsed return l.InfoGasUsed
} }
func (l *MockBlockInfo) GasLimit() uint64 {
return l.InfoGasLimit
}
func (l *MockBlockInfo) ID() eth.BlockID { func (l *MockBlockInfo) ID() eth.BlockID {
return eth.BlockID{Hash: l.InfoHash, Number: l.InfoNum} return eth.BlockID{Hash: l.InfoHash, Number: l.InfoNum}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment