Skip to content

Commit 5fd8356

Browse files
committed
address review comments
1 parent fca406c commit 5fd8356

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

encoding/codecv7_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ func TestCodecV7BatchStandardTestCasesEnableCompression(t *testing.T) {
409409
expectedBlobVersionedHash string
410410
}{
411411
{
412-
name: "no blocks",
413-
txData: []string{},
414-
expectedBlobVersionedHash: "0x018ea63fc2caaef749cedbeb0d890c006692a5507bb184817483bd5067e432b9",
412+
name: "no blocks",
413+
txData: []string{},
414+
creationErr: "no blocks",
415415
},
416416
{
417417
name: "single block, single tx",
@@ -553,9 +553,9 @@ func TestCodecV7BatchStandardTestCasesDisableCompression(t *testing.T) {
553553
expectedBlobVersionedHash string
554554
}{
555555
{
556-
name: "no blocks",
557-
txData: []string{},
558-
expectedBlobVersionedHash: "0x0127467f5062c887d10c72713d76406ef5caebe2df5b1b679a1b5cd812cf395b",
556+
name: "no blocks",
557+
txData: []string{},
558+
creationErr: "no blocks",
559559
},
560560
{
561561
name: "single block, single tx",

encoding/codecv7_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ const (
5353
// * postL1MessageQueueHash 32 bytes32 32 hash of the L1 message queue at the end of this batch
5454
// * initialL2BlockNumber 8 uint64 64 The initial L2 block number in this batch
5555
// * numBlocks 2 uint16 72 The number of blocks in this batch
56-
// * block[0] 52 DABlock7 74 The first block in this batch
57-
// * block[i] 52 DABlock7 74+52*i The (i+1)th block in this batch
58-
// * block[n-1] 52 DABlock7 74+52*(n-1) The last block in this batch
56+
// * block[0] 52 DABlock7 74 The first block in this batch
57+
// * block[i] 52 DABlock7 74+52*i The (i+1)th block in this batch
58+
// * block[n-1] 52 DABlock7 74+52*(n-1) The last block in this batch
5959
// * l2Transactions dynamic bytes 74+52*n L2 transactions for this batch
6060

6161
const (
@@ -517,7 +517,7 @@ func encodeSize3Bytes(data uint32) []byte {
517517
// The function calls the blockCallBack for each block with the block and the corresponding daBlock.
518518
func iterateAndVerifyBlocksAndL1Messages(prevL1MessageQueueHash, postL1MessageQueueHash common.Hash, blocks []*Block, totalL1MessagePoppedBefore *uint64, initialL2BlockNumberCallback func(initialL2BlockNumber uint64), blockCallBack func(block *Block, daBlock *daBlockV7) error) error {
519519
if len(blocks) == 0 {
520-
return nil
520+
return errors.New("no blocks to iterate")
521521
}
522522

523523
if !blocks[0].Header.Number.IsUint64() {

0 commit comments

Comments
 (0)