Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrades multisig signing commands to use ui.ledger #5670

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions ironfish-cli/src/commands/wallet/multisig/commitment/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,16 @@ export class CreateSigningCommitmentCommand extends IronfishCommand {
signers: string[],
): Promise<void> {
const ledger = new LedgerMultiSigner()
try {
await ledger.connect()
} catch (e) {
if (e instanceof Error) {
this.error(e.message)
} else {
throw e
}
}

const identityResponse = await client.wallet.multisig.getIdentity({ name: participantName })
const identity = identityResponse.content.identity

const rawCommitments = await ledger.dkgGetCommitments(unsignedTransaction)
const rawCommitments = await ui.ledger({
ledger,
message: 'Get Commitments',
approval: true,
action: () => ledger.dkgGetCommitments(unsignedTransaction),
})

const signingCommitment = multisig.SigningCommitment.fromRaw(
identity,
Expand Down
16 changes: 6 additions & 10 deletions ironfish-cli/src/commands/wallet/multisig/signature/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,16 @@ export class CreateSignatureShareCommand extends IronfishCommand {
frostSigningPackage: string,
): Promise<void> {
const ledger = new LedgerMultiSigner()
try {
await ledger.connect()
} catch (e) {
if (e instanceof Error) {
this.error(e.message)
} else {
throw e
}
}

const identityResponse = await client.wallet.multisig.getIdentity({ name: participantName })
const identity = identityResponse.content.identity

const frostSignatureShare = await ledger.dkgSign(unsignedTransaction, frostSigningPackage)
const frostSignatureShare = await ui.ledger({
ledger,
message: 'Sign Transaction',
approval: true,
action: () => ledger.dkgSign(unsignedTransaction, frostSigningPackage),
})

const signatureShare = multisig.SignatureShare.fromFrost(
frostSignatureShare,
Expand Down