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

After installing plugin the default keystore does not work due to missing password #325

Closed
dfordivam opened this issue Aug 4, 2020 · 1 comment · Fixed by #331
Closed
Assignees
Labels
urgent Has an upcoming deadline

Comments

@dfordivam
Copy link

If a plugin is installed which does not need a password, the ckb-cli does not prompt for password for the default keystore.
So most of the commands stop working for the default keystore account.

The logic of this API should be fixed to decide the password requirement based on the keystore being used (default or plugin)

pub fn keystore_require_password(&self) -> bool {
self.actived_keystore()
.map(|(_, _, require_password)| require_password)
.unwrap_or(true)
}

@doitian doitian added the urgent Has an upcoming deadline label Aug 5, 2020
@doitian doitian added this to 📬 Inbox in CKB - Issues Aug 10, 2020
@doitian doitian moved this from 📬 Inbox to 🔙 Backlog in CKB - Issues Aug 10, 2020
@TheWaWaR
Copy link
Collaborator

TheWaWaR commented Aug 20, 2020

ckb-cli/src/plugin/manager.rs

Lines 1390 to 1399 in bb75209

Err(message) if message == ERROR_KEYSTORE_REQUIRE_PASSWORD => {
let password = read_password(false, None)?;
let request = KeyStoreRequest::DerivedKeySet {
hash160,
external_max_len,
change_last,
change_max_len,
password: Some(password),
};
self.call(request)?

It will actually try to read password when the error message from builtin keystore is keystore require password (kind of hack)

The mistake is some cases not covered.

https://github.com/nervosnetwork/ckb-cli/blob/develop/src/plugin/builtin.rs#L46

CKB - Issues automation moved this from 🔙 Backlog to ✅ Closed Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
urgent Has an upcoming deadline
Projects
CKB - Issues
  
✅ Closed
Development

Successfully merging a pull request may close this issue.

3 participants