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

removes ledger flag from 'wallet:multisig:participant:create' #5732

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from
Draft
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
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),
})
}
}