Skip to content

Commit

Permalink
Merge pull request #77 from cryptape/fix-setversion-type-bug
Browse files Browse the repository at this point in the history
fix set version type bug
  • Loading branch information
driftluo authored Oct 11, 2018
2 parents 61a75bb + 4836f05 commit 96ae898
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cita-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cita-cli"
version = "0.19.0"
version = "0.19.1"
authors = ["piaoliu <[email protected]>", "Qian Linfeng <[email protected]>"]
build = "build.rs"

Expand Down
2 changes: 1 addition & 1 deletion cita-cli/src/cli/contract_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u32>().unwrap())
.map(|version| parse_u256(version).unwrap())
.unwrap();
VersionManagerExt::set_version(&mut client, version, quota)
}
Expand Down
4 changes: 2 additions & 2 deletions cita-cli/src/cli/key_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)?;
Expand Down
4 changes: 2 additions & 2 deletions cita-tool/src/client/system_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,8 @@ pub trait VersionManagerExt: ContractCall {
}

/// Set version
fn set_version(&mut self, version: u32, quota: Option<u64>) -> Self::RpcResult {
let version = version.to_string();
fn set_version(&mut self, version: U256, quota: Option<u64>) -> Self::RpcResult {
let version = version.completed_lower_hex();
let value = [version.as_str()];
self.contract_send_tx("setVersion", &value, quota, None)
}
Expand Down

0 comments on commit 96ae898

Please sign in to comment.