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

Commit

Permalink
Merge pull request #2437 from ethcore/signer
Browse files Browse the repository at this point in the history
Fixing Signer token RPC API
  • Loading branch information
rphmeier authored Oct 3, 2016
2 parents 10d572e + a0a1360 commit d205c08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion parity/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ pub fn execute(cmd: RunCmd) -> Result<(), String> {
let signer_path = cmd.signer_conf.signer_path.clone();
let deps_for_rpc_apis = Arc::new(rpc_apis::Dependencies {
signer_port: cmd.signer_port,
signer_service: Arc::new(rpc_apis::SignerService::new(move || signer::new_token(signer_path.clone()))),
signer_service: Arc::new(rpc_apis::SignerService::new(move || {
signer::generate_new_token(signer_path.clone()).map_err(|e| format!("{:?}", e))
})),
client: client.clone(),
sync: sync_provider.clone(),
net: manage_network.clone(),
Expand Down
2 changes: 1 addition & 1 deletion parity/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn new_token(path: String) -> Result<String, String> {
.map_err(|err| format!("Error generating token: {:?}", err))
}

fn generate_new_token(path: String) -> io::Result<String> {
pub fn generate_new_token(path: String) -> io::Result<String> {
let path = codes_path(path);
let mut codes = try!(signer::AuthCodes::from_file(&path));
let code = try!(codes.generate_new());
Expand Down

0 comments on commit d205c08

Please sign in to comment.