Merge pull request #5805 from filecoin-project/test/mack-rand-sideeffects
mock sealer: Simulate randomness sideeffects
This commit is contained in:
Vendored
+3
@@ -325,6 +325,8 @@ func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorI
|
||||
}
|
||||
|
||||
func generateFakePoStProof(sectorInfo []proof2.SectorInfo, randomness abi.PoStRandomness) []byte {
|
||||
randomness[31] &= 0x3f
|
||||
|
||||
hasher := sha256.New()
|
||||
_, _ = hasher.Write(randomness)
|
||||
for _, info := range sectorInfo {
|
||||
@@ -489,6 +491,7 @@ func (m mockVerif) VerifySeal(svi proof2.SealVerifyInfo) (bool, error) {
|
||||
}
|
||||
|
||||
func (m mockVerif) VerifyWinningPoSt(ctx context.Context, info proof2.WinningPoStVerifyInfo) (bool, error) {
|
||||
info.Randomness[31] &= 0x3f
|
||||
return true, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user