Commit 055f63fc authored by clabby's avatar clabby

nit: Change interface names

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