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