Skip to content

Commit

Permalink
Implement new ProveReplicaUpdates3 for direct data onboarding. (#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
anorth committed Jan 22, 2024
1 parent 9c681c7 commit ba9b579
Show file tree
Hide file tree
Showing 5 changed files with 518 additions and 267 deletions.
13 changes: 5 additions & 8 deletions actors/miner/src/deadline_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,16 @@ impl Deadline {
&self,
store: &BS,
partition_idx: u64,
) -> anyhow::Result<Partition> {
let partitions = Array::<Partition, _>::load(&self.partitions, store)?;
) -> Result<Partition, ActorError> {
let partitions = Array::<Partition, _>::load(&self.partitions, store)
.context_code(ExitCode::USR_ILLEGAL_STATE, "loading partitions array")?;

let partition = partitions
.get(partition_idx)
.map_err(|e| {
e.downcast_default(
ExitCode::USR_ILLEGAL_STATE,
format!("failed to lookup partition {}", partition_idx),
)
.with_context_code(ExitCode::USR_ILLEGAL_STATE, || {
format!("failed to lookup partition {}", partition_idx)
})?
.ok_or_else(|| actor_error!(not_found, "no partition {}", partition_idx))?;

Ok(partition.clone())
}

Expand Down
Loading

0 comments on commit ba9b579

Please sign in to comment.