From 0892ed482175db454ca1233fedcdbd7ea8bf9d72 Mon Sep 17 00:00:00 2001 From: piaoliu <441594700@qq.com> Date: Thu, 11 Oct 2018 12:07:59 +0800 Subject: [PATCH 1/2] fix set version type bug --- cita-cli/src/cli/contract_command.rs | 2 +- cita-cli/src/cli/key_command.rs | 4 ++-- cita-tool/src/client/system_contract.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cita-cli/src/cli/contract_command.rs b/cita-cli/src/cli/contract_command.rs index 2809ccf..b3a8e50 100644 --- a/cita-cli/src/cli/contract_command.rs +++ b/cita-cli/src/cli/contract_command.rs @@ -1463,7 +1463,7 @@ pub fn contract_processor( let quota = m.value_of("quota").map(|quota| parse_u64(quota).unwrap()); let version = m .value_of("version") - .map(|version| version.parse::().unwrap()) + .map(|version| parse_u256(version).unwrap()) .unwrap(); VersionManagerExt::set_version(&mut client, version, quota) } diff --git a/cita-cli/src/cli/key_command.rs b/cita-cli/src/cli/key_command.rs index 10f1958..7275669 100644 --- a/cita-cli/src/cli/key_command.rs +++ b/cita-cli/src/cli/key_command.rs @@ -13,7 +13,7 @@ pub fn key_command() -> App<'static, 'static> { .about("Some key operations, such as generating address, public key") .subcommand(SubCommand::with_name("create")) .subcommand( - SubCommand::with_name("from-private-key").arg( + SubCommand::with_name("from-private").arg( Arg::with_name("private-key") .long("private-key") .takes_value(true) @@ -58,7 +58,7 @@ pub fn key_processor( let is_color = !sub_matches.is_present("no-color") && config.color(); printer.println(&key_pair, is_color); } - ("from-private-key", Some(m)) => { + ("from-private", Some(m)) => { let encryption = encryption(m, config); let private_key = m.value_of("private-key").unwrap(); let key_pair = KeyPair::from_str(remove_0x(private_key), encryption)?; diff --git a/cita-tool/src/client/system_contract.rs b/cita-tool/src/client/system_contract.rs index 44b7d6f..552dd9b 100644 --- a/cita-tool/src/client/system_contract.rs +++ b/cita-tool/src/client/system_contract.rs @@ -1002,8 +1002,8 @@ pub trait VersionManagerExt: ContractCall { } /// Set version - fn set_version(&mut self, version: u32, quota: Option) -> Self::RpcResult { - let version = version.to_string(); + fn set_version(&mut self, version: U256, quota: Option) -> Self::RpcResult { + let version = version.completed_lower_hex(); let value = [version.as_str()]; self.contract_send_tx("setVersion", &value, quota, None) } From 4836f05a2daea4d3a61b041ba635648705ea5443 Mon Sep 17 00:00:00 2001 From: piaoliu <441594700@qq.com> Date: Thu, 11 Oct 2018 12:42:47 +0800 Subject: [PATCH 2/2] dump to 0.19.1 --- cita-cli/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cita-cli/Cargo.toml b/cita-cli/Cargo.toml index 76a7477..e9c1ebf 100644 --- a/cita-cli/Cargo.toml +++ b/cita-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cita-cli" -version = "0.19.0" +version = "0.19.1" authors = ["piaoliu <441594700@qq.com>", "Qian Linfeng "] build = "build.rs"