Skip to content

Commit

Permalink
burn in one shot
Browse files Browse the repository at this point in the history
  • Loading branch information
alexytsu committed May 25, 2023
1 parent 78029ed commit 5f53d85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions actors/verifreg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ impl Actor {
}

let mut rets: Vec<ClaimAllocationsReturn> = Vec::new();
let mut total_datacap_claimed = DataCap::zero();

for p in params.claims {
let mut datacap_claimed = DataCap::zero();
Expand Down Expand Up @@ -460,12 +461,15 @@ impl Actor {
));
}

// Burn the datacap tokens from verified registry's own balance.
burn(rt, &datacap_claimed)?;
// accumulate burnt datacap
total_datacap_claimed += datacap_claimed.clone();

rets.push(ClaimAllocationsReturn { batch_info, claimed_space: datacap_claimed });
}

// burn all the claimed datacap
burn(rt, &total_datacap_claimed)?;

Ok(ClaimAllocationsBatchReturn { claims: rets })
}
// Called by storage provider actor to claim allocations for data provably committed to storage.
Expand Down

0 comments on commit 5f53d85

Please sign in to comment.