Skip to content

Commit

Permalink
reads identity from Ledger in DKG round3
Browse files Browse the repository at this point in the history
when running DKG using a Ledger device we must use the identity from the Ledger

reads the identity from the Ledger device during DKG round3 instead of from the
walletDB when using the '--ledger' flag in 'wallet:multisig:dkg:create' and
'wallet:multisig:dkg:round3'

Closes IFL-3170
Closes IFL-3171
  • Loading branch information
hughy committed Feb 4, 2025
1 parent acd4c8b commit fb01d41
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 7 additions & 4 deletions ironfish-cli/src/commands/wallet/multisig/dkg/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,18 @@ export class DkgCreateCommand extends IronfishCommand {
ledger: LedgerMultiSigner,
client: RpcClient,
accountName: string,
participantName: string,
round1PublicPackagesStr: string[],
round2PublicPackagesStr: string[],
round2SecretPackage: string,
accountCreatedAt?: number,
): Promise<void> {
const identityResponse = await client.wallet.multisig.getIdentity({ name: participantName })
const identity = identityResponse.content.identity
const identity = (
await ui.ledger({
ledger,
message: 'Getting Ledger Identity',
action: () => ledger.dkgGetIdentity(0),
})
).toString('hex')

// Sort packages by identity
const round1PublicPackages = round1PublicPackagesStr
Expand Down Expand Up @@ -563,7 +567,6 @@ export class DkgCreateCommand extends IronfishCommand {
ledger,
client,
accountName,
participantName,
round1PublicPackages,
round2PublicPackages,
round2Result.secretPackage,
Expand Down
9 changes: 7 additions & 2 deletions ironfish-cli/src/commands/wallet/multisig/dkg/round3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ export class DkgRound3Command extends IronfishCommand {
): Promise<void> {
const ledger = new LedgerMultiSigner()

const identityResponse = await client.wallet.multisig.getIdentity({ name: participantName })
const identity = identityResponse.content.identity
const identity = (
await ui.ledger({
ledger,
message: 'Getting Ledger Identity',
action: () => ledger.dkgGetIdentity(0),
})
).toString('hex')

// Sort packages by identity
const round1PublicPackages = round1PublicPackagesStr
Expand Down

0 comments on commit fb01d41

Please sign in to comment.