Skip to content

Commit

Permalink
[cli] Fixup shared recovery progress display.
Browse files Browse the repository at this point in the history
  • Loading branch information
AureliaDolo committed Jan 15, 2025
1 parent a898df5 commit 6f66065
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions cli/src/commands/invite/claim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,21 @@ fn shamir_pick_recipient(
ctx: &ShamirRecoveryClaimPickRecipientCtx,
) -> anyhow::Result<ShamirRecoveryClaimInitialCtx> {
let recipients = ctx.recipients_without_a_share();
let human_recipients: Vec<&_> = recipients.iter().map(|r| &r.human_handle).collect();
let human_recipients: Vec<_> = recipients
.iter()
.map(|r| format!("{} - {} share(s)", r.human_handle, r.shares))
.collect();
if ctx.retrieved_shares().is_empty() {
println!("{} shares needed for recovery", ctx.threshold());
} else {
println!(
"Out of {} shares needed for recovery, {} were retrieved.",
ctx.threshold(),
ctx.retrieved_shares()
.iter()
.fold(0_u8, |acc, (_, s)| acc + u8::from(*s))
);
}
let selection = Select::new()
.default(0)
.with_prompt("Choose a person to contact now")
Expand Down Expand Up @@ -346,7 +360,7 @@ async fn step4_device(ctx: DeviceClaimInProgress3Ctx) -> anyhow::Result<DeviceCl
Ok(ctx)
}

/// Step 4: retrieve device
/// Step 4: retrieve share
async fn step4_shamir(
ctx: ShamirRecoveryClaimInProgress3Ctx,
) -> anyhow::Result<ShamirRecoveryClaimShare> {
Expand Down
1 change: 1 addition & 0 deletions newsfragments/6090.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port the shared recovery feature (based on the Shamir algorithm) and expose it through the CLI.
2 changes: 1 addition & 1 deletion newsfragments/9109.bugfix.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[CLI] Stop spinners with check mark.
Stop spinners with check mark.
1 change: 0 additions & 1 deletion newsfragments/9189.feature.rst

This file was deleted.

0 comments on commit 6f66065

Please sign in to comment.