Skip to content

Commit

Permalink
match behaviour of fake valid_post in lotus mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Apr 22, 2022
1 parent 3f56d86 commit 1254241
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions actors/runtime/src/runtime/fvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,16 @@ where
}

#[cfg(feature = "fake-proofs")]
fn verify_post(&self, _verify_info: &WindowPoStVerifyInfo) -> Result<(), Error> {
Ok(())
fn verify_post(&self, verify_info: &WindowPoStVerifyInfo) -> Result<(), Error> {
if verify_info.proofs.len() == 0 {
return Err(Error::msg("[fake-post-validation] No winning post proof given"))
}

if &verify_info.proofs[0].proof_bytes == b"valid proof" {
return Ok(())
}

Err(Error::msg("[fake-post-validation] winning post was invalid"))
}

#[cfg(not(feature = "fake-proofs"))]
Expand Down

0 comments on commit 1254241

Please sign in to comment.