2021-11-14 04:08:52 +00:00
|
|
|
package interfaces
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/ledgerwatch/erigon-lib/kv"
|
|
|
|
"github.com/ledgerwatch/erigon/common"
|
|
|
|
"github.com/ledgerwatch/erigon/core/types"
|
2021-12-14 10:13:17 +00:00
|
|
|
"github.com/ledgerwatch/erigon/rlp"
|
2021-11-14 04:08:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type BlockReader interface {
|
|
|
|
BlockWithSenders(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) (block *types.Block, senders []common.Address, err error)
|
|
|
|
}
|
2021-11-29 03:43:19 +00:00
|
|
|
|
2021-12-05 02:03:08 +00:00
|
|
|
type HeaderReader interface {
|
|
|
|
Header(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (*types.Header, error)
|
|
|
|
HeaderByNumber(ctx context.Context, tx kv.Getter, blockHeight uint64) (*types.Header, error)
|
|
|
|
}
|
|
|
|
|
2021-12-14 10:13:17 +00:00
|
|
|
type BodyReader interface {
|
|
|
|
Body(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) (body *types.Body, err error)
|
|
|
|
BodyRlp(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) (bodyRlp rlp.RawValue, err error)
|
|
|
|
}
|
|
|
|
|
2021-11-29 03:43:19 +00:00
|
|
|
type FullBlockReader interface {
|
|
|
|
BlockReader
|
2021-12-14 10:13:17 +00:00
|
|
|
BodyReader
|
2021-12-05 02:03:08 +00:00
|
|
|
HeaderReader
|
2021-11-29 03:43:19 +00:00
|
|
|
}
|