rename to engine_signer

This commit is contained in:
keorn 2016-12-05 21:31:38 +00:00
parent 92d566c900
commit 0a2ec319ac
12 changed files with 19 additions and 19 deletions

View File

@ -737,7 +737,7 @@ impl MinerService for Miner {
*self.author.write() = author;
}
fn set_consensus_signer(&self, address: Address, password: String) -> Result<(), AccountError> {
fn set_engine_signer(&self, address: Address, password: String) -> Result<(), AccountError> {
if self.seals_internally {
if let Some(ref ap) = self.accounts {
try!(ap.sign(address.clone(), Some(password.clone()), Default::default()));

View File

@ -77,7 +77,7 @@ pub trait MinerService : Send + Sync {
fn set_author(&self, author: Address);
/// Set info necessary to sign consensus messages.
fn set_consensus_signer(&self, address: Address, password: String) -> Result<(), ::account_provider::Error>;
fn set_engine_signer(&self, address: Address, password: String) -> Result<(), ::account_provider::Error>;
/// Get the extra_data that we will seal blocks with.
fn extra_data(&self) -> Bytes;

View File

@ -61,7 +61,7 @@ pass = "test_pass"
[mining]
author = "0xdeadbeefcafe0000000000000000000000000001"
consensus_signer = "0xdeadbeefcafe0000000000000000000000000001"
engine_signer = "0xdeadbeefcafe0000000000000000000000000001"
force_sealing = true
reseal_on_txs = "all"
reseal_min_period = 4000

View File

@ -40,7 +40,7 @@ pass = "password"
[mining]
author = "0xdeadbeefcafe0000000000000000000000000001"
consensus_signer = "0xdeadbeefcafe0000000000000000000000000001"
engine_signer = "0xdeadbeefcafe0000000000000000000000000001"
force_sealing = true
reseal_on_txs = "all"
reseal_min_period = 4000

View File

@ -179,7 +179,7 @@ usage! {
flag_author: Option<String> = None,
or |c: &Config| otry!(c.mining).author.clone().map(Some),
flag_engine_signer: Option<String> = None,
or |c: &Config| otry!(c.mining).consensus_signer.clone().map(Some),
or |c: &Config| otry!(c.mining).engine_signer.clone().map(Some),
flag_force_sealing: bool = false,
or |c: &Config| otry!(c.mining).force_sealing.clone(),
flag_reseal_on_txs: String = "own",
@ -369,7 +369,7 @@ struct Dapps {
#[derive(Default, Debug, PartialEq, RustcDecodable)]
struct Mining {
author: Option<String>,
consensus_signer: Option<String>,
engine_signer: Option<String>,
force_sealing: Option<bool>,
reseal_on_txs: Option<String>,
reseal_min_period: Option<u64>,
@ -742,7 +742,7 @@ mod tests {
}),
mining: Some(Mining {
author: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
consensus_signer: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
engine_signer: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
force_sealing: Some(true),
reseal_on_txs: Some("all".into()),
reseal_min_period: Some(4000),

View File

@ -300,7 +300,7 @@ impl Configuration {
gas_floor_target: try!(to_u256(&self.args.flag_gas_floor_target)),
gas_ceil_target: try!(to_u256(&self.args.flag_gas_cap)),
transactions_limit: self.args.flag_tx_queue_size,
consensus_signer: try!(self.consensus_signer()),
engine_signer: try!(self.engine_signer()),
};
Ok(extras)
@ -310,7 +310,7 @@ impl Configuration {
to_address(self.args.flag_etherbase.clone().or(self.args.flag_author.clone()))
}
fn consensus_signer(&self) -> Result<Address, String> {
fn engine_signer(&self) -> Result<Address, String> {
to_address(self.args.flag_engine_signer.clone())
}

View File

@ -204,7 +204,7 @@ pub struct MinerExtras {
pub gas_floor_target: U256,
pub gas_ceil_target: U256,
pub transactions_limit: usize,
pub consensus_signer: Address,
pub engine_signer: Address,
}
impl Default for MinerExtras {
@ -215,7 +215,7 @@ impl Default for MinerExtras {
gas_floor_target: U256::from(4_700_000),
gas_ceil_target: U256::from(6_283_184),
transactions_limit: 1024,
consensus_signer: Default::default(),
engine_signer: Default::default(),
}
}
}

View File

@ -220,9 +220,9 @@ pub fn execute(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<(), String> {
miner.set_gas_ceil_target(cmd.miner_extras.gas_ceil_target);
miner.set_extra_data(cmd.miner_extras.extra_data);
miner.set_transactions_limit(cmd.miner_extras.transactions_limit);
let consensus_signer = cmd.miner_extras.consensus_signer;
if passwords.into_iter().any(|p| miner.set_consensus_signer(consensus_signer, p).is_ok()) {
return Err(format!("No password found for the consensus signer {}. Make sure valid password is present in files passed using `--password`.", cmd.miner_extras.consensus_signer));
let engine_signer = cmd.miner_extras.engine_signer;
if passwords.into_iter().any(|p| miner.set_engine_signer(engine_signer, p).is_ok()) {
return Err(format!("No password found for the consensus signer {}. Make sure valid password is present in files passed using `--password`.", cmd.miner_extras.engine_signer));
}
// create client config

View File

@ -116,9 +116,9 @@ impl<C, M, F> ParitySet for ParitySetClient<C, M, F> where
Ok(true)
}
fn set_consensus_signer(&self, address: H160, password: String) -> Result<bool, Error> {
fn set_engine_signer(&self, address: H160, password: String) -> Result<bool, Error> {
try!(self.active());
try!(take_weak!(self.miner).set_consensus_signer(address.into(), password).map_err(Into::into).map_err(errors::from_password_error));
try!(take_weak!(self.miner).set_engine_signer(address.into(), password).map_err(Into::into).map_err(errors::from_password_error));
Ok(true)
}

View File

@ -87,7 +87,7 @@ impl MinerService for TestMinerService {
*self.author.write() = author;
}
fn set_consensus_signer(&self, address: Address, password: String) -> Result<(), AccountError> {
fn set_engine_signer(&self, address: Address, password: String) -> Result<(), AccountError> {
*self.author.write() = address;
*self.password.write() = password;
Ok(())

View File

@ -107,7 +107,7 @@ fn rpc_parity_set_author() {
}
#[test]
fn rpc_parity_set_consensus_signer() {
fn rpc_parity_set_engine_signer() {
let miner = miner_service();
let client = client_service();
let network = network_service();

View File

@ -46,7 +46,7 @@ build_rpc_trait! {
/// Sets account for signing consensus messages.
#[rpc(name = "parity_setEngineSigner")]
fn set_consensus_signer(&self, H160, String) -> Result<bool, Error>;
fn set_engine_signer(&self, H160, String) -> Result<bool, Error>;
/// Sets the limits for transaction queue.
#[rpc(name = "parity_setTransactionsLimit")]