rename to engine_signer
This commit is contained in:
parent
92d566c900
commit
0a2ec319ac
@ -737,7 +737,7 @@ impl MinerService for Miner {
|
|||||||
*self.author.write() = author;
|
*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 self.seals_internally {
|
||||||
if let Some(ref ap) = self.accounts {
|
if let Some(ref ap) = self.accounts {
|
||||||
try!(ap.sign(address.clone(), Some(password.clone()), Default::default()));
|
try!(ap.sign(address.clone(), Some(password.clone()), Default::default()));
|
||||||
|
@ -77,7 +77,7 @@ pub trait MinerService : Send + Sync {
|
|||||||
fn set_author(&self, author: Address);
|
fn set_author(&self, author: Address);
|
||||||
|
|
||||||
/// Set info necessary to sign consensus messages.
|
/// 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.
|
/// Get the extra_data that we will seal blocks with.
|
||||||
fn extra_data(&self) -> Bytes;
|
fn extra_data(&self) -> Bytes;
|
||||||
|
@ -61,7 +61,7 @@ pass = "test_pass"
|
|||||||
|
|
||||||
[mining]
|
[mining]
|
||||||
author = "0xdeadbeefcafe0000000000000000000000000001"
|
author = "0xdeadbeefcafe0000000000000000000000000001"
|
||||||
consensus_signer = "0xdeadbeefcafe0000000000000000000000000001"
|
engine_signer = "0xdeadbeefcafe0000000000000000000000000001"
|
||||||
force_sealing = true
|
force_sealing = true
|
||||||
reseal_on_txs = "all"
|
reseal_on_txs = "all"
|
||||||
reseal_min_period = 4000
|
reseal_min_period = 4000
|
||||||
|
@ -40,7 +40,7 @@ pass = "password"
|
|||||||
|
|
||||||
[mining]
|
[mining]
|
||||||
author = "0xdeadbeefcafe0000000000000000000000000001"
|
author = "0xdeadbeefcafe0000000000000000000000000001"
|
||||||
consensus_signer = "0xdeadbeefcafe0000000000000000000000000001"
|
engine_signer = "0xdeadbeefcafe0000000000000000000000000001"
|
||||||
force_sealing = true
|
force_sealing = true
|
||||||
reseal_on_txs = "all"
|
reseal_on_txs = "all"
|
||||||
reseal_min_period = 4000
|
reseal_min_period = 4000
|
||||||
|
@ -179,7 +179,7 @@ usage! {
|
|||||||
flag_author: Option<String> = None,
|
flag_author: Option<String> = None,
|
||||||
or |c: &Config| otry!(c.mining).author.clone().map(Some),
|
or |c: &Config| otry!(c.mining).author.clone().map(Some),
|
||||||
flag_engine_signer: Option<String> = None,
|
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,
|
flag_force_sealing: bool = false,
|
||||||
or |c: &Config| otry!(c.mining).force_sealing.clone(),
|
or |c: &Config| otry!(c.mining).force_sealing.clone(),
|
||||||
flag_reseal_on_txs: String = "own",
|
flag_reseal_on_txs: String = "own",
|
||||||
@ -369,7 +369,7 @@ struct Dapps {
|
|||||||
#[derive(Default, Debug, PartialEq, RustcDecodable)]
|
#[derive(Default, Debug, PartialEq, RustcDecodable)]
|
||||||
struct Mining {
|
struct Mining {
|
||||||
author: Option<String>,
|
author: Option<String>,
|
||||||
consensus_signer: Option<String>,
|
engine_signer: Option<String>,
|
||||||
force_sealing: Option<bool>,
|
force_sealing: Option<bool>,
|
||||||
reseal_on_txs: Option<String>,
|
reseal_on_txs: Option<String>,
|
||||||
reseal_min_period: Option<u64>,
|
reseal_min_period: Option<u64>,
|
||||||
@ -742,7 +742,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
mining: Some(Mining {
|
mining: Some(Mining {
|
||||||
author: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
|
author: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
|
||||||
consensus_signer: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
|
engine_signer: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
|
||||||
force_sealing: Some(true),
|
force_sealing: Some(true),
|
||||||
reseal_on_txs: Some("all".into()),
|
reseal_on_txs: Some("all".into()),
|
||||||
reseal_min_period: Some(4000),
|
reseal_min_period: Some(4000),
|
||||||
|
@ -300,7 +300,7 @@ impl Configuration {
|
|||||||
gas_floor_target: try!(to_u256(&self.args.flag_gas_floor_target)),
|
gas_floor_target: try!(to_u256(&self.args.flag_gas_floor_target)),
|
||||||
gas_ceil_target: try!(to_u256(&self.args.flag_gas_cap)),
|
gas_ceil_target: try!(to_u256(&self.args.flag_gas_cap)),
|
||||||
transactions_limit: self.args.flag_tx_queue_size,
|
transactions_limit: self.args.flag_tx_queue_size,
|
||||||
consensus_signer: try!(self.consensus_signer()),
|
engine_signer: try!(self.engine_signer()),
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(extras)
|
Ok(extras)
|
||||||
@ -310,7 +310,7 @@ impl Configuration {
|
|||||||
to_address(self.args.flag_etherbase.clone().or(self.args.flag_author.clone()))
|
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())
|
to_address(self.args.flag_engine_signer.clone())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ pub struct MinerExtras {
|
|||||||
pub gas_floor_target: U256,
|
pub gas_floor_target: U256,
|
||||||
pub gas_ceil_target: U256,
|
pub gas_ceil_target: U256,
|
||||||
pub transactions_limit: usize,
|
pub transactions_limit: usize,
|
||||||
pub consensus_signer: Address,
|
pub engine_signer: Address,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for MinerExtras {
|
impl Default for MinerExtras {
|
||||||
@ -215,7 +215,7 @@ impl Default for MinerExtras {
|
|||||||
gas_floor_target: U256::from(4_700_000),
|
gas_floor_target: U256::from(4_700_000),
|
||||||
gas_ceil_target: U256::from(6_283_184),
|
gas_ceil_target: U256::from(6_283_184),
|
||||||
transactions_limit: 1024,
|
transactions_limit: 1024,
|
||||||
consensus_signer: Default::default(),
|
engine_signer: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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_gas_ceil_target(cmd.miner_extras.gas_ceil_target);
|
||||||
miner.set_extra_data(cmd.miner_extras.extra_data);
|
miner.set_extra_data(cmd.miner_extras.extra_data);
|
||||||
miner.set_transactions_limit(cmd.miner_extras.transactions_limit);
|
miner.set_transactions_limit(cmd.miner_extras.transactions_limit);
|
||||||
let consensus_signer = cmd.miner_extras.consensus_signer;
|
let engine_signer = cmd.miner_extras.engine_signer;
|
||||||
if passwords.into_iter().any(|p| miner.set_consensus_signer(consensus_signer, p).is_ok()) {
|
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.consensus_signer));
|
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
|
// create client config
|
||||||
|
@ -116,9 +116,9 @@ impl<C, M, F> ParitySet for ParitySetClient<C, M, F> where
|
|||||||
Ok(true)
|
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!(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)
|
Ok(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ impl MinerService for TestMinerService {
|
|||||||
*self.author.write() = author;
|
*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.author.write() = address;
|
||||||
*self.password.write() = password;
|
*self.password.write() = password;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -107,7 +107,7 @@ fn rpc_parity_set_author() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rpc_parity_set_consensus_signer() {
|
fn rpc_parity_set_engine_signer() {
|
||||||
let miner = miner_service();
|
let miner = miner_service();
|
||||||
let client = client_service();
|
let client = client_service();
|
||||||
let network = network_service();
|
let network = network_service();
|
||||||
|
@ -46,7 +46,7 @@ build_rpc_trait! {
|
|||||||
|
|
||||||
/// Sets account for signing consensus messages.
|
/// Sets account for signing consensus messages.
|
||||||
#[rpc(name = "parity_setEngineSigner")]
|
#[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.
|
/// Sets the limits for transaction queue.
|
||||||
#[rpc(name = "parity_setTransactionsLimit")]
|
#[rpc(name = "parity_setTransactionsLimit")]
|
||||||
|
Loading…
Reference in New Issue
Block a user