@@ -53,8 +53,8 @@ type Compressor interface {
5353type ChannelOut interface {
5454 ID () ChannelID
5555 Reset () error
56- AddBlock (* rollup.Config , * types.Block ) ( uint64 , error )
57- AddSingularBatch (* SingularBatch , uint64 ) ( uint64 , error )
56+ AddBlock (* rollup.Config , * types.Block ) error
57+ AddSingularBatch (* SingularBatch , uint64 ) error
5858 InputBytes () int
5959 ReadyBytes () int
6060 Flush () error
@@ -108,14 +108,14 @@ func (co *SingularChannelOut) Reset() error {
108108// and an error if there is a problem adding the block. The only sentinel error
109109// that it returns is ErrTooManyRLPBytes. If this error is returned, the channel
110110// should be closed and a new one should be made.
111- func (co * SingularChannelOut ) AddBlock (rollupCfg * rollup.Config , block * types.Block ) ( uint64 , error ) {
111+ func (co * SingularChannelOut ) AddBlock (rollupCfg * rollup.Config , block * types.Block ) error {
112112 if co .closed {
113- return 0 , ErrChannelOutAlreadyClosed
113+ return ErrChannelOutAlreadyClosed
114114 }
115115
116116 batch , l1Info , err := BlockToSingularBatch (rollupCfg , block )
117117 if err != nil {
118- return 0 , err
118+ return err
119119 }
120120 return co .AddSingularBatch (batch , l1Info .SequenceNumber )
121121}
@@ -128,26 +128,26 @@ func (co *SingularChannelOut) AddBlock(rollupCfg *rollup.Config, block *types.Bl
128128// AddSingularBatch should be used together with BlockToBatch if you need to access the
129129// BatchData before adding a block to the channel. It isn't possible to access
130130// the batch data with AddBlock.
131- func (co * SingularChannelOut ) AddSingularBatch (batch * SingularBatch , _ uint64 ) ( uint64 , error ) {
131+ func (co * SingularChannelOut ) AddSingularBatch (batch * SingularBatch , _ uint64 ) error {
132132 if co .closed {
133- return 0 , ErrChannelOutAlreadyClosed
133+ return ErrChannelOutAlreadyClosed
134134 }
135135
136136 // We encode to a temporary buffer to determine the encoded length to
137137 // ensure that the total size of all RLP elements is less than or equal to MAX_RLP_BYTES_PER_CHANNEL
138138 var buf bytes.Buffer
139139 if err := rlp .Encode (& buf , NewBatchData (batch )); err != nil {
140- return 0 , err
140+ return err
141141 }
142142 if co .rlpLength + buf .Len () > MaxRLPBytesPerChannel {
143- return 0 , fmt .Errorf ("could not add %d bytes to channel of %d bytes, max is %d. err: %w" ,
143+ return fmt .Errorf ("could not add %d bytes to channel of %d bytes, max is %d. err: %w" ,
144144 buf .Len (), co .rlpLength , MaxRLPBytesPerChannel , ErrTooManyRLPBytes )
145145 }
146146 co .rlpLength += buf .Len ()
147147
148148 // avoid using io.Copy here, because we need all or nothing
149- written , err := co .compress .Write (buf .Bytes ())
150- return uint64 ( written ), err
149+ _ , err := co .compress .Write (buf .Bytes ())
150+ return err
151151}
152152
153153// InputBytes returns the total amount of RLP-encoded input bytes.
0 commit comments