begin allowing test framework to generate forks

This commit is contained in:
whyrusleeping
2019-10-05 10:04:58 -06:00
parent 1ea23da756
commit fca5a4765d
3 changed files with 66 additions and 11 deletions
+9
View File
@@ -99,6 +99,11 @@ func (a *ChainAPI) ChainGetParentMessages(ctx context.Context, bcid cid.Cid) ([]
return nil, err
}
// genesis block has no parent messages...
if b.Height == 0 {
return nil, nil
}
// TODO: need to get the number of messages better than this
pts, err := a.Chain.LoadTipSet(b.Parents)
if err != nil {
@@ -124,6 +129,10 @@ func (a *ChainAPI) ChainGetParentReceipts(ctx context.Context, bcid cid.Cid) ([]
return nil, err
}
if b.Height == 0 {
return nil, nil
}
// TODO: need to get the number of messages better than this
pts, err := a.Chain.LoadTipSet(b.Parents)
if err != nil {