Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Better error messages for PoA chains #4034

Merged
merged 4 commits into from
Jan 5, 2017
Merged

Better error messages for PoA chains #4034

merged 4 commits into from
Jan 5, 2017

Conversation

maciejhirsz
Copy link
Contributor

Closes #4030

@parity-cla-bot
Copy link

It looks like @maciejhirsz hasn'signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement at the following URL: https://cla.ethcore.io

Once you've signed, plesae reply to this thread with [clabot:check] to prove it.

Many thanks,

Ethcore CLA Bot

if engine_signer != Default::default() {
// Check if engine signer exists
if !account_provider.has_account(engine_signer).unwrap_or(false) {
return Err(format!("Consensus signer account not found for the current chain, please run `parity account new -d current-d --chain current-chain`"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this info available in the RunCmd somewhere? Would be nice to format it in for adaptable error messages.

@maciejhirsz
Copy link
Contributor Author

[clabot:check]

@parity-cla-bot
Copy link

It looks like @maciejhirsz signed our Contributor License Agreement. 👍

Many thanks,

Ethcore CLA Bot

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jan 4, 2017
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 8ca0e09 on maciejhirsz:mh-pwmsg into ** on ethcore:master**.

}

if !passwords.iter().any(|p| account_provider.unlock_account_permanently(a, (*p).clone()).is_ok()) {
return Err(format!("No valid password to unlock account {}. Make sure valid password is present in files passed using `--password` or in the configuration file.", a));
Copy link
Contributor

Choose a reason for hiding this comment

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

This (and other similar messages like on L#247) could be extracted to a constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or abstract out the checks in both places to a function?

@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 4, 2017
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 516c41c on maciejhirsz:mh-pwmsg into ** on ethcore:master**.

@maciejhirsz
Copy link
Contributor Author

maciejhirsz commented Jan 4, 2017

Updated according to suggestions from @keorn. Account creation hints are now adaptive:

$ parity --chain ./spec.json -d ./dummy --unlock 0x1231222312312312321312313213231312323123
Loading config file from ./.parityrc
2017-01-04 17:03:13  Starting Parity/v1.5.0-unstable-9db3f38-20170103/x86_64-linux-gnu/rustc1.14.0
2017-01-04 17:03:13  State DB configuration: fast
2017-01-04 17:03:13  Operating mode: active
Account 1231…3123 not found for the current chain. You can create an account via RPC, UI or `parity account new --chain ./spec.json --keys-path ./dummy/keys`.

keys-path can be long (especially when it's a default, absolute path), but it can be copy-pasted safely.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling a4b4263 on maciejhirsz:mh-pwmsg into ** on ethcore:master**.

@maciejhirsz maciejhirsz merged commit 8810662 into openethereum:master Jan 5, 2017
@maciejhirsz maciejhirsz deleted the mh-pwmsg branch January 5, 2017 10:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants