rename set_sealer
This commit is contained in:
parent
db59bd8731
commit
4f857642b5
@ -737,7 +737,7 @@ impl MinerService for Miner {
|
|||||||
*self.author.write() = author;
|
*self.author.write() = author;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_signer(&self, address: Address, password: String) -> Result<(), AccountError> {
|
fn set_consensus_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_signer(&self, address: Address, password: String) -> Result<(), ::account_provider::Error>;
|
fn set_consensus_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;
|
||||||
|
@ -116,9 +116,9 @@ impl<C, M, F> ParitySet for ParitySetClient<C, M, F> where
|
|||||||
Ok(true)
|
Ok(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_sealer(&self, address: H160, password: String) -> Result<bool, Error> {
|
fn set_consensus_signer(&self, address: H160, password: String) -> Result<bool, Error> {
|
||||||
try!(self.active());
|
try!(self.active());
|
||||||
try!(take_weak!(self.miner).set_signer(address.into(), password).map_err(Into::into).map_err(errors::from_password_error));
|
try!(take_weak!(self.miner).set_consensus_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_signer(&self, address: Address, password: String) -> Result<(), AccountError> {
|
fn set_consensus_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,14 +107,14 @@ fn rpc_parity_set_author() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rpc_parity_set_sealer() {
|
fn rpc_parity_set_consensus_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();
|
||||||
let io = IoHandler::new();
|
let io = IoHandler::new();
|
||||||
io.add_delegate(parity_set_client(&client, &miner, &network).to_delegate());
|
io.add_delegate(parity_set_client(&client, &miner, &network).to_delegate());
|
||||||
|
|
||||||
let request = r#"{"jsonrpc": "2.0", "method": "parity_setSealer", "params":["0xcd1722f3947def4cf144679da39c4c32bdc35681", "password"], "id": 1}"#;
|
let request = r#"{"jsonrpc": "2.0", "method": "parity_setConsensusSigner", "params":["0xcd1722f3947def4cf144679da39c4c32bdc35681", "password"], "id": 1}"#;
|
||||||
let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#;
|
let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#;
|
||||||
|
|
||||||
assert_eq!(io.handle_request_sync(request), Some(response.to_owned()));
|
assert_eq!(io.handle_request_sync(request), Some(response.to_owned()));
|
||||||
|
@ -45,8 +45,8 @@ build_rpc_trait! {
|
|||||||
fn set_author(&self, H160) -> Result<bool, Error>;
|
fn set_author(&self, H160) -> Result<bool, Error>;
|
||||||
|
|
||||||
/// Sets account for signing consensus messages.
|
/// Sets account for signing consensus messages.
|
||||||
#[rpc(name = "parity_setSealer")]
|
#[rpc(name = "parity_setConsensusSigner")]
|
||||||
fn set_sealer(&self, H160, String) -> Result<bool, Error>;
|
fn set_consensus_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