Skip to content

Commit

Permalink
removes ledger flag from 'wallet:multisig:participant:create'
Browse files Browse the repository at this point in the history
there is no longer a need to "create" the participant identity from the Ledger
device by importing it into the walletDB since our CLI commands now read the
identity directly from the Ledger when needed

removes the '--ledger' flag from the command and thereby removes the call to
importParticipant

Closes IFL-3168
  • Loading branch information
hughy committed Feb 12, 2025
1 parent a88b156 commit d1cda03
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions ironfish-cli/src/commands/wallet/multisig/participant/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { RPC_ERROR_CODES, RpcRequestError } from '@ironfish/sdk'
import { Flags } from '@oclif/core'
import { IronfishCommand } from '../../../../command'
import { RemoteFlags } from '../../../../flags'
import { LedgerMultiSigner } from '../../../../ledger'
import * as ui from '../../../../ui'

export class MultisigIdentityCreate extends IronfishCommand {
Expand All @@ -17,10 +16,6 @@ export class MultisigIdentityCreate extends IronfishCommand {
char: 'n',
description: 'Name to associate with the identity',
}),
ledger: Flags.boolean({
default: false,
description: 'Perform operation with a ledger device',
}),
}

async start(): Promise<void> {
Expand All @@ -34,22 +29,10 @@ export class MultisigIdentityCreate extends IronfishCommand {
name = await ui.inputPrompt('Enter a name for the identity', true)
}

let identity
if (flags.ledger) {
identity = await this.getIdentityFromLedger()
}

let response
while (!response) {
try {
if (identity) {
response = await client.wallet.multisig.importParticipant({
name,
identity: identity.toString('hex'),
})
} else {
response = await client.wallet.multisig.createParticipant({ name })
}
response = await client.wallet.multisig.createParticipant({ name })
} catch (e) {
if (
e instanceof RpcRequestError &&
Expand All @@ -68,14 +51,4 @@ export class MultisigIdentityCreate extends IronfishCommand {
this.log('Identity:')
this.log(response.content.identity)
}

async getIdentityFromLedger(): Promise<Buffer> {
const ledger = new LedgerMultiSigner()

return ui.ledger({
ledger,
message: 'Getting Ledger Identity',
action: () => ledger.dkgGetIdentity(0),
})
}
}

0 comments on commit d1cda03

Please sign in to comment.