diff --git a/turbo/jsonrpc/zkevm_api_test.go b/turbo/jsonrpc/zkevm_api_test.go index 8746a0cecd5..c925b33f182 100644 --- a/turbo/jsonrpc/zkevm_api_test.go +++ b/turbo/jsonrpc/zkevm_api_test.go @@ -404,7 +404,7 @@ func TestGetBatchByNumber(t *testing.T) { assert.NoError(err) err = hDB.WriteBlockGlobalExitRoot(uint64(i+1), gers[i]) assert.NoError(err) - l1InforTree := &zktypes.L1InfoTreeUpdate{ + l1InfoTree := &zktypes.L1InfoTreeUpdate{ Index: uint64(i), GER: gers[i], MainnetExitRoot: mainnetExitRoots[i], @@ -413,7 +413,11 @@ func TestGetBatchByNumber(t *testing.T) { Timestamp: times[i], BlockNumber: uint64(i + 1), } - err = hDB.WriteL1InfoTreeUpdateToGer(l1InforTree) + err = hDB.WriteL1InfoTreeUpdateToGer(l1InfoTree) + assert.NoError(err) + err = hDB.WriteL1InfoTreeUpdate(l1InfoTree) + assert.NoError(err) + err = hDB.WriteL1InfoTreeRoot(hashes[i], uint64(i)) assert.NoError(err) } @@ -435,6 +439,8 @@ func TestGetBatchByNumber(t *testing.T) { assert.NoError(err) } + accInputHash := common.HexToHash("0xd24388f39169a9187e66711e42c8da0dfd9f9089ec46c9a95d29a1f25a58234a") + for i := 0; i < 4; i++ { _, err := erigonDB.WriteHeader(big.NewInt(int64(i+1)), hashes[i], stateRoots[i], txsRoot[i], parentHashes[i], coinBase, times[i], gasLimits[i], params.TestChainConfig) assert.NoError(err) @@ -443,7 +449,6 @@ func TestGetBatchByNumber(t *testing.T) { } tx.Commit() var response []byte - accInputHash := common.HexToHash("0xd24388f39169a9187e66711e42c8da0dfd9f9089ec46c9a95d29a1f25a58234a") response = append(response, accInputHash.Bytes()...) response = append(response, common.Hash{}.Bytes()...) response = append(response, common.FromHex(fmt.Sprintf("0x%064x", 1))...) @@ -480,7 +485,7 @@ func TestGetBatchByNumber(t *testing.T) { assert.Equal(gers[len(gers)-1], batch.GlobalExitRoot) assert.Equal(mainnetExitRoots[len(mainnetExitRoots)-1], batch.MainnetExitRoot) assert.Equal(rollupExitRoots[len(rollupExitRoots)-1], batch.RollupExitRoot) - assert.Equal(common.HexToHash("0x97d1524156ccb46723e5c3c87951da9a390499ba288161d879df1dbc03d49afc"), batch.AccInputHash) + assert.Equal(common.HexToHash("0xebf7acfdbfb4ea6ef8775e7d2246d7d4f3d8c280fbe7649e1b90eb7490ea19e6"), batch.AccInputHash) assert.Equal(common.HexToHash("0x22ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba97"), *batch.SendSequencesTxHash) assert.Equal(rpctypes.ArgUint64(1714427009), batch.Timestamp) assert.Equal(true, batch.Closed) diff --git a/zk/acc_input_hash/acc_input_hash_test.go b/zk/acc_input_hash/acc_input_hash_test.go index d06316a4175..f30a590ce58 100644 --- a/zk/acc_input_hash/acc_input_hash_test.go +++ b/zk/acc_input_hash/acc_input_hash_test.go @@ -142,6 +142,9 @@ func TestCalculateAccInputHash(t *testing.T) { expectError: false, setup: func(t *testing.T) (*MockAccInputHashReader, *MockBlockReader) { reader := &MockAccInputHashReader{ + ForkIds: map[uint64]uint64{ + 4: 7, + }, AccInputHashes: map[uint64]common.Hash{ 4: common.HexToHash("0xbbb"), }, @@ -207,6 +210,7 @@ func TestCalculateAccInputHash(t *testing.T) { reader := &MockAccInputHashReader{ AccInputHashes: map[uint64]common.Hash{}, ForkIds: map[uint64]uint64{ + 0: 7, 1: 7, 2: 7, }, diff --git a/zk/stages/stage_l1_syncer_test.go b/zk/stages/stage_l1_syncer_test.go index dd7bb76e71f..1f65f4d077a 100644 --- a/zk/stages/stage_l1_syncer_test.go +++ b/zk/stages/stage_l1_syncer_test.go @@ -102,6 +102,7 @@ func TestSpawnStageL1Syncer(t *testing.T) { latestBlock := types.NewBlockWithHeader(latestBlockHeader) EthermanMock.EXPECT().BlockByNumber(gomock.Any(), nil).Return(latestBlock, nil).AnyTimes() + EthermanMock.EXPECT().CallContract(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, nil).AnyTimes() filterQuery := ethereum.FilterQuery{ FromBlock: l1FirstBlock,