-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
27 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use fvm_shared::sector::WindowPoStVerifyInfo; | ||
|
||
use crate::kernel::FilecoinKernel; | ||
|
||
use super::Context; | ||
use crate::kernel::Result; | ||
|
||
/// Verifies a window proof of spacetime. | ||
/// | ||
/// The return i32 indicates the status code of the verification: | ||
/// - 0: verification ok. | ||
/// - -1: verification failed. | ||
pub fn verify_post( | ||
context: Context<'_, impl FilecoinKernel>, | ||
info_off: u32, // WindowPoStVerifyInfo, | ||
info_len: u32, | ||
) -> Result<i32> { | ||
let info = context | ||
.memory | ||
.read_cbor::<WindowPoStVerifyInfo>(info_off, info_len)?; | ||
context | ||
.kernel | ||
.verify_post(&info) | ||
.map(|v| if v { 0 } else { -1 }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters