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

Commit

Permalink
Update version (#58)
Browse files Browse the repository at this point in the history
* Update AppVeyor badge

* Update version
Use emerald-rs v0.18 to add BIP39  mnemonic functionality to RPC
endppoint
  • Loading branch information
r8d8 authored Nov 29, 2017
1 parent 477e59a commit 832bba6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ hex = "0.2"
lazy_static = "0.2"
serde_json = "1.0"
serde_derive = "1.0"
emerald-rs = "0.17"
emerald-rs = "0.18"
regex = "0.2"
rustc-serialize = "0.3"
hyper = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/arg_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl CmdExecutor {
|mut f| f.read_to_string(&mut json),
)?;

let kf = KeyFile::decode(json)?;
let kf = KeyFile::decode(&json)?;
let st = self.storage_ctrl.get_keystore(&self.chain)?;

match st.is_addr_exist(&kf.address) {
Expand Down
10 changes: 5 additions & 5 deletions src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ impl CmdExecutor {
let pass = request_passphrase()?;
let pk = kf.decrypt_key(&pass)?;

let raw = self.sign_transaction(tr, pk)?;
let raw = self.sign_transaction(&tr, pk)?;
match self.connector {
Some(ref conn) => {
tr.nonce = rpc::get_nonce(conn, &kf.address)?;
self.send_transaction(raw)
self.send_transaction(&raw)
}
None => {
println!("Signed transaction: ");
Expand Down Expand Up @@ -325,7 +325,7 @@ impl CmdExecutor {
}

/// Sign transaction with
fn sign_transaction(&self, tr: Transaction, pk: PrivateKey) -> Result<Vec<u8>, Error> {
fn sign_transaction(&self, tr: &Transaction, pk: PrivateKey) -> Result<Vec<u8>, Error> {
if let Some(chain_id) = to_chain_id(&self.chain) {
let raw = tr.to_signed_raw(pk, chain_id)?;
Ok(raw)
Expand All @@ -334,10 +334,10 @@ impl CmdExecutor {
}
}

fn send_transaction(&self, raw: Vec<u8>) -> ExecResult<Error> {
fn send_transaction(&self, raw: &[u8]) -> ExecResult<Error> {
match self.connector {
Some(ref conn) => {
let tx_hash = rpc::send_transaction(conn, &raw)?;
let tx_hash = rpc::send_transaction(conn, raw)?;
println!("Tx hash: ");
println!("{}", tx_hash);
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use log::LogRecord;
use std::env;
use std::process::*;

const USAGE: &'static str = include_str!("../usage.txt");
const USAGE: &str = include_str!("../usage.txt");
const VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION");

/// Get the current Emerald version.
Expand Down

0 comments on commit 832bba6

Please sign in to comment.