Skip to content

Commit

Permalink
update loader
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Nov 17, 2023
1 parent ab72def commit 4685e19
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions engine/execution/ingestion/loader/unfinalized_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ var _ ingestion.BlockLoader = (*loader.UnfinalizedLoader)(nil)
func TestLoadingUnfinalizedBlocks(t *testing.T) {
ps := mocks.NewProtocolState()

// Genesis <- A <- B <- C (finalized)
chain, result, seal := unittest.ChainFixture(4)
genesis, blockA, blockB, blockC := chain[0], chain[1], chain[2], chain[3]
// Genesis <- A <- B <- C (finalized) <- D
chain, result, seal := unittest.ChainFixture(5)
genesis, blockA, blockB, blockC, blockD :=
chain[0], chain[1], chain[2], chain[3], chain[4]

logChain(chain)

require.NoError(t, ps.Bootstrap(genesis, result, seal))
require.NoError(t, ps.Extend(blockA))
require.NoError(t, ps.Extend(blockB))
require.NoError(t, ps.Extend(blockC))
require.NoError(t, ps.Extend(blockD))
require.NoError(t, ps.Finalize(blockC.ID()))

es := new(stateMock.FinalizedExecutionState)
Expand All @@ -48,5 +50,6 @@ func TestLoadingUnfinalizedBlocks(t *testing.T) {
blockA.ID(),
blockB.ID(),
blockC.ID(),
blockD.ID(),
}, unexecuted)
}

0 comments on commit 4685e19

Please sign in to comment.