-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
func TestBlockReader(t *testing.T) {
ch := initChain()
b0 := ch.GenesisBlock()
b1, q1 := newBlock(b0, 2)
ch.AddBlock(b1, q1)
b2, q2 := newBlock(b1, 2)
ch.AddBlock(b2, q2)
b3, q3 := newBlock(b2, 2)
ch.AddBlock(b3, q3)
b4, q4 := newBlock(b3, 2)
ch.AddBlock(b4, q4)
br := ch.NewBlockReader(b2.ID())
blks, err := br.Read()
assert.Nil(t, err)
assert.Equal(t, blks[0].ID(), b3.ID())
assert.False(t, blks[0].Obsolete)
blks, err = br.Read()
assert.Nil(t, err)
assert.Equal(t, blks[0].ID(), b4.ID())
assert.False(t, blks[0].Obsolete)
}=== RUN TestBlockReader
--- FAIL: TestBlockReader (0.00s)
panic: could not find genesis [recovered]
panic: could not find genesis
Metadata
Metadata
Assignees
Labels
No labels