Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
doitian committed May 22, 2020
2 parents e9f442b + e514f54 commit 0fc435d
Show file tree
Hide file tree
Showing 24 changed files with 571 additions and 431 deletions.
222 changes: 165 additions & 57 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "ckb-cli"
version = "0.31.0"
version = "0.32.0"
license = "MIT"
authors = ["Linfeng Qian <thewawar@gmail.com>", "Nervos Core Dev <dev@nervos.org>"]
edition = "2018"

[dependencies]
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1", features = ["secp"] }
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-util = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1", features = ["secp"] }
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-util = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-sdk = { path = "ckb-sdk" }
ckb-index = { path = "ckb-index" }
ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-dao-utils = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-dao-utils = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }

jsonrpc-client-core = "0.5.0"
jsonrpc-core = "10.1"
Expand All @@ -26,7 +26,8 @@ secp256k1 = {version = "0.17.0" }
faster-hex = "0.4"
env_logger = "0.6"
crossbeam-channel = "0.3"
clap = "2.33.0"
clap = "3.0.0-beta.1"
clap_generate = "3.0.0-beta.1"
serde = { version = "1.0", features = ["rc"] }
serde_derive = "1.0"
serde_json = "1.0"
Expand Down Expand Up @@ -55,7 +56,7 @@ tui = "0.6.0"
termion = "1.5"

[build-dependencies]
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }

[workspace]
members = ["ckb-sdk", "ckb-index", "ckb-sdk-types"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ci: fmt clippy test security-audit
git diff --exit-code Cargo.lock

integration:
bash devtools/ci/integration.sh v0.31.0-rc1
bash devtools/ci/integration.sh v0.32.0-rc1

prod: ## Build binary with release profile.
cargo build --release
Expand Down
5 changes: 4 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
CI: true

- job: Package
timeoutInMinutes: 0
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
pool:
vmImage: 'VS2017-Win2016'
Expand All @@ -45,7 +46,9 @@ jobs:
inputs:
rootFolderOrFile: 'ckb-cli_$(Build.SourceBranchName)_x86_64-pc-windows-msvc'
archiveFile: '$(Build.ArtifactStagingDirectory)/ckb-cli_$(Build.SourceBranchName)_x86_64-pc-windows-msvc.zip'
- script: choco install -y gpg4win
- script: |
scoop bucket add extras
scoop install gpg4win
displayName: Install GPG4Win
- task: DownloadSecureFile@1
inputs:
Expand Down
4 changes: 2 additions & 2 deletions ckb-index/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ckb-index"
version = "0.31.0"
version = "0.32.0"
authors = ["Linfeng Qian <thewawar@gmail.com>", "Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
license = "MIT"
Expand All @@ -11,7 +11,7 @@ serde_derive = "1.0"
bincode = "1.1.4"
log = "0.4.6"
failure = "0.1.5"
ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-sdk = { path = "../ckb-sdk" }

[dependencies.rocksdb]
Expand Down
14 changes: 7 additions & 7 deletions ckb-sdk-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ckb-sdk-types"
version = "0.31.0"
version = "0.32.0"
authors = ["Linfeng Qian <thewawar@gmail.com>", "Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
license = "MIT"
Expand All @@ -9,14 +9,14 @@ license = "MIT"
serde = { version = "1.0", features = ["rc"] }
serde_derive = "1.0"

ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1", default-features = false }
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-error = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1", default-features = false }
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-error = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }

[dev-dependencies]
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1", features = ["secp"] }
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1", features = ["secp"] }

[features]
default = ["ckb-script/default"]
Expand Down
14 changes: 7 additions & 7 deletions ckb-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ckb-sdk"
version = "0.31.0"
version = "0.32.0"
authors = ["Linfeng Qian <thewawar@gmail.com>", "Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
license = "MIT"
Expand All @@ -25,10 +25,10 @@ uuid = { version = "0.7.4", features = ["v4"] }
chrono = "0.4.6"
failure = "0.1.5"

ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1" }
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.31.0-rc1", features = ["secp"] }
ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1" }
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.32.0-rc1", features = ["secp"] }
ckb-sdk-types = { path = "../ckb-sdk-types" }
2 changes: 0 additions & 2 deletions devtools/azure/windows-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ steps:
displayName: Add scoop to path
- script: scoop install llvm
displayName: Install LLVM
- script: scoop install msys2
displayName: Install msys2
- script: scoop install yasm
displayName: Install yasm
- script: |
Expand Down
4 changes: 2 additions & 2 deletions src/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct InteractiveEnv {
config_file: PathBuf,
history_file: PathBuf,
index_dir: PathBuf,
parser: clap::App<'static, 'static>,
parser: clap::App<'static>,
key_store: KeyStore,
rpc_client: HttpRpcClient,
raw_rpc_client: RawHttpRpcClient,
Expand Down Expand Up @@ -224,7 +224,7 @@ impl InteractiveEnv {
let format = self.config.output_format();
let color = ColorWhen::new(self.config.color()).color();
let debug = self.config.debug();
match self.parser.clone().get_matches_from_safe(args) {
match self.parser.clone().try_get_matches_from(args) {
Ok(matches) => match matches.subcommand() {
("config", Some(m)) => {
m.value_of("url").and_then(|url| {
Expand Down
38 changes: 19 additions & 19 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use ckb_build_info::Version;
use ckb_sdk::{rpc::RawHttpRpcClient, HttpRpcClient};
use ckb_util::RwLock;
use clap::crate_version;
use clap::{App, AppSettings, Arg, SubCommand};
use clap::{App, AppSettings, Arg};
#[cfg(unix)]
use subcommands::TuiSubCommand;

Expand Down Expand Up @@ -211,7 +211,7 @@ fn main() -> Result<(), io::Error> {
Ok(())
}

fn get_version() -> Version {
pub fn get_version() -> Version {
let major = env!("CARGO_PKG_VERSION_MAJOR")
.parse::<u8>()
.expect("CARGO_PKG_VERSION_MAJOR parse success");
Expand Down Expand Up @@ -245,7 +245,7 @@ fn get_version() -> Version {
}
}

pub fn build_cli<'a>(version_short: &'a str, version_long: &'a str) -> App<'a, 'a> {
pub fn build_cli<'a>(version_short: &'a str, version_long: &'a str) -> App<'a> {
let app = App::new("ckb-cli")
.version(version_short)
.long_version(version_long)
Expand All @@ -265,7 +265,7 @@ pub fn build_cli<'a>(version_short: &'a str, version_long: &'a str) -> App<'a, '
.long("url")
.takes_value(true)
.validator(|input| UrlParser.validate(input))
.help("RPC API server url"),
.about("RPC API server url"),
)
.arg(
Arg::with_name("output-format")
Expand All @@ -274,84 +274,84 @@ pub fn build_cli<'a>(version_short: &'a str, version_long: &'a str) -> App<'a, '
.possible_values(&["yaml", "json"])
.default_value("yaml")
.global(true)
.help("Select output format"),
.about("Select output format"),
)
.arg(
Arg::with_name("no-color")
.long("no-color")
.global(true)
.help("Do not highlight(color) output json"),
.about("Do not highlight(color) output json"),
)
.arg(
Arg::with_name("debug")
.long("debug")
.global(true)
.help("Display request parameters"),
.about("Display request parameters"),
)
.arg(
Arg::with_name("wait-for-sync")
.long("wait-for-sync")
.global(true)
.help(
.about(
"Ensure the index-store synchronizes completely before command being executed",
),
);

#[cfg(unix)]
let app = app.subcommand(SubCommand::with_name("tui").about("Enter TUI mode"));
let app = app.subcommand(App::new("tui").about("Enter TUI mode"));

app
}

pub fn build_interactive() -> App<'static, 'static> {
pub fn build_interactive() -> App<'static> {
App::new("interactive")
.version(crate_version!())
.global_setting(AppSettings::NoBinaryName)
.global_setting(AppSettings::ColoredHelp)
.global_setting(AppSettings::DeriveDisplayOrder)
.global_setting(AppSettings::DisableVersion)
.subcommand(
SubCommand::with_name("config")
App::new("config")
.about("Config environment")
.arg(
Arg::with_name("url")
.long("url")
.validator(|input| UrlParser.validate(input))
.takes_value(true)
.help("Config RPC API url"),
.about("Config RPC API url"),
)
.arg(
Arg::with_name("color")
.long("color")
.help("Switch color for rpc interface"),
.about("Switch color for rpc interface"),
)
.arg(
Arg::with_name("debug")
.long("debug")
.help("Switch debug mode"),
.about("Switch debug mode"),
)
.arg(
Arg::with_name("output-format")
.long("output-format")
.takes_value(true)
.possible_values(&["yaml", "json"])
.default_value("yaml")
.help("Select output format"),
.about("Select output format"),
)
.arg(
Arg::with_name("completion_style")
.long("completion_style")
.help("Switch completion style"),
.about("Switch completion style"),
)
.arg(
Arg::with_name("edit_style")
.long("edit_style")
.help("Switch edit style"),
.about("Switch edit style"),
),
)
.subcommand(SubCommand::with_name("info").about("Display global variables"))
.subcommand(App::new("info").about("Display global variables"))
.subcommand(
SubCommand::with_name("exit")
App::new("exit")
.visible_alias("quit")
.about("Exit the interactive interface"),
)
Expand Down
Loading

0 comments on commit 0fc435d

Please sign in to comment.