Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBatch ¶
TODO: this is not currently called anywhere but will be useful for testing.
func NewBatchBuilder ¶
func NewBatchBuilder(cfg Config, encoder VersionedDataEncoder) *batchBuilder
Types ¶
type BatchV0Encoder ¶
type BatchV0Encoder struct {
// contains filtered or unexported fields
}
func NewBatchV0Encoder ¶
func NewBatchV0Encoder(cfg V0Config) *BatchV0Encoder
func (*BatchV0Encoder) ProcessBlock ¶
func (e *BatchV0Encoder) ProcessBlock(block *types.Block, isNewEpoch bool) error
Processes a block. If the block is non-empty and fits, add it to the current sub-batch. If the block belongs to a new epoch, close the current sub-batch and start a new one.
func (*BatchV0Encoder) Reset ¶
func (e *BatchV0Encoder) Reset()
type DecodeTxBatchError ¶
type DecodeTxBatchError struct {
// contains filtered or unexported fields
}
func (*DecodeTxBatchError) Error ¶
func (e *DecodeTxBatchError) Error() string
type InvalidBlockError ¶
type InvalidBlockError struct{ Msg string }
func (InvalidBlockError) Error ¶
func (e InvalidBlockError) Error() string
type VersionedDataEncoder ¶
type VersionedDataEncoder interface { // Returns an encoded batch if one is ready (or if forced). // If not forced, an error is returned if one cannot yet be built. GetBatch(force bool) ([]byte, error) // Processes a block, adding its data to the current batch. // Returns an `errBatchFull` if the block would cause the batch to exceed the target size. // Returns an error if the block could not be processed. ProcessBlock(block *ethTypes.Block, isNewEpoch bool) error // Resets the encoder, discarding all buffered data. Reset() }
Click to show internal directories.
Click to hide internal directories.