Commit 3b166752 authored by clabby's avatar clabby

Move `ChannelOutIface` to `op-e2e/actions` package

whoops
parent 055f63fc
...@@ -50,8 +50,22 @@ type Writer interface { ...@@ -50,8 +50,22 @@ type Writer interface {
Write([]byte) (int, error) Write([]byte) (int, error)
} }
// Compile-time check for derive.ChannelOutApi interface implementation for the GarbageChannelOut type. // ChannelOutIface is the interface implemented by ChannelOut & GarbageChannelOut
var _ derive.ChannelOutIface = (*GarbageChannelOut)(nil) type ChannelOutIface interface {
ID() derive.ChannelID
Reset() error
AddBlock(block *types.Block) error
ReadyBytes() int
Flush() error
Close() error
OutputFrame(w *bytes.Buffer, maxSize uint64) error
}
// Compile-time check for ChannelOutIface interface implementation for the ChannelOut type.
var _ ChannelOutIface = (*derive.ChannelOut)(nil)
// Compile-time check for ChannelOutIface interface implementation for the GarbageChannelOut type.
var _ ChannelOutIface = (*GarbageChannelOut)(nil)
// GarbageChannelOut is a modified `derive.ChannelOut` that can be configured to behave differently // GarbageChannelOut is a modified `derive.ChannelOut` that can be configured to behave differently
// than the original // than the original
......
...@@ -61,7 +61,7 @@ type L2Batcher struct { ...@@ -61,7 +61,7 @@ type L2Batcher struct {
l1Signer types.Signer l1Signer types.Signer
l2ChannelOut derive.ChannelOutIface l2ChannelOut ChannelOutIface
l2Submitting bool // when the channel out is being submitted, and not safe to write to without resetting l2Submitting bool // when the channel out is being submitted, and not safe to write to without resetting
l2BufferedBlock eth.BlockID l2BufferedBlock eth.BlockID
l2SubmittedBlock eth.BlockID l2SubmittedBlock eth.BlockID
...@@ -125,7 +125,7 @@ func (s *L2Batcher) ActL2BatchBuffer(t Testing) { ...@@ -125,7 +125,7 @@ func (s *L2Batcher) ActL2BatchBuffer(t Testing) {
} }
// Create channel if we don't have one yet // Create channel if we don't have one yet
if s.l2ChannelOut == nil { if s.l2ChannelOut == nil {
var ch derive.ChannelOutIface var ch ChannelOutIface
if s.l2BatcherCfg.GarbageCfg != nil { if s.l2BatcherCfg.GarbageCfg != nil {
ch, err = NewGarbageChannelOut(s.l2BatcherCfg.GarbageCfg) ch, err = NewGarbageChannelOut(s.l2BatcherCfg.GarbageCfg)
} else { } else {
......
...@@ -17,20 +17,6 @@ import ( ...@@ -17,20 +17,6 @@ import (
var ErrNotDepositTx = errors.New("first transaction in block is not a deposit tx") var ErrNotDepositTx = errors.New("first transaction in block is not a deposit tx")
var ErrTooManyRLPBytes = errors.New("batch would cause RLP bytes to go over limit") var ErrTooManyRLPBytes = errors.New("batch would cause RLP bytes to go over limit")
// ChannelOutIface is the interface implemented by ChannelOut
type ChannelOutIface interface {
ID() ChannelID
Reset() error
AddBlock(block *types.Block) error
ReadyBytes() int
Flush() error
Close() error
OutputFrame(w *bytes.Buffer, maxSize uint64) error
}
// Compile-time check for ChannelOutApi interface implementation for the ChannelOut type.
var _ ChannelOutIface = (*ChannelOut)(nil)
type ChannelOut struct { type ChannelOut struct {
id ChannelID id ChannelID
// Frame ID of the next frame to emit. Increment after emitting // Frame ID of the next frame to emit. Increment after emitting
......
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