Skip to content

Commit

Permalink
fix: add expect instead of unwrap:
Browse files Browse the repository at this point in the history
  • Loading branch information
th7nder committed Nov 22, 2024
1 parent d64dbc4 commit b352242
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pallets/storage-provider/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,8 @@ pub mod pallet {
for sector_number in sectors {
// Sectors stored in the Storage Provider struct should be consistently stored, without breaking invariants.
let sector_info = &sp.sectors[sector_number];
let comm_r = Commitment::<CommR>::from_cid_bytes(&sector_info.sealed_cid).unwrap();
let comm_r = Commitment::<CommR>::from_cid_bytes(&sector_info.sealed_cid)
.expect("CommR to be validated on pre-commit");
let _ = replicas
.try_insert(
*sector_number,
Expand Down Expand Up @@ -785,11 +786,11 @@ pub mod pallet {
// * https://github.com/filecoin-project/lotus/blob/4f70204342ce83671a7a261147a18865f1618967/storage/wdpost/wdpost_run.go#L334-L338
// * https://github.com/filecoin-project/lotus/blob/4f70204342ce83671a7a261147a18865f1618967/curiosrc/window/compute_do.go#L68-L72
// * https://github.com/filecoin-project/curio/blob/45373f7fc0431e41f987ad348df7ae6e67beaff9/tasks/window/compute_do.go#L71-L75
// let randomness = get_randomness::<T>(
// DomainSeparationTag::WindowedPoStChallengeSeed,
// current_deadline.challenge,
// &entropy,
// )?;
let randomness = get_randomness::<T>(
DomainSeparationTag::WindowedPoStChallengeSeed,
current_deadline.challenge,
&entropy,
)?;

let randomness = [1u8; 32];

Expand Down

0 comments on commit b352242

Please sign in to comment.