Skip to content

Commit

Permalink
chore: chunked logs update to check better the function
Browse files Browse the repository at this point in the history
  • Loading branch information
afa7789 committed Nov 25, 2024
1 parent e5e2e7d commit 3497b0a
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions zk/l1infotree/updater_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,33 @@ func GetDbTx() (tx kv.RwTx, cleanup func()) {
}

func TestUpdater_chunkLogs(t *testing.T) {

logs := []types.Log{
{
Address: common.Address{},
Topics: []common.Hash{},
Data: []byte{},
Topics: []common.Hash{common.HexToHash("0x01")},
Data: []byte{0x01},
},
{
Address: common.Address{},
Topics: []common.Hash{common.HexToHash("0x02")},
Data: []byte{0x02},
},
{
Address: common.Address{},
Topics: []common.Hash{common.HexToHash("0x03")},
Data: []byte{0x03},
},
{
Address: common.Address{},
Topics: []common.Hash{common.HexToHash("0x04")},
Data: []byte{0x04},
},
}

chunkedLogs := chunkLogs(logs, 1)
assert.Len(t, chunkedLogs, 1)
chunkedLogs := chunkLogs(logs, 2)
assert.Len(t, chunkedLogs, 2)
assert.Len(t, chunkedLogs[0], 2)
assert.Len(t, chunkedLogs[1], 2)
}

func TestUpdater_initialiseL1InfoTree(t *testing.T) {
Expand Down

0 comments on commit 3497b0a

Please sign in to comment.