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

Commit

Permalink
Fixing Signer token RPC API
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Drwięga committed Oct 3, 2016
1 parent e1d3b3f commit a0a1360
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 a0a1360

Please sign in to comment.