Commit 055f63fc authored by clabby's avatar clabby

nit: Change interface names

parent 6092a2b9
...@@ -42,8 +42,8 @@ type GarbageChannelCfg struct { ...@@ -42,8 +42,8 @@ type GarbageChannelCfg struct {
malformRLP bool malformRLP bool
} }
// WriterApi is the interface shared between `zlib.Writer` and `gzip.Writer` // Writer is the interface shared between `zlib.Writer` and `gzip.Writer`
type WriterApi interface { type Writer interface {
Close() error Close() error
Flush() error Flush() error
Reset(io.Writer) Reset(io.Writer)
...@@ -51,7 +51,7 @@ type WriterApi interface { ...@@ -51,7 +51,7 @@ type WriterApi interface {
} }
// Compile-time check for derive.ChannelOutApi interface implementation for the GarbageChannelOut type. // Compile-time check for derive.ChannelOutApi interface implementation for the GarbageChannelOut type.
var _ derive.ChannelOutApi = (*GarbageChannelOut)(nil) var _ derive.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
...@@ -63,7 +63,7 @@ type GarbageChannelOut struct { ...@@ -63,7 +63,7 @@ type GarbageChannelOut struct {
rlpLength int rlpLength int
// Compressor stage. Write input data to it // Compressor stage. Write input data to it
compress WriterApi compress Writer
// post compression buffer // post compression buffer
buf bytes.Buffer buf bytes.Buffer
...@@ -91,7 +91,7 @@ func NewGarbageChannelOut(cfg *GarbageChannelCfg) (*GarbageChannelOut, error) { ...@@ -91,7 +91,7 @@ func NewGarbageChannelOut(cfg *GarbageChannelCfg) (*GarbageChannelOut, error) {
} }
// Optionally use zlib or gzip compression // Optionally use zlib or gzip compression
var compress WriterApi var compress Writer
if cfg.useInvalidCompression { if cfg.useInvalidCompression {
compress, err = gzip.NewWriterLevel(&c.buf, gzip.BestCompression) compress, err = gzip.NewWriterLevel(&c.buf, gzip.BestCompression)
} else { } else {
......
...@@ -61,7 +61,7 @@ type L2Batcher struct { ...@@ -61,7 +61,7 @@ type L2Batcher struct {
l1Signer types.Signer l1Signer types.Signer
l2ChannelOut derive.ChannelOutApi l2ChannelOut derive.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.ChannelOutApi var ch derive.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,8 +17,8 @@ import ( ...@@ -17,8 +17,8 @@ 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")
// ChannelOutApi is the interface implemented by ChannelOut // ChannelOutIface is the interface implemented by ChannelOut
type ChannelOutApi interface { type ChannelOutIface interface {
ID() ChannelID ID() ChannelID
Reset() error Reset() error
AddBlock(block *types.Block) error AddBlock(block *types.Block) error
...@@ -29,7 +29,7 @@ type ChannelOutApi interface { ...@@ -29,7 +29,7 @@ type ChannelOutApi interface {
} }
// Compile-time check for ChannelOutApi interface implementation for the ChannelOut type. // Compile-time check for ChannelOutApi interface implementation for the ChannelOut type.
var _ ChannelOutApi = (*ChannelOut)(nil) var _ ChannelOutIface = (*ChannelOut)(nil)
type ChannelOut struct { type ChannelOut struct {
id ChannelID id ChannelID
......
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