Skip to content

Commit

Permalink
test: mock proof side effects on verify as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Mar 12, 2021
1 parent d992312 commit 527415c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extern/sector-storage/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -500,6 +501,7 @@ func (m mockVerif) VerifyWindowPoSt(ctx context.Context, info proof2.WindowPoStV
}

proof := info.Proofs[0]
info.Randomness[31] &= 0x3f

expected := generateFakePoStProof(info.ChallengedSectors, info.Randomness)
if !bytes.Equal(proof.ProofBytes, expected) {
Expand Down

0 comments on commit 527415c

Please sign in to comment.