-
Notifications
You must be signed in to change notification settings - Fork 573
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
Rahul/ifl 2746 wallet sign command #5111
Conversation
6a76a47
to
8598516
Compare
86ddb1d
to
22e3a96
Compare
if (!account.spendingKey) { | ||
throw new Error('Account does not have a spending key') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - we could include this check in the predicate function for findAccount
, above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think distinct messages are better. If the user has the account but it is a view only account, that would be a different error than just not having the account
if (!account) { | ||
const response = await client.wallet.getDefaultAccount() | ||
|
||
if (!response.content.account) { | ||
this.error( | ||
`No account is currently active. | ||
Use ironfish wallet:create <name> to first create an account`, | ||
) | ||
} | ||
|
||
account = response.content.account.name | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
account
isn't used now that we can infer it from the transaction
watch: Flags.boolean({ | ||
default: false, | ||
description: 'Wait for the transaction to be confirmed', | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this only work if broadcast
is set?
22e3a96
to
8868138
Compare
8868138
to
7c54423
Compare
Summary
Adds the
wallet:sign
CLI command along with thewallet/signTransaction
RPC.We already have a
sign
function on an UnsignedTransaction on the Rust side. This basically exposes that feature.Also included is the ledger signing option for this CLI command.
Testing Plan
Manually tested signing an unsigned transaction and adding (wallet:transaction:add) the signed transaction using both an account with a spending key and an account that is a ledger device.
Documentation
To follow in a separate PR on the website
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and label it with
breaking-change-rpc
orbreaking-change-sdk
.