Skip to content

Commit

Permalink
Fix chain/gen randomness getting (test only)
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Jun 1, 2021
1 parent 8072573 commit 9d07158
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chain/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,10 @@ func (mca mca) ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipS
return nil, xerrors.Errorf("loading tipset key: %w", err)
}

if randEpoch > build.UpgradeHyperdriveHeight {
return mca.sm.ChainStore().GetChainRandomnessLookingForward(ctx, pts.Cids(), personalization, randEpoch, entropy)
}

return mca.sm.ChainStore().GetChainRandomnessLookingBack(ctx, pts.Cids(), personalization, randEpoch, entropy)
}

Expand All @@ -599,6 +603,10 @@ func (mca mca) ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSe
return nil, xerrors.Errorf("loading tipset key: %w", err)
}

if randEpoch > build.UpgradeHyperdriveHeight {
return mca.sm.ChainStore().GetBeaconRandomnessLookingForward(ctx, pts.Cids(), personalization, randEpoch, entropy)
}

return mca.sm.ChainStore().GetBeaconRandomnessLookingBack(ctx, pts.Cids(), personalization, randEpoch, entropy)
}

Expand Down

0 comments on commit 9d07158

Please sign in to comment.