|
18 | 18 |
|
19 | 19 | use std::collections::BTreeMap;
|
20 | 20 | use std::sync::Arc;
|
| 21 | + |
21 | 22 | use account_utils::AccountProvider;
|
22 | 23 | use dir::default_data_path;
|
23 | 24 | use dir::helpers::replace_home;
|
24 | 25 | use ethcore::client::Client;
|
25 | 26 | use ethcore::miner::Miner;
|
| 27 | +use ethereum_types::Address; |
26 | 28 | use ethkey::Password;
|
27 | 29 | use parity_crypto::publickey::{Secret, Public};
|
28 |
| -use sync::SyncProvider; |
29 |
| -use ethereum_types::Address; |
30 | 30 | use parity_runtime::Executor;
|
| 31 | +use sync::SyncProvider; |
31 | 32 |
|
32 | 33 | /// This node secret key.
|
33 | 34 | #[derive(Debug, PartialEq, Clone)]
|
@@ -123,14 +124,16 @@ mod server {
|
123 | 124 | #[cfg(feature = "secretstore")]
|
124 | 125 | mod server {
|
125 | 126 | use std::sync::Arc;
|
126 |
| - use parity_secretstore; |
127 | 127 | use parity_crypto::publickey::KeyPair;
|
128 | 128 | use ansi_term::Colour::{Red, White};
|
| 129 | + use ethereum_types::H256; |
129 | 130 | use super::{Configuration, Dependencies, NodeSecretKey, ContractAddress, Executor};
|
130 | 131 | use super::super::TrustedClient;
|
131 | 132 | #[cfg(feature = "accounts")]
|
132 | 133 | use super::super::KeyStoreNodeKeyPair;
|
133 | 134 |
|
| 135 | + const SECP_TEST_MESSAGE: H256 = H256([1_u8; 32]); |
| 136 | + |
134 | 137 | fn into_service_contract_address(address: ContractAddress) -> parity_secretstore::ContractAddress {
|
135 | 138 | match address {
|
136 | 139 | ContractAddress::Registry => parity_secretstore::ContractAddress::Registry,
|
@@ -163,10 +166,10 @@ mod server {
|
163 | 166 |
|
164 | 167 | // Attempt to sign in the engine signer.
|
165 | 168 | let password = deps.accounts_passwords.iter()
|
166 |
| - .find(|p| deps.account_provider.sign(account.clone(), Some((*p).clone()), Default::default()).is_ok()) |
| 169 | + .find(|p| deps.account_provider.sign(account.clone(), Some((*p).clone()), SECP_TEST_MESSAGE).is_ok()) |
167 | 170 | .ok_or_else(|| format!("No valid password for the secret store node account {}", account))?;
|
168 | 171 | Arc::new(KeyStoreNodeKeyPair::new(deps.account_provider, account, password.clone())
|
169 |
| - .map_err(|e| format!("{}", e))?) |
| 172 | + .map_err(|e| e.to_string())?) |
170 | 173 | },
|
171 | 174 | None => return Err("self secret is required when using secretstore".into()),
|
172 | 175 | };
|
|
0 commit comments