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

reads identity from ledger in 'wallet:multisig:commitment:create' #5716

Merged
merged 1 commit into from
Feb 5, 2025
Merged
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
20 changes: 9 additions & 11 deletions ironfish-cli/src/commands/wallet/multisig/commitment/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import { multisig } from '@ironfish/rust-nodejs'
import { RpcClient, UnsignedTransaction } from '@ironfish/sdk'
import { UnsignedTransaction } from '@ironfish/sdk'
import { Flags } from '@oclif/core'
import { IronfishCommand } from '../../../../command'
import { RemoteFlags } from '../../../../flags'
Expand Down Expand Up @@ -95,12 +95,7 @@ export class CreateSigningCommitmentCommand extends IronfishCommand {
await ui.confirmOrQuit('Confirm signing commitment creation', flags.confirm)

if (flags.ledger) {
await this.createSigningCommitmentWithLedger(
client,
participantName,
unsignedTransaction,
identities,
)
await this.createSigningCommitmentWithLedger(unsignedTransaction, identities)
return
}

Expand All @@ -119,15 +114,18 @@ export class CreateSigningCommitmentCommand extends IronfishCommand {
}

async createSigningCommitmentWithLedger(
client: RpcClient,
participantName: string,
unsignedTransaction: UnsignedTransaction,
signers: string[],
): 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')

const rawCommitments = await ui.ledger({
ledger,
Expand Down