Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

feat: add unlock all option to allow unknown accounts send transaction #3710

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

satyajeetkolhapure
Copy link
Contributor

Fixes: #3620 Adds wallet.unlockAll option to wallet options. This allows unknown accounts send transaction when the value is true. Default value is false.

unlockAll: {
normalize,
cliDescription:
"Unlock all accounts irrespective of known or unknown status.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of better/clearer alternatives, but I wonder if this help text will make sense to our users.

I'm curious on other reviewers' thoughts on this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - the term "known or unknown status" seems to be an internal concern. We could probably get more information in there, but at the very least, just "Unlock all accounts" would be clearer.

Copy link
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on the code changes, though the PR description needs to be updated to be "release ready"

Comment on lines +1957 to +1967
if(this.#options.wallet.unlockAll)
{
privateKey = wallet.createFakePrivateKey(fromString)
}
else
{
const msg = isKnownAccount
? "authentication needed: passphrase or unlock"
: "sender account not recognized";
throw new Error(msg);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the styling here is not consistent with the code base - space after if, { should be on preceding line

unlockAll: {
normalize,
cliDescription:
"Unlock all accounts irrespective of known or unknown status.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - the term "known or unknown status" seems to be an internal concern. We could probably get more information in there, but at the very least, just "Unlock all accounts" would be clearer.

Comment on lines +1957 to +1960
if(this.#options.wallet.unlockAll)
{
privateKey = wallet.createFakePrivateKey(fromString)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be implemented in the wallet, rather than the api? I can imagine us chasing different cases where we need to unlock the account.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Stalled
Development

Successfully merging this pull request may close these issues.

Add --unlock-all flag to unlock all accounts, known or not.
4 participants