From d9923125ff34bde40b775b77a299e183d91cd7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 12 Mar 2021 17:33:43 +0100 Subject: [PATCH 1/2] mock sealer: Simulate randomness sideeffects --- extern/sector-storage/mock/mock.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extern/sector-storage/mock/mock.go b/extern/sector-storage/mock/mock.go index 82fce4b19..17e5f26f1 100644 --- a/extern/sector-storage/mock/mock.go +++ b/extern/sector-storage/mock/mock.go @@ -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 { From b74b1658b29528eccf979b99bfa302ab04c7b81b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 12 Mar 2021 09:05:34 -0800 Subject: [PATCH 2/2] test: mock proof side effects on verify as well --- extern/sector-storage/mock/mock.go | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/sector-storage/mock/mock.go b/extern/sector-storage/mock/mock.go index 17e5f26f1..17e969758 100644 --- a/extern/sector-storage/mock/mock.go +++ b/extern/sector-storage/mock/mock.go @@ -491,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 }