fix checkpoint test
This commit is contained in:
parent
a0353c8627
commit
63487e1d69
@ -45,7 +45,7 @@ func TestChainCheckpoint(t *testing.T) {
|
|||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
|
|
||||||
// Then move the head back.
|
// Then move the head back.
|
||||||
err = cs.SetHead(checkpoint)
|
err = cs.SetHead(ctx, checkpoint)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Verify it worked.
|
// Verify it worked.
|
||||||
@ -53,7 +53,7 @@ func TestChainCheckpoint(t *testing.T) {
|
|||||||
require.True(t, head.Equals(checkpoint))
|
require.True(t, head.Equals(checkpoint))
|
||||||
|
|
||||||
// And checkpoint it.
|
// And checkpoint it.
|
||||||
err = cs.SetCheckpoint(checkpoint)
|
err = cs.SetCheckpoint(ctx, checkpoint)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Let the second miner miner mine a fork
|
// Let the second miner miner mine a fork
|
||||||
@ -82,10 +82,10 @@ func TestChainCheckpoint(t *testing.T) {
|
|||||||
require.True(t, head.Equals(last))
|
require.True(t, head.Equals(last))
|
||||||
|
|
||||||
// Setting a checkpoint on the other fork should fail.
|
// Setting a checkpoint on the other fork should fail.
|
||||||
err = cs.SetCheckpoint(checkpoint)
|
err = cs.SetCheckpoint(ctx, checkpoint)
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
|
|
||||||
// Setting a checkpoint on this fork should succeed.
|
// Setting a checkpoint on this fork should succeed.
|
||||||
err = cs.SetCheckpoint(checkpointParents)
|
err = cs.SetCheckpoint(ctx, checkpointParents)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user