From 8437d8461e29c0217cd3f1725319c71a9ff7562d Mon Sep 17 00:00:00 2001 From: Linfeng Qian Date: Tue, 10 Dec 2019 15:02:33 +0800 Subject: [PATCH 01/10] feat: Allow import keystore exported from Neuron --- ckb-sdk/src/wallet/keystore/error.rs | 3 +++ ckb-sdk/src/wallet/keystore/mod.rs | 30 ++++++++++++++++------- src/interactive.rs | 2 +- src/subcommands/account.rs | 36 ++++++++++++++++++++++++++-- 4 files changed, 59 insertions(+), 12 deletions(-) diff --git a/ckb-sdk/src/wallet/keystore/error.rs b/ckb-sdk/src/wallet/keystore/error.rs index 65e4a6ea..88286f2b 100644 --- a/ckb-sdk/src/wallet/keystore/error.rs +++ b/ckb-sdk/src/wallet/keystore/error.rs @@ -14,6 +14,9 @@ pub enum Error { #[fail(display = "Key mismatch, got {:x}, expected: {:x}", got, expected)] KeyMismatch { got: H160, expected: H160 }, + #[fail(display = "Key already exists {:x}", _0)] + KeyExists(H160), + #[fail(display = "Wrong password for {:x}", _0)] WrongPassword(H160), diff --git a/ckb-sdk/src/wallet/keystore/mod.rs b/ckb-sdk/src/wallet/keystore/mod.rs index f42e769d..c1e0be30 100644 --- a/ckb-sdk/src/wallet/keystore/mod.rs +++ b/ckb-sdk/src/wallet/keystore/mod.rs @@ -126,9 +126,13 @@ impl KeyStore { new_password: &[u8], ) -> Result { let key = Key::from_json(data, password)?; - let filepath = self.storage.store_key(key.filename(), &key, new_password)?; - self.files.insert(key.hash160().clone(), filepath); - Ok(key.hash160().clone()) + if self.files.contains_key(key.hash160()) { + Err(Error::KeyExists(key.hash160().clone())) + } else { + let filepath = self.storage.store_key(key.filename(), &key, new_password)?; + self.files.insert(key.hash160().clone(), filepath); + Ok(key.hash160().clone()) + } } pub fn import_secp_key( &mut self, @@ -136,14 +140,22 @@ impl KeyStore { password: &[u8], ) -> Result { let key = Key::new(MasterPrivKey::from_secp_key(key)); - let filepath = self.storage.store_key(key.filename(), &key, password)?; - self.files.insert(key.hash160().clone(), filepath); - Ok(key.hash160().clone()) + if self.files.contains_key(key.hash160()) { + Err(Error::KeyExists(key.hash160().clone())) + } else { + let filepath = self.storage.store_key(key.filename(), &key, password)?; + self.files.insert(key.hash160().clone(), filepath); + Ok(key.hash160().clone()) + } } pub fn import_key(&mut self, key: &Key, password: &[u8]) -> Result { - let filepath = self.storage.store_key(key.filename(), key, password)?; - self.files.insert(key.hash160().clone(), filepath); - Ok(key.hash160().clone()) + if self.files.contains_key(key.hash160()) { + Err(Error::KeyExists(key.hash160().clone())) + } else { + let filepath = self.storage.store_key(key.filename(), key, password)?; + self.files.insert(key.hash160().clone(), filepath); + Ok(key.hash160().clone()) + } } pub fn export( &self, diff --git a/src/interactive.rs b/src/interactive.rs index b265b4e9..d1500ddd 100644 --- a/src/interactive.rs +++ b/src/interactive.rs @@ -153,7 +153,7 @@ impl InteractiveEnv { } Ok(false) => {} Err(err) => { - eprintln!("{}", err.to_string()); + eprintln!("{}", err); } } rl.add_history_entry(line.as_str()); diff --git a/src/subcommands/account.rs b/src/subcommands/account.rs index 97b639cf..4e8394a1 100644 --- a/src/subcommands/account.rs +++ b/src/subcommands/account.rs @@ -13,8 +13,8 @@ use clap::{App, Arg, ArgMatches, SubCommand}; use super::CliSubCommand; use crate::utils::{ arg_parser::{ - ArgParser, DurationParser, ExtendedPrivkeyPathParser, FixedHashParser, FromStrParser, - PrivkeyPathParser, PrivkeyWrapper, + ArgParser, DurationParser, ExtendedPrivkeyPathParser, FilePathParser, FixedHashParser, + FromStrParser, PrivkeyPathParser, PrivkeyWrapper, }, other::read_password, printer::{OutputFormat, Printable}, @@ -62,6 +62,16 @@ impl<'a> AccountSubCommand<'a> { .required_unless("privkey-path") .validator(|input| ExtendedPrivkeyPathParser.validate(input)) ), + SubCommand::with_name("import-keystore") + .about("Import key from encrypted keystore json file and create a new account.") + .arg( + Arg::with_name("path") + .long("path") + .takes_value(true) + .required(true) + .validator(|input| FilePathParser::new(true).validate(input)) + .help("The keystore file path (json format)") + ), SubCommand::with_name("unlock") .about("Unlock an account") .arg(arg_lock_arg.clone()) @@ -218,6 +228,28 @@ impl<'a> CliSubCommand for AccountSubCommand<'a> { }); Ok(resp.render(format, color)) } + ("import-keystore", Some(m)) => { + let path: PathBuf = FilePathParser::new(true).from_matches(m, "path")?; + + let old_password = read_password(false, Some("Decrypt password"))?; + let new_password = read_password(true, None)?; + let content = fs::read_to_string(path).map_err(|err| err.to_string())?; + let data: serde_json::Value = + serde_json::from_str(&content).map_err(|err| err.to_string())?; + let lock_arg = self + .key_store + .import(&data, old_password.as_bytes(), new_password.as_bytes()) + .map_err(|err| err.to_string())?; + let address_payload = AddressPayload::from_pubkey_hash(lock_arg.clone()); + let resp = serde_json::json!({ + "lock_arg": format!("{:x}", lock_arg), + "address": { + "mainnet": Address::new(NetworkType::Mainnet, address_payload.clone()).to_string(), + "testnet": Address::new(NetworkType::Testnet, address_payload.clone()).to_string(), + }, + }); + Ok(resp.render(format, color)) + } ("unlock", Some(m)) => { let lock_arg: H160 = FixedHashParser::::default().from_matches(m, "lock-arg")?; From 9b13adfcaa1f9edfa9ee35a3ae0587ae2a9ea095 Mon Sep 17 00:00:00 2001 From: keroro520 Date: Thu, 12 Dec 2019 21:44:43 +0800 Subject: [PATCH 02/10] feat: Add miner RPC interfaces --- ckb-sdk/src/rpc/client.rs | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/ckb-sdk/src/rpc/client.rs b/ckb-sdk/src/rpc/client.rs index c4c70453..1f3ef2ba 100644 --- a/ckb-sdk/src/rpc/client.rs +++ b/ckb-sdk/src/rpc/client.rs @@ -1,7 +1,8 @@ use ckb_jsonrpc_types::{ - BannedAddr, BlockNumber, BlockReward, BlockView, CellOutputWithOutPoint, CellTransaction, - CellWithStatus, ChainInfo, EpochNumber, EpochView, HeaderView, LiveCell, LockHashIndexState, - Node, OutPoint, PeerState, Timestamp, Transaction, TransactionWithStatus, TxPoolInfo, Uint64, + BannedAddr, Block, BlockNumber, BlockReward, BlockTemplate, BlockView, CellOutputWithOutPoint, + CellTransaction, CellWithStatus, ChainInfo, EpochNumber, EpochView, HeaderView, LiveCell, + LockHashIndexState, Node, OutPoint, PeerState, Timestamp, Transaction, TransactionWithStatus, + TxPoolInfo, Uint64, Version, }; use jsonrpc_client_core::{expand_params, jsonrpc_client}; use jsonrpc_client_http::{HttpHandle, HttpTransport}; @@ -72,6 +73,10 @@ jsonrpc_client!(pub struct RawRpcClient { pub fn add_node(&mut self, peer_id: String, address: String) -> RpcRequest<()>; pub fn remove_node(&mut self, peer_id: String) -> RpcRequest<()>; pub fn broadcast_transaction(&mut self, tx: Transaction) -> RpcRequest; + + // Miner + pub fn get_block_template(&mut self, bytes_limit: Option, proposals_limit: Option, max_version: Option) -> RpcRequest; + pub fn submit_block(&mut self, _work_id: String, _data: Block) -> RpcRequest; }); impl RawRpcClient { @@ -355,4 +360,27 @@ impl HttpRpcClient { .call() .map_err(|err| err.to_string()) } + + // Miner + pub fn get_block_template( + &mut self, + bytes_limit: Option, + proposals_limit: Option, + max_version: Option, + ) -> Result { + self.client + .get_block_template( + bytes_limit.map(Into::into), + proposals_limit.map(Into::into), + max_version.map(Into::into), + ) + .call() + .map_err(|err| err.to_string()) + } + pub fn submit_block(&mut self, work_id: String, data: packed::Block) -> Result { + self.client + .submit_block(work_id, data.into()) + .call() + .map_err(|err| err.to_string()) + } } From 7830db2307f2f7bf7cb42dc0881b76a04abe0d2f Mon Sep 17 00:00:00 2001 From: keroro520 Date: Thu, 12 Dec 2019 21:43:56 +0800 Subject: [PATCH 03/10] feat: Impl basic test framework --- test/Cargo.toml | 8 +++ test/src/app.rs | 56 ++++++++++++++++ test/src/main.rs | 124 +++++++++-------------------------- test/src/miner.rs | 74 +++++++++++++++++++++ test/src/setup.rs | 153 +++++++++++++++++++++++++++++++++++++++++++ test/src/spec/mod.rs | 15 +++++ test/src/spec/rpc.rs | 12 ++++ test/src/util.rs | 45 +++++++++++++ 8 files changed, 395 insertions(+), 92 deletions(-) create mode 100644 test/src/app.rs create mode 100644 test/src/miner.rs create mode 100644 test/src/setup.rs create mode 100644 test/src/spec/mod.rs create mode 100644 test/src/spec/rpc.rs create mode 100644 test/src/util.rs diff --git a/test/Cargo.toml b/test/Cargo.toml index 10eb1b39..8c008f9c 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -11,6 +11,14 @@ clap = "2" tempfile = "3.0" log = "0.4" env_logger = "0.6" +toml = "0.5.0" +ckb-sdk = { path = "../ckb-sdk" } +ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } +ckb-app-config = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } +ckb-chain-spec = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } +ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2", features = ["secp"] } +ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } +regex = "1.1.6" # Prevent this from interfering with workspaces [workspace] diff --git a/test/src/app.rs b/test/src/app.rs new file mode 100644 index 00000000..efb4a5ff --- /dev/null +++ b/test/src/app.rs @@ -0,0 +1,56 @@ +use clap; +use std::path::Path; + +#[derive(Debug, Clone)] +pub struct App { + ckb_bin: String, + cli_bin: String, +} + +impl App { + pub fn init() -> Self { + let matches = Self::matches(); + let ckb_bin = matches.value_of("ckb-bin").unwrap().to_string(); + let cli_bin = matches.value_of("cli-bin").unwrap().to_string(); + assert!( + Path::new(&ckb_bin).exists(), + "ckb-bin binary not exists: {}", + ckb_bin + ); + assert!( + Path::new(&cli_bin).exists(), + "ckb-cli binary not exists: {}", + cli_bin + ); + Self { ckb_bin, cli_bin } + } + + pub fn ckb_bin(&self) -> &str { + &self.ckb_bin + } + + pub fn cli_bin(&self) -> &str { + &self.cli_bin + } + + fn matches<'a>() -> clap::ArgMatches<'a> { + clap::App::new("ckb-cli-test") + .arg( + clap::Arg::with_name("ckb-bin") + .long("ckb-bin") + .takes_value(true) + .required(true) + .value_name("PATH") + .help("Path to ckb executable"), + ) + .arg( + clap::Arg::with_name("cli-bin") + .long("cli-bin") + .takes_value(true) + .required(true) + .value_name("PATH") + .help("Path to ckb-cli executable"), + ) + .get_matches() + } +} diff --git a/test/src/main.rs b/test/src/main.rs index 720a0cb8..7f452e21 100644 --- a/test/src/main.rs +++ b/test/src/main.rs @@ -1,52 +1,33 @@ +pub mod app; +pub mod miner; +pub mod setup; +pub mod spec; +pub mod util; + +use crate::app::App; +use crate::setup::Setup; +use crate::spec::{RpcGetTipBlockNumber, Spec}; +use crate::util::{find_available_port, run_cmd, temp_dir}; use std::env; -use std::path::Path; -use std::process::{Child, Command, Stdio}; -use std::thread; -use std::time::Duration; - -use clap::{App, Arg}; -use tempfile::{tempdir, TempDir}; fn main() { + env::set_var("RUST_BACKTRACE", "full"); let _ = { let filter = env::var("CKB_LOG").unwrap_or_else(|_| "info".to_string()); env_logger::builder().parse_filters(&filter).try_init() }; - let matches = App::new("ckb-cli-test") - .arg( - Arg::with_name("ckb-bin") - .long("ckb-bin") - .takes_value(true) - .required(true) - .value_name("PATH") - .help("Path to ckb executable"), - ) - .arg( - Arg::with_name("cli-bin") - .long("cli-bin") - .takes_value(true) - .required(true) - .value_name("PATH") - .help("Path to ckb-cli executable"), - ) - .get_matches(); - let ckb_bin = matches.value_of("ckb-bin").unwrap(); - let cli_bin = matches.value_of("cli-bin").unwrap(); - assert!( - Path::new(ckb_bin).exists(), - "ckb binary not exists: {}", - ckb_bin - ); - assert!( - Path::new(cli_bin).exists(), - "ckb-cli binary not exists: {}", - cli_bin - ); + let app = app::App::init(); + for spec in all_specs() { + run_spec(spec, &app); + } +} - let (tmpdir, ckb_dir) = temp_dir(); - log::info!("ckb init: {}", ckb_dir); +fn run_spec(spec: Box, app: &App) { + let (_tempdir, ckb_dir) = temp_dir(); + let rpc_port = find_available_port(8000, 8999); + let p2p_port = find_available_port(9000, 9999); let _stdout = run_cmd( - ckb_bin, + app.ckb_bin(), vec![ "-C", ckb_dir.as_str(), @@ -54,63 +35,22 @@ fn main() { "--chain", "dev", "--rpc-port", - "9000", + &rpc_port.to_string(), "--p2p-port", - "9001", + &p2p_port.to_string(), ], ); - log::info!("ckb run"); - let child_process = Command::new(ckb_bin.to_owned()) - .env("RUST_BACKTRACE", "full") - .args(&["-C", ckb_dir.as_str(), "run", "--ba-advanced"]) - .stdin(Stdio::null()) - .stdout(Stdio::null()) - .stderr(Stdio::inherit()) - .spawn() - .expect("Run `ckb run` failed"); - let _guard = ProcessGuard(child_process); - thread::sleep(Duration::from_secs(3)); - - log::info!( - "[Output]:\n{}", - run_cmd( - cli_bin, - vec!["--url", "http://127.0.0.1:9000", "rpc", "get_tip_header"] - ) + let mut setup = Setup::new( + app.ckb_bin().to_string(), + app.cli_bin().to_string(), + ckb_dir, + rpc_port, ); - tmpdir.close().expect("Close tmp dir failed"); -} - -fn run_cmd(bin: &str, args: Vec<&str>) -> String { - log::info!("[Execute]: {:?}", args); - let init_output = Command::new(bin.to_owned()) - .env("RUST_BACKTRACE", "full") - .args(&args) - .output() - .expect("Run command failed"); - - if !init_output.status.success() { - log::error!("{}", String::from_utf8_lossy(init_output.stderr.as_slice())); - panic!("Fail to execute command"); - } - String::from_utf8_lossy(init_output.stdout.as_slice()).to_string() -} - -struct ProcessGuard(pub Child); - -impl Drop for ProcessGuard { - fn drop(&mut self) { - match self.0.kill() { - Err(e) => log::error!("Could not kill ckb process: {}", e), - Ok(_) => log::debug!("Successfully killed ckb process"), - } - let _ = self.0.wait(); - } + let _guard = setup.ready(&*spec); + spec.run(&mut setup); } -pub fn temp_dir() -> (TempDir, String) { - let tempdir = tempdir().expect("create tempdir failed"); - let path = tempdir.path().to_str().unwrap().to_owned(); - (tempdir, path) +fn all_specs() -> Vec> { + vec![Box::new(RpcGetTipBlockNumber)] } diff --git a/test/src/miner.rs b/test/src/miner.rs new file mode 100644 index 00000000..edc2b9e7 --- /dev/null +++ b/test/src/miner.rs @@ -0,0 +1,74 @@ +use crate::util::temp_dir; +use ckb_app_config::BlockAssemblerConfig; +use ckb_sdk::{Address, AddressPayload, HttpRpcClient, NetworkType}; +use ckb_types::packed::Block; +use ckb_types::{H160, H256}; +use std::fs; +use std::sync::Mutex; +use tempfile::TempDir; + +pub const MINER_PRIVATE_KEY: &str = + "d00c06bfd800d27397002dca6fb0993d5ba6399b4238b2f29ee9deb97593d2bc"; +pub const MINER_BLOCK_ASSEMBLER: &str = r#" +code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +hash_type = "type" +args = "0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7" +message = "0x" +"#; + +pub struct Miner { + rpc: Mutex, + privkey_path: (TempDir, String), +} + +impl Miner { + pub fn init(uri: String) -> Self { + let (tempdir, _) = temp_dir(); + let privkey_path = tempdir.path().join("pk"); + fs::write(&privkey_path, MINER_PRIVATE_KEY).unwrap(); + Self { + rpc: Mutex::new(HttpRpcClient::new(uri)), + privkey_path: (tempdir, privkey_path.to_string_lossy().to_string()), + } + } + + pub fn generate_block(&self) -> H256 { + let template = self + .rpc + .lock() + .unwrap() + .get_block_template(None, None, None) + .expect("RPC get_block_template"); + let work_id = template.work_id.value(); + let block = Into::::into(template); + self.rpc + .lock() + .unwrap() + .submit_block(work_id.to_string(), block) + .expect("RPC submit_block") + } + + pub fn generate_blocks(&self, count: u64) { + (0..count).for_each(|_| { + self.generate_block(); + }) + } + + pub fn privkey_path(&self) -> &str { + &self.privkey_path.1 + } + + pub fn block_assembler() -> BlockAssemblerConfig { + toml::from_str(MINER_BLOCK_ASSEMBLER).unwrap() + } + + pub fn address() -> Address { + let lock_arg = { + let mut lock_arg = [0u8; 20]; + lock_arg.copy_from_slice(Self::block_assembler().args.as_bytes()); + H160(lock_arg) + }; + let payload = AddressPayload::from_pubkey_hash(lock_arg); + Address::new(NetworkType::Dev, payload) + } +} diff --git a/test/src/setup.rs b/test/src/setup.rs new file mode 100644 index 00000000..3081b791 --- /dev/null +++ b/test/src/setup.rs @@ -0,0 +1,153 @@ +use crate::miner::Miner; +use crate::spec::Spec; +use crate::util::ProcessGuard; +use ckb_app_config::CKBAppConfig; +use ckb_chain_spec::consensus::Consensus; +use ckb_chain_spec::ChainSpec; +use std::fs; +use std::io::Write; +use std::path::Path; +use std::process::{Command, Stdio}; +use std::thread::sleep; +use std::time::{Duration, Instant}; + +pub struct Setup { + ckb_bin: String, + cli_bin: String, + ckb_dir: String, + rpc_port: u16, + miner: Option, +} + +// TODO Make CLI base_dir configurable +impl Setup { + pub fn new(ckb_bin: String, cli_bin: String, ckb_dir: String, rpc_port: u16) -> Self { + Self { + ckb_bin, + cli_bin, + ckb_dir, + rpc_port, + miner: None, + } + } + + pub fn ready(&mut self, spec: &dyn Spec) -> ProcessGuard { + self.modify_ckb_toml(&*spec); + self.modify_spec_toml(&*spec); + + let child_process = Command::new(&self.ckb_bin) + .env("RUST_BACKTRACE", "full") + .args(&["-C", &self.ckb_dir, "run", "--ba-advanced"]) + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::inherit()) + .spawn() + .expect("Run `ckb run` failed"); + sleep(Duration::from_secs(3)); // Wait for ckb starting RPC thread + ProcessGuard(child_process) + } + + pub fn miner(&mut self) -> &Miner { + if self.miner.is_none() { + self.miner = Some(Miner::init(self.rpc_url())); + } + self.miner.as_ref().unwrap() + } + + pub fn rpc_url(&self) -> String { + format!("http://127.0.0.1:{}", self.rpc_port) + } + + pub fn consensus(&self) -> Consensus { + let path = Path::new(&self.ckb_dir).join("specs").join("dev.toml"); + let content = fs::read_to_string(&path).unwrap(); + let spec_toml: ChainSpec = toml::from_str(&content).unwrap(); + spec_toml.build_consensus().unwrap() + } + + pub fn cli(&self, command: &str) -> String { + log::info!("[Execute]: {}", command); + loop { + let mut child = Command::new(&self.cli_bin) + .args(vec!["--url", &self.rpc_url()]) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .expect("Failed to spawn child process"); + { + let stdin = child.stdin.as_mut().expect("Failed to open stdin"); + stdin + .write_all(command.as_bytes()) + .expect("Failed to write to stdin"); + } + let output = child.wait_with_output().expect("Failed to read stdout"); + let stderr = String::from_utf8_lossy(&output.stderr); + let stdout = String::from_utf8_lossy(&output.stdout); + if stderr.contains("index database may not ready") { + continue; + } else if !stderr.is_empty() && !stderr.contains("No previous history.") { + return stderr.to_string(); + } else { + return extract_output(stdout.to_string()); + } + } + } + + fn modify_ckb_toml(&self, spec: &dyn Spec) { + let path = Path::new(&self.ckb_dir).join("ckb.toml"); + let content = fs::read_to_string(&path).unwrap(); + let mut ckb_toml: CKBAppConfig = toml::from_str(&content).unwrap(); + + // Setup [block_assembler] + ckb_toml.block_assembler = Some(Miner::block_assembler()); + + spec.modify_ckb_toml(&mut ckb_toml); + fs::write(&path, toml::to_string(&ckb_toml).unwrap()).expect("Dump ckb.toml"); + } + + fn modify_spec_toml(&self, spec: &dyn Spec) { + let path = Path::new(&self.ckb_dir).join("specs").join("dev.toml"); + let content = fs::read_to_string(&path).unwrap(); + let mut spec_toml: ChainSpec = toml::from_str(&content).unwrap(); + + // Setup genesis message to generate a random genesis hash + spec_toml.genesis.genesis_cell.message = format!("{:?}", Instant::now()); + + spec.modify_spec_toml(&mut spec_toml); + fs::write(&path, toml::to_string(&spec_toml).unwrap()).expect("Dump dev.toml"); + } +} + +fn extract_output(content: String) -> String { + // _ _ ______ _____ __ __ ____ _____ + // | \ | | | ____| | __ \ \ \ / / / __ \ / ____| + // | \| | | |__ | |__) | \ \ / / | | | | | (___ + // | . ` | | __| | _ / \ \/ / | | | | \___ \ + // | |\ | | |____ | | \ \ \ / | |__| | ____) | + // |_| \_| |______| |_| \_\ \/ \____/ |_____/ + // + // [ ckb-cli version ]: 0.25.0 (a458296-dirty 2019-11-18) + // [ url ]: http://127.0.0.1:8114 + // [ pwd ]: /ckb-cli/test + // [ color ]: true + // [ debug ]: false + // [ output format ]: yaml + // [ completion style ]: List + // [ edit style ]: Emacs + // [ index db state ]: Waiting for first query + // 0x2470ebe5dda09518498376a047e3560e4521ec70d7fc349f1c7bfc716450c6dd + // CTRL-D + + let lines = content.lines(); + let lines = + lines.skip_while(|line| !regex::Regex::new(r#"\[.*\]: .*"#).unwrap().is_match(line)); + let lines = lines.skip_while(|line| regex::Regex::new(r#"\[.*\]: .*"#).unwrap().is_match(line)); + let lines = lines.take_while(|line| *line != "CTRL-D"); + let output: String = lines.collect::>().join("\n"); + if !output.is_empty() { + output + } else { + content + } +} diff --git a/test/src/spec/mod.rs b/test/src/spec/mod.rs new file mode 100644 index 00000000..f38bc1e6 --- /dev/null +++ b/test/src/spec/mod.rs @@ -0,0 +1,15 @@ +mod rpc; + +pub use rpc::*; + +use crate::setup::Setup; +use ckb_app_config::CKBAppConfig; +use ckb_chain_spec::ChainSpec; + +pub trait Spec { + fn modify_ckb_toml(&self, _ckb_toml: &mut CKBAppConfig) {} + + fn modify_spec_toml(&self, _spec_toml: &mut ChainSpec) {} + + fn run(&self, setup: &mut Setup); +} diff --git a/test/src/spec/rpc.rs b/test/src/spec/rpc.rs new file mode 100644 index 00000000..af48c410 --- /dev/null +++ b/test/src/spec/rpc.rs @@ -0,0 +1,12 @@ +use crate::setup::Setup; +use crate::spec::Spec; + +pub struct RpcGetTipBlockNumber; + +impl Spec for RpcGetTipBlockNumber { + fn run(&self, setup: &mut Setup) { + setup.miner().generate_block(); + let output = setup.cli("rpc get_tip_block_number"); + assert_eq!("1".to_string(), output); + } +} diff --git a/test/src/util.rs b/test/src/util.rs new file mode 100644 index 00000000..2d7602f8 --- /dev/null +++ b/test/src/util.rs @@ -0,0 +1,45 @@ +use std::net::TcpListener; +use std::process::{Child, Command}; +use tempfile::{tempdir, TempDir}; + +pub struct ProcessGuard(pub Child); + +impl Drop for ProcessGuard { + fn drop(&mut self) { + match self.0.kill() { + Err(e) => log::error!("Could not kill ckb process: {}", e), + Ok(_) => log::debug!("Successfully killed ckb process"), + } + let _ = self.0.wait(); + } +} + +pub fn run_cmd(bin: &str, args: Vec<&str>) -> String { + log::info!("[Execute]: {} {:?}", bin, args.join(" ")); + let init_output = Command::new(bin.to_owned()) + .env("RUST_BACKTRACE", "full") + .args(&args) + .output() + .expect("Run command failed"); + + if !init_output.status.success() { + log::error!("{}", String::from_utf8_lossy(init_output.stderr.as_slice())); + panic!("Fail to execute command"); + } + String::from_utf8_lossy(init_output.stdout.as_slice()).to_string() +} + +pub fn find_available_port(start: u16, end: u16) -> u16 { + for port in start..=end { + if TcpListener::bind(("127.0.0.1", port)).is_ok() { + return port; + } + } + unreachable!() +} + +pub fn temp_dir() -> (TempDir, String) { + let tempdir = tempdir().expect("create tempdir failed"); + let path = tempdir.path().to_str().unwrap().to_owned(); + (tempdir, path) +} From 36954d68a58fdece8a94cce820f3268b04cbfaa8 Mon Sep 17 00:00:00 2001 From: Linfeng Qian Date: Tue, 10 Dec 2019 19:35:49 +0800 Subject: [PATCH 04/10] perf: Speed up sync index database Fix --wait-for-sync --- ckb-index/src/index/mod.rs | 6 +- ckb-index/src/index/types.rs | 29 +++-- src/interactive.rs | 5 +- src/main.rs | 7 +- src/subcommands/mod.rs | 5 +- src/subcommands/tui/mod.rs | 6 +- src/subcommands/wallet/index.rs | 204 +++----------------------------- src/subcommands/wallet/mod.rs | 6 +- src/utils/config.rs | 6 +- src/utils/index.rs | 200 +++++++++++++++++++++++++++++++ src/utils/mod.rs | 1 + src/utils/other.rs | 33 +++--- 12 files changed, 272 insertions(+), 236 deletions(-) create mode 100644 src/utils/index.rs diff --git a/ckb-index/src/index/mod.rs b/ckb-index/src/index/mod.rs index 0adbd7f0..6a4125d8 100644 --- a/ckb-index/src/index/mod.rs +++ b/ckb-index/src/index/mod.rs @@ -303,8 +303,10 @@ impl<'a> IndexDatabase<'a> { }; let mut txn = RocksTxn::new(self.db, self.cf); - for block in blocks { - let block_delta_info = BlockDeltaInfo::from_block(&block, &txn); + let blocks_len = blocks.len(); + for (idx, block) in blocks.into_iter().enumerate() { + let clear_old = idx + 1 == blocks_len; + let block_delta_info = BlockDeltaInfo::from_block(&block, &txn, clear_old); let number = block_delta_info.number(); let hash = block_delta_info.hash(); let result = block_delta_info.apply(&mut txn, self.enable_explorer); diff --git a/ckb-index/src/index/types.rs b/ckb-index/src/index/types.rs index 7aa3fed6..e71efb57 100644 --- a/ckb-index/src/index/types.rs +++ b/ckb-index/src/index/types.rs @@ -64,6 +64,7 @@ impl BlockDeltaInfo { pub(crate) fn from_block<'r, T: KVReader<'r>>( block: &BlockView, reader: &'r T, + clear_old: bool, ) -> BlockDeltaInfo { let block_header: HeaderView = block.header().clone(); let block_number = block_header.number(); @@ -72,26 +73,28 @@ impl BlockDeltaInfo { // Collect old headers to be deleted let mut old_headers = Vec::new(); let mut old_blocks = Vec::new(); - for (key_bytes, _) in reader.iter_from(&KeyType::RecentHeader.to_bytes()) { - if let Key::RecentHeader(number) = Key::from_bytes(&key_bytes) { - if number + KEEP_RECENT_HEADERS <= block_number { - old_headers.push(number); + if clear_old { + for (key_bytes, _) in reader.iter_from(&KeyType::RecentHeader.to_bytes()) { + if let Key::RecentHeader(number) = Key::from_bytes(&key_bytes) { + if number + KEEP_RECENT_HEADERS <= block_number { + old_headers.push(number); + } else { + break; + } } else { break; } - } else { - break; } - } - for (key_bytes, _) in reader.iter_from(&KeyType::BlockDelta.to_bytes()) { - if let Key::BlockDelta(number) = Key::from_bytes(&key_bytes) { - if number + KEEP_RECENT_BLOCKS <= block_number { - old_blocks.push(number); + for (key_bytes, _) in reader.iter_from(&KeyType::BlockDelta.to_bytes()) { + if let Key::BlockDelta(number) = Key::from_bytes(&key_bytes) { + if number + KEEP_RECENT_BLOCKS <= block_number { + old_blocks.push(number); + } else { + break; + } } else { break; } - } else { - break; } } log::info!( diff --git a/src/interactive.rs b/src/interactive.rs index 7947248e..3618cd56 100644 --- a/src/interactive.rs +++ b/src/interactive.rs @@ -12,12 +12,13 @@ use rustyline::{Cmd, CompletionType, Config, EditMode, Editor, KeyPress}; use serde_json::json; use crate::subcommands::{ - AccountSubCommand, CliSubCommand, IndexController, IndexRequest, MockTxSubCommand, - MoleculeSubCommand, RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, + AccountSubCommand, CliSubCommand, MockTxSubCommand, MoleculeSubCommand, RpcSubCommand, + TxSubCommand, UtilSubCommand, WalletSubCommand, }; use crate::utils::{ completer::CkbCompleter, config::GlobalConfig, + index::{IndexController, IndexRequest}, other::{check_alerts, get_network_type, index_dirname}, printer::{ColorWhen, OutputFormat, Printable}, }; diff --git a/src/main.rs b/src/main.rs index df1fa43d..00fd617f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,13 +16,14 @@ use subcommands::TuiSubCommand; use interactive::InteractiveEnv; use subcommands::{ - start_index_thread, AccountSubCommand, CliSubCommand, IndexThreadState, MockTxSubCommand, - MoleculeSubCommand, RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, + start_index_thread, AccountSubCommand, CliSubCommand, MockTxSubCommand, MoleculeSubCommand, + RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, }; use utils::other::sync_to_tip; use utils::{ arg_parser::{ArgParser, UrlParser}, config::GlobalConfig, + index::IndexThreadState, other::{check_alerts, get_key_store, get_network_type, index_dirname}, printer::{ColorWhen, OutputFormat}, }; @@ -97,7 +98,7 @@ fn main() -> Result<(), io::Error> { // to the tip before executing the command. let wait_for_sync = matches.is_present("wait-for-sync"); if wait_for_sync { - if let Err(err) = sync_to_tip(&mut rpc_client, &index_dir) { + if let Err(err) = sync_to_tip(&index_controller) { eprintln!("Synchronize error: {}", err); process::exit(1); } diff --git a/src/subcommands/mod.rs b/src/subcommands/mod.rs index 2b9f0707..898359a5 100644 --- a/src/subcommands/mod.rs +++ b/src/subcommands/mod.rs @@ -17,10 +17,7 @@ pub use molecule::MoleculeSubCommand; pub use rpc::RpcSubCommand; pub use tx::TxSubCommand; pub use util::UtilSubCommand; -pub use wallet::{ - start_index_thread, IndexController, IndexRequest, IndexResponse, IndexThreadState, - WalletSubCommand, -}; +pub use wallet::{start_index_thread, WalletSubCommand}; use clap::ArgMatches; diff --git a/src/subcommands/tui/mod.rs b/src/subcommands/tui/mod.rs index 43ca84c7..681ece6b 100644 --- a/src/subcommands/tui/mod.rs +++ b/src/subcommands/tui/mod.rs @@ -27,8 +27,10 @@ use ckb_types::{ H256, }; -use super::wallet::{IndexController, IndexRequest}; -use crate::utils::other::get_network_type; +use crate::utils::{ + index::{IndexController, IndexRequest}, + other::get_network_type, +}; use state::{start_rpc_thread, State, SummaryInfo}; use util::{human_capacity, ts_now, App, Event, Events, TabsState}; use widgets::List; diff --git a/src/subcommands/wallet/index.rs b/src/subcommands/wallet/index.rs index f3d2b433..bedc3812 100644 --- a/src/subcommands/wallet/index.rs +++ b/src/subcommands/wallet/index.rs @@ -1,4 +1,3 @@ -use std::fmt; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; @@ -9,193 +8,33 @@ use ckb_index::{with_index_db, IndexDatabase}; use ckb_sdk::GenesisInfo; use ckb_sdk::HttpRpcClient; use ckb_types::{ - core::{service::Request, BlockView, HeaderView}, + core::{service::Request, BlockView}, prelude::*, H256, }; use ckb_util::RwLock; -use crossbeam_channel::{Receiver, Sender}; -use serde_derive::{Deserialize, Serialize}; +use crossbeam_channel::Receiver; +use crate::utils::index::{IndexController, IndexRequest, IndexResponse, IndexThreadState}; use crate::utils::other::get_network_type; -pub enum IndexRequest { - UpdateUrl(String), -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum IndexResponse { - Ok, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CapacityResult { - pub lock_hash: H256, - pub address: Option, - pub capacity: u64, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SimpleBlockInfo { - epoch: (u64, u64, u64), - number: u64, - hash: H256, -} - -impl From for SimpleBlockInfo { - fn from(header: HeaderView) -> SimpleBlockInfo { - let epoch = header.epoch(); - SimpleBlockInfo { - number: header.number(), - epoch: (epoch.number(), epoch.index(), epoch.length()), - hash: header.hash().unpack(), - } - } -} - -#[derive(Debug, Clone)] -pub enum IndexThreadState { - // wait first request to start - WaitToStart, - // Started init db - StartInit, - // Process after init db - Processing(Option, u64), - Error(String), - // Thread exit - Stopped, -} - -impl IndexThreadState { - fn start_init(&mut self) { - *self = IndexThreadState::StartInit; - } - fn processing(&mut self, header: Option, tip_number: u64) { - let block_info = header.map(Into::into); - *self = IndexThreadState::Processing(block_info, tip_number); - } - fn error(&mut self, err: String) { - *self = IndexThreadState::Error(err); - } - fn stop(&mut self) { - *self = IndexThreadState::Stopped; - } - pub fn is_started(&self) -> bool { - match self { - IndexThreadState::WaitToStart => false, - _ => true, - } - } - pub fn is_stopped(&self) -> bool { - match self { - IndexThreadState::Stopped => true, - _ => false, - } - } - pub fn is_error(&self) -> bool { - match self { - IndexThreadState::Error(_) => true, - _ => false, - } - } - #[cfg_attr(windows, allow(dead_code))] - pub fn is_processing(&self) -> bool { - match self { - IndexThreadState::Processing(Some(_), _) => true, - _ => false, - } - } -} - -impl fmt::Display for IndexThreadState { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - let output = match self { - IndexThreadState::WaitToStart => "Waiting for first query".to_owned(), - IndexThreadState::StartInit => "Initializing".to_owned(), - IndexThreadState::Error(err) => format!("Error: {}", err), - IndexThreadState::Processing(Some(SimpleBlockInfo { number, .. }), tip_number) => { - let status = if tip_number == number { - "synced".to_owned() - } else { - format!("tip#{}", tip_number) - }; - format!("Processed block#{} ({})", number, status) - } - IndexThreadState::Processing(None, tip_number) => { - format!("Initializing (tip#{})", tip_number) - } - IndexThreadState::Stopped => "Stopped".to_owned(), - }; - write!(f, "{}", output) - } -} - -impl Default for IndexThreadState { - fn default() -> IndexThreadState { - IndexThreadState::WaitToStart - } -} - -pub struct IndexController { - state: Arc>, - sender: Sender>, - shutdown: Arc, -} - -impl Clone for IndexController { - fn clone(&self) -> IndexController { - IndexController { - state: Arc::clone(&self.state), - shutdown: Arc::clone(&self.shutdown), - sender: self.sender.clone(), - } - } -} - -impl IndexController { - pub fn state(&self) -> &Arc> { - &self.state - } - pub fn sender(&self) -> &Sender> { - &self.sender - } - pub fn shutdown(&self) { - let start_time = Instant::now(); - self.shutdown.store(true, Ordering::Relaxed); - while self.state().read().is_started() && !self.state().read().is_stopped() { - if self.state().read().is_error() { - return; - } - if start_time.elapsed() < Duration::from_secs(10) { - thread::sleep(Duration::from_millis(50)); - } else { - eprintln!( - "Stop index thread timeout(state: {}), give up", - self.state().read().to_string() - ); - return; - } - } - } -} - pub fn start_index_thread( url: &str, index_dir: PathBuf, state: Arc>, ) -> IndexController { - let mut rpc_url = url.to_owned(); let (sender, receiver) = crossbeam_channel::bounded::>(1); let shutdown = Arc::new(AtomicBool::new(false)); let state_clone = Arc::clone(&state); let shutdown_clone = Arc::clone(&shutdown); + let mut rpc_client = HttpRpcClient::new(url.to_owned()); thread::Builder::new() .name("index".to_string()) .spawn(move || { loop { // Wait first request - match try_recv(&receiver, &mut rpc_url) { + match try_recv(&receiver, &mut rpc_client) { Some(true) => { state.write().stop(); log::info!("Index database thread stopped"); @@ -206,11 +45,9 @@ pub fn start_index_thread( } } - let mut rpc_client = HttpRpcClient::new(rpc_url.clone()); loop { match process( &receiver, - &mut rpc_url, &mut rpc_client, &index_dir, &state, @@ -235,30 +72,21 @@ pub fn start_index_thread( }) .expect("Spawn index thread failed"); - IndexController { - state: state_clone, - sender, - shutdown, - } + IndexController::new(state_clone, sender, shutdown) } fn process( receiver: &Receiver>, - rpc_url: &mut String, rpc_client: &mut HttpRpcClient, index_dir: &PathBuf, state: &Arc>, shutdown: &Arc, ) -> Result { - let old_rpc_url = rpc_url.clone(); - if let Some(exit) = try_recv(&receiver, rpc_url) { + if let Some(exit) = try_recv(&receiver, rpc_client) { return Ok(exit); } state.write().start_init(); - if &old_rpc_url != rpc_url { - *rpc_client = HttpRpcClient::new(rpc_url.clone()); - } let genesis_block: BlockView = rpc_client .get_block_by_number(0)? .expect("Can not get genesis block?") @@ -291,7 +119,7 @@ fn process( if shutdown.load(Ordering::Relaxed) { return Ok(Some(true)); } - if let Some(exit) = try_recv(&receiver, rpc_url) { + if let Some(exit) = try_recv(&receiver, rpc_client) { return Ok(Some(exit)); } if let Some(next_block) = @@ -322,7 +150,7 @@ fn process( if shutdown.load(Ordering::Relaxed) { return Ok(true); } - if let Some(exit) = try_recv(&receiver, rpc_url) { + if let Some(exit) = try_recv(&receiver, rpc_client) { return Ok(exit); } thread::sleep(Duration::from_millis(100)); @@ -331,10 +159,10 @@ fn process( fn try_recv( receiver: &Receiver>, - rpc_url: &mut String, + rpc_client: &mut HttpRpcClient, ) -> Option { match receiver.try_recv() { - Ok(request) => Some(process_request(request, rpc_url)), + Ok(request) => Some(process_request(request, rpc_client)), Err(err) => { if err.is_disconnected() { log::info!("Sender dropped, exit index thread"); @@ -346,15 +174,21 @@ fn try_recv( } } -fn process_request(request: Request, rpc_url: &mut String) -> bool { +fn process_request( + request: Request, + rpc_client: &mut HttpRpcClient, +) -> bool { let Request { responder, arguments, } = request; match arguments { IndexRequest::UpdateUrl(url) => { - *rpc_url = url; + if url != rpc_client.url() { + *rpc_client = HttpRpcClient::new(url); + } responder.send(IndexResponse::Ok).is_err() } + IndexRequest::Kick => false, } } diff --git a/src/subcommands/wallet/mod.rs b/src/subcommands/wallet/mod.rs index 8015ab34..e3adf505 100644 --- a/src/subcommands/wallet/mod.rs +++ b/src/subcommands/wallet/mod.rs @@ -20,6 +20,7 @@ use crate::utils::{ AddressParser, ArgParser, CapacityParser, FixedHashParser, FromStrParser, PrivkeyPathParser, PrivkeyWrapper, }, + index::IndexController, other::{ check_capacity, get_address, get_live_cell_with_cache, get_network_type, get_privkey_signer, get_to_data, read_password, serialize_signature, @@ -37,10 +38,7 @@ use ckb_sdk::{ Address, AddressPayload, GenesisInfo, HttpRpcClient, HumanCapacity, MultisigConfig, SignerFn, Since, SinceType, TxHelper, SECP256K1, }; -pub use index::{ - start_index_thread, CapacityResult, IndexController, IndexRequest, IndexResponse, - IndexThreadState, SimpleBlockInfo, -}; +pub use index::start_index_thread; // Max derived change address to search const DERIVE_CHANGE_ADDRESS_MAX_LEN: u32 = 10000; diff --git a/src/utils/config.rs b/src/utils/config.rs index dbf60e27..f06af97f 100644 --- a/src/utils/config.rs +++ b/src/utils/config.rs @@ -9,8 +9,10 @@ use ckb_sdk::NetworkType; use ckb_util::RwLock; use regex::{Captures, Regex}; -use crate::subcommands::wallet::IndexThreadState; -use crate::utils::printer::{OutputFormat, Printable}; +use crate::utils::{ + index::IndexThreadState, + printer::{OutputFormat, Printable}, +}; const DEFAULT_JSONRPC_URL: &str = "http://127.0.0.1:8114"; diff --git a/src/utils/index.rs b/src/utils/index.rs new file mode 100644 index 00000000..dd8a6ec7 --- /dev/null +++ b/src/utils/index.rs @@ -0,0 +1,200 @@ +use std::fmt; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Arc; +use std::thread; +use std::time::{Duration, Instant}; + +use ckb_types::{ + core::{service::Request, HeaderView}, + prelude::*, + H256, +}; +use ckb_util::RwLock; +use crossbeam_channel::Sender; +use serde_derive::{Deserialize, Serialize}; + +pub enum IndexRequest { + Kick, + UpdateUrl(String), +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum IndexResponse { + Ok, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CapacityResult { + pub lock_hash: H256, + pub address: Option, + pub capacity: u64, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SimpleBlockInfo { + epoch: (u64, u64, u64), + number: u64, + hash: H256, +} + +impl From for SimpleBlockInfo { + fn from(header: HeaderView) -> SimpleBlockInfo { + let epoch = header.epoch(); + SimpleBlockInfo { + number: header.number(), + epoch: (epoch.number(), epoch.index(), epoch.length()), + hash: header.hash().unpack(), + } + } +} + +#[derive(Debug, Clone)] +pub enum IndexThreadState { + // wait first request to start + WaitToStart, + // Started init db + StartInit, + // Process after init db + Processing(Option, u64), + Error(String), + // Thread exit + Stopped, +} + +impl IndexThreadState { + pub fn start_init(&mut self) { + *self = IndexThreadState::StartInit; + } + pub fn processing(&mut self, header: Option, tip_number: u64) { + let block_info = header.map(Into::into); + *self = IndexThreadState::Processing(block_info, tip_number); + } + pub fn error(&mut self, err: String) { + *self = IndexThreadState::Error(err); + } + pub fn stop(&mut self) { + *self = IndexThreadState::Stopped; + } + pub fn get_error(&self) -> Option { + match self { + IndexThreadState::Error(err) => Some(err.clone()), + _ => None, + } + } + pub fn is_started(&self) -> bool { + match self { + IndexThreadState::WaitToStart => false, + _ => true, + } + } + pub fn is_stopped(&self) -> bool { + match self { + IndexThreadState::Stopped => true, + _ => false, + } + } + pub fn is_synced(&self) -> bool { + match self { + IndexThreadState::Processing(Some(SimpleBlockInfo { number, .. }), tip_number) => { + number == tip_number + } + _ => false, + } + } + pub fn is_error(&self) -> bool { + match self { + IndexThreadState::Error(_) => true, + _ => false, + } + } + #[cfg_attr(windows, allow(dead_code))] + pub fn is_processing(&self) -> bool { + match self { + IndexThreadState::Processing(Some(_), _) => true, + _ => false, + } + } +} + +impl fmt::Display for IndexThreadState { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + let output = match self { + IndexThreadState::WaitToStart => "Waiting for first query".to_owned(), + IndexThreadState::StartInit => "Initializing".to_owned(), + IndexThreadState::Error(err) => format!("Error: {}", err), + IndexThreadState::Processing(Some(SimpleBlockInfo { number, .. }), tip_number) => { + let status = if tip_number == number { + "synced".to_owned() + } else { + format!("tip#{}", tip_number) + }; + format!("Processed block#{} ({})", number, status) + } + IndexThreadState::Processing(None, tip_number) => { + format!("Initializing (tip#{})", tip_number) + } + IndexThreadState::Stopped => "Stopped".to_owned(), + }; + write!(f, "{}", output) + } +} + +impl Default for IndexThreadState { + fn default() -> IndexThreadState { + IndexThreadState::WaitToStart + } +} + +pub struct IndexController { + state: Arc>, + sender: Sender>, + shutdown: Arc, +} + +impl Clone for IndexController { + fn clone(&self) -> IndexController { + IndexController { + state: Arc::clone(&self.state), + shutdown: Arc::clone(&self.shutdown), + sender: self.sender.clone(), + } + } +} + +impl IndexController { + pub fn new( + state: Arc>, + sender: Sender>, + shutdown: Arc, + ) -> IndexController { + IndexController { + state, + sender, + shutdown, + } + } + pub fn state(&self) -> &Arc> { + &self.state + } + pub fn sender(&self) -> &Sender> { + &self.sender + } + pub fn shutdown(&self) { + let start_time = Instant::now(); + self.shutdown.store(true, Ordering::Relaxed); + while self.state().read().is_started() && !self.state().read().is_stopped() { + if self.state().read().is_error() { + return; + } + if start_time.elapsed() < Duration::from_secs(10) { + thread::sleep(Duration::from_millis(50)); + } else { + eprintln!( + "Stop index thread timeout(state: {}), give up", + self.state().read().to_string() + ); + return; + } + } + } +} diff --git a/src/utils/mod.rs b/src/utils/mod.rs index afb4dbe8..bc591076 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -2,6 +2,7 @@ pub mod arg; pub mod arg_parser; pub mod completer; pub mod config; +pub mod index; pub mod json_color; pub mod other; pub mod printer; diff --git a/src/utils/other.rs b/src/utils/other.rs index c05565b8..eb87510a 100644 --- a/src/utils/other.rs +++ b/src/utils/other.rs @@ -2,10 +2,11 @@ use std::collections::{HashMap, HashSet}; use std::fs; use std::io::Read; use std::path::PathBuf; -use std::time::{SystemTime, UNIX_EPOCH}; +use std::thread; +use std::time::{Duration, SystemTime, UNIX_EPOCH}; use ckb_hash::blake2b_256; -use ckb_index::{with_index_db, IndexDatabase, VERSION}; +use ckb_index::VERSION; use ckb_sdk::{ constants::{MIN_SECP_CELL_CAPACITY, ONE_CKB}, rpc::AlertMessage, @@ -15,10 +16,9 @@ use ckb_sdk::{ }; use ckb_types::{ bytes::Bytes, - core::BlockView, + core::{service::Request, BlockView}, h256, packed::{CellOutput, OutPoint}, - prelude::*, H160, H256, }; use clap::ArgMatches; @@ -28,6 +28,7 @@ use rpassword::prompt_password_stdout; use super::arg_parser::{ AddressParser, ArgParser, FixedHashParser, HexParser, PrivkeyWrapper, PubkeyHexParser, }; +use super::index::{IndexController, IndexRequest, IndexThreadState}; pub fn read_password(repeat: bool, prompt: Option<&str>) -> Result { let prompt = prompt.unwrap_or("Password"); @@ -189,23 +190,17 @@ pub fn index_dirname() -> String { format!("index-v{}", VERSION) } -pub fn sync_to_tip(rpc_client: &mut HttpRpcClient, index_dir: &PathBuf) -> Result<(), String> { - let genesis_block: BlockView = rpc_client - .get_block_by_number(0)? - .expect("Can not get genesis block?") - .into(); - let genesis_hash: H256 = genesis_block.hash().unpack(); - let tip_number = rpc_client.get_tip_block_number()?; - let network_type = get_network_type(rpc_client)?; - let genesis_info = GenesisInfo::from_block(&genesis_block).unwrap(); +pub fn sync_to_tip(index_controller: &IndexController) -> Result<(), String> { + // Kick index thread to start + Request::call(index_controller.sender(), IndexRequest::Kick); loop { - let synced = with_index_db(index_dir.clone(), genesis_hash.clone(), |backend, cf| { - IndexDatabase::from_db(backend, cf, network_type, genesis_info.clone(), false) - .map(|db| db.last_number().unwrap_or(0)) - .or_else(|_| Ok(0)) - }); - if synced.unwrap_or(0) == tip_number { + let state = IndexThreadState::clone(&index_controller.state().read()); + if state.is_synced() { break; + } else if state.is_error() { + return Err(state.get_error().unwrap()); + } else { + thread::sleep(Duration::from_millis(200)); } } Ok(()) From 7182ce43ab184ac0e40f1cf061203b8de30e591b Mon Sep 17 00:00:00 2001 From: keroro520 Date: Tue, 31 Dec 2019 15:40:16 +0800 Subject: [PATCH 05/10] chore: Update ckb dependency to v0.26.1 in test --- test/Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Cargo.toml b/test/Cargo.toml index 8c008f9c..37836625 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cli-test" -version = "0.26.0" +version = "0.26.1" authors = ["Linfeng Qian "] edition = "2018" @@ -13,11 +13,11 @@ log = "0.4" env_logger = "0.6" toml = "0.5.0" ckb-sdk = { path = "../ckb-sdk" } -ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } -ckb-app-config = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } -ckb-chain-spec = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } -ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2", features = ["secp"] } -ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.0-rc2" } +ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-app-config = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-chain-spec = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1", features = ["secp"] } +ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } regex = "1.1.6" # Prevent this from interfering with workspaces From 1f67ce1ad439c3e0adaf4293e5415e80cda67f7b Mon Sep 17 00:00:00 2001 From: keroro520 Date: Fri, 13 Dec 2019 19:24:47 +0800 Subject: [PATCH 06/10] feat: Support NervosDAO --- Cargo.lock | 2 + Cargo.toml | 2 + ckb-sdk/src/lib.rs | 2 +- src/interactive.rs | 15 +- src/main.rs | 19 +- src/subcommands/dao/builder.rs | 271 +++++++++++++++++++++++ src/subcommands/dao/command.rs | 188 ++++++++++++++++ src/subcommands/dao/mod.rs | 382 +++++++++++++++++++++++++++++++++ src/subcommands/dao/util.rs | 151 +++++++++++++ src/subcommands/mod.rs | 2 + src/subcommands/wallet/mod.rs | 33 +-- src/utils/arg.rs | 10 +- src/utils/arg_parser.rs | 1 - src/utils/other.rs | 50 ++++- 14 files changed, 1092 insertions(+), 36 deletions(-) create mode 100644 src/subcommands/dao/builder.rs create mode 100644 src/subcommands/dao/command.rs create mode 100644 src/subcommands/dao/mod.rs create mode 100644 src/subcommands/dao/util.rs diff --git a/Cargo.lock b/Cargo.lock index 8cacb59d..c586a820 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,6 +332,7 @@ version = "0.26.1" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "ckb-build-info 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", "ckb-crypto 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", @@ -351,6 +352,7 @@ dependencies = [ "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "faster-hex 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-client-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 44694984..89efd33f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,8 @@ chrono = "0.4" rpassword = "3.0.2" ipnetwork = "0.14" multiaddr = { package = "parity-multiaddr", version = "0.4.0" } +byteorder = "1.3.2" +itertools = "0.8.0" [target.'cfg(unix)'.dependencies] tui = "0.6.0" diff --git a/ckb-sdk/src/lib.rs b/ckb-sdk/src/lib.rs index be430e16..5f585fea 100644 --- a/ckb-sdk/src/lib.rs +++ b/ckb-sdk/src/lib.rs @@ -15,7 +15,7 @@ pub use transaction::{ MockCellDep, MockInfo, MockInput, MockResourceLoader, MockTransaction, MockTransactionHelper, ReprMockCellDep, ReprMockInfo, ReprMockInput, ReprMockTransaction, }; -pub use tx_helper::{MultisigConfig, SignerFn, TxHelper}; +pub use tx_helper::{build_signature, MultisigConfig, SignerFn, TxHelper}; pub use types::{ Address, AddressPayload, AddressType, CodeHashIndex, HumanCapacity, NetworkType, OldAddress, OldAddressFormat, Since, SinceType, diff --git a/src/interactive.rs b/src/interactive.rs index 79fc754b..3a931cec 100644 --- a/src/interactive.rs +++ b/src/interactive.rs @@ -12,7 +12,7 @@ use rustyline::{Cmd, CompletionType, Config, EditMode, Editor, KeyPress}; use serde_json::json; use crate::subcommands::{ - AccountSubCommand, CliSubCommand, MockTxSubCommand, MoleculeSubCommand, RpcSubCommand, + AccountSubCommand, CliSubCommand, DAOSubCommand, MockTxSubCommand, MoleculeSubCommand, RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, }; use crate::utils::{ @@ -364,6 +364,19 @@ impl InteractiveEnv { println!("{}", output); Ok(()) } + ("dao", Some(sub_matches)) => { + let genesis_info = self.genesis_info()?; + let output = DAOSubCommand::new( + &mut self.rpc_client, + &mut self.key_store, + genesis_info, + self.index_dir.clone(), + self.index_controller.clone(), + ) + .process(&sub_matches, format, color, debug)?; + println!("{}", output); + Ok(()) + } ("exit", _) => { return Ok(true); } diff --git a/src/main.rs b/src/main.rs index 00fd617f..577216cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,9 +14,10 @@ use clap::{App, AppSettings, Arg, SubCommand}; #[cfg(unix)] use subcommands::TuiSubCommand; +use crate::utils::other::get_genesis_info; use interactive::InteractiveEnv; use subcommands::{ - start_index_thread, AccountSubCommand, CliSubCommand, MockTxSubCommand, MoleculeSubCommand, + start_index_thread, AccountSubCommand, CliSubCommand, DAOSubCommand, MockTxSubCommand, MoleculeSubCommand, RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, }; use utils::other::sync_to_tip; @@ -157,6 +158,20 @@ fn main() -> Result<(), io::Error> { ) .process(&sub_matches, output_format, color, debug) }), + ("dao", Some(sub_matches)) => { + get_genesis_info(&None, &mut rpc_client).and_then(|genesis_info| { + get_key_store(&ckb_cli_dir).and_then(|mut key_store| { + DAOSubCommand::new( + &mut rpc_client, + &mut key_store, + genesis_info, + index_dir.clone(), + index_controller.clone(), + ) + .process(&sub_matches, output_format, color, debug) + }) + }) + } _ => { if let Err(err) = InteractiveEnv::from_config(ckb_cli_dir, config, index_controller.clone()) @@ -232,6 +247,7 @@ pub fn build_cli<'a>(version_short: &'a str, version_long: &'a str) -> App<'a, ' .subcommand(UtilSubCommand::subcommand("util")) .subcommand(MoleculeSubCommand::subcommand("molecule")) .subcommand(WalletSubCommand::subcommand()) + .subcommand(DAOSubCommand::subcommand()) .arg( Arg::with_name("url") .long("url") @@ -334,4 +350,5 @@ pub fn build_interactive() -> App<'static, 'static> { .subcommand(UtilSubCommand::subcommand("util")) .subcommand(MoleculeSubCommand::subcommand("molecule")) .subcommand(WalletSubCommand::subcommand()) + .subcommand(DAOSubCommand::subcommand()) } diff --git a/src/subcommands/dao/builder.rs b/src/subcommands/dao/builder.rs new file mode 100644 index 00000000..19d6a454 --- /dev/null +++ b/src/subcommands/dao/builder.rs @@ -0,0 +1,271 @@ +use super::util::minimal_unlock_point; +use ckb_index::LiveCellInfo; +use ckb_sdk::{GenesisInfo, HttpRpcClient, Since}; +use ckb_types::{ + bytes::Bytes, + core::{HeaderView, ScriptHashType, TransactionBuilder, TransactionView}, + packed::{self, CellInput, CellOutput, OutPoint, Script, WitnessArgs}, + prelude::*, +}; +use std::collections::HashSet; + +// NOTE: We assume all inputs are from same account +#[derive(Debug)] +pub(crate) struct DAOBuilder { + genesis_info: GenesisInfo, + tx_fee: u64, + live_cells: Vec, +} + +impl DAOBuilder { + pub(crate) fn new( + genesis_info: GenesisInfo, + tx_fee: u64, + live_cells: Vec, + ) -> Self { + Self { + genesis_info, + tx_fee, + live_cells, + } + } + + pub(crate) fn deposit(&self, deposit_capacity: u64) -> Result { + let genesis_info = &self.genesis_info; + let inputs = self + .live_cells + .iter() + .map(|txo| CellInput::new(txo.out_point(), 0)) + .collect::>(); + let witnesses = inputs + .iter() + .map(|_| Default::default()) + .collect::>(); + let (output, output_data) = { + // NOTE: Here give null lock script to the output. It's caller's duty to fill the lock + let output = CellOutput::new_builder() + .capacity(deposit_capacity.pack()) + .type_(Some(dao_type_script(&self.genesis_info)?).pack()) + .build(); + let output_data = Bytes::from(&[0u8; 8][..]).pack(); + (output, output_data) + }; + let cell_deps = vec![genesis_info.dao_dep()]; + let tx = TransactionBuilder::default() + .inputs(inputs) + .output(output) + .output_data(output_data) + .cell_deps(cell_deps) + .witnesses(witnesses); + + let input_capacity = self.live_cells.iter().map(|txo| txo.capacity).sum::(); + let change_capacity = input_capacity - deposit_capacity - self.tx_fee; + if change_capacity > 0 { + let change = CellOutput::new_builder() + .capacity(change_capacity.pack()) + .build(); + Ok(tx.output(change).output_data(Default::default()).build()) + } else { + Ok(tx.build()) + } + } + + pub(crate) fn prepare( + &self, + rpc_client: &mut HttpRpcClient, + ) -> Result { + let genesis_info = &self.genesis_info; + let dao_type_hash = genesis_info.dao_type_hash(); + let mut deposit_cells: Vec = Vec::new(); + let mut change_cells: Vec = Vec::new(); + for cell in self.live_cells.iter() { + if cell + .type_hashes + .as_ref() + .map(|(code_hash, _)| &code_hash.pack() == dao_type_hash) + .unwrap_or(false) + { + deposit_cells.push(cell.clone()); + } else { + change_cells.push(cell.clone()); + } + } + let deposit_txo_headers = { + let deposit_out_points = deposit_cells + .iter() + .map(|txo| txo.out_point()) + .collect::>(); + self.txo_headers(rpc_client, deposit_out_points)? + }; + + let inputs = self + .live_cells + .iter() + .map(|txo| CellInput::new(txo.out_point(), 0)) + .collect::>(); + // NOTE: Prepare output has the same capacity, type script, lock script as the input + let outputs = deposit_txo_headers + .iter() + .map(|(_, output, _)| output.clone()) + .collect::>(); + let outputs_data = deposit_txo_headers.iter().map(|(_, _, header)| { + let deposit_number = header.number(); + Bytes::from(deposit_number.to_le_bytes().to_vec()).pack() + }); + let cell_deps = vec![genesis_info.dao_dep()]; + let header_deps = deposit_txo_headers + .iter() + .map(|(_, _, header)| header.hash()) + .collect::>() + .into_iter() + .collect::>(); + let witnesses = (0..inputs.len()) + .map(|_| WitnessArgs::default().as_bytes().pack()) + .collect::>(); + let tx = TransactionBuilder::default() + .inputs(inputs) + .outputs(outputs) + .cell_deps(cell_deps) + .header_deps(header_deps) + .witnesses(witnesses) + .outputs_data(outputs_data); + + let change_capacity = + change_cells.iter().map(|txo| txo.capacity).sum::() - self.tx_fee; + let change = CellOutput::new_builder() + .capacity(change_capacity.pack()) + .build(); + Ok(tx.output(change).output_data(Default::default()).build()) + } + + pub(crate) fn withdraw( + &self, + rpc_client: &mut HttpRpcClient, + ) -> Result { + let genesis_info = &self.genesis_info; + let prepare_txo_headers = { + let prepare_out_points = self + .live_cells + .iter() + .map(|txo| txo.out_point()) + .collect::>(); + self.txo_headers(rpc_client, prepare_out_points)? + }; + let deposit_txo_headers = { + let deposit_out_points = prepare_txo_headers + .iter() + .map(|(out_point, _, _)| { + let tx: packed::Transaction = rpc_client + .get_transaction(out_point.tx_hash().unpack())? + .expect("checked above") + .transaction + .inner + .into(); + let tx = tx.into_view(); + let input = tx + .inputs() + .get(out_point.index().unpack()) + .expect("prepare out_point has the same index with deposit input"); + Ok(input.previous_output()) + }) + .collect::, String>>()?; + self.txo_headers(rpc_client, deposit_out_points)? + }; + + let inputs = deposit_txo_headers + .iter() + .zip(prepare_txo_headers.iter()) + .map(|((_, _, deposit_header), (out_point, _, prepare_header))| { + let minimal_unlock_point = minimal_unlock_point(deposit_header, prepare_header); + let since = Since::new_absolute_epoch(minimal_unlock_point.full_value()).value(); + CellInput::new(out_point.clone(), since) + }); + let total_capacity = deposit_txo_headers + .iter() + .zip(prepare_txo_headers.iter()) + .map(|((deposit_txo, _, _), (_, _, prepare_header))| { + rpc_client + .calculate_dao_maximum_withdraw( + deposit_txo.clone(), + prepare_header.hash().unpack(), + ) + .expect("RPC calculate_dao_maximum_withdraw failed") + .as_u64() + }) + .sum::(); + let output_capacity = total_capacity - self.tx_fee; + let output = CellOutput::new_builder() + .capacity(output_capacity.pack()) + .build(); + let cell_deps = vec![genesis_info.dao_dep()]; + let header_deps = deposit_txo_headers + .iter() + .chain(prepare_txo_headers.iter()) + .map(|(_, _, header)| header.hash()) + .collect::>() + .into_iter() + .collect::>(); + let witnesses = deposit_txo_headers + .iter() + .map(|(_, _, header)| { + let index = header_deps + .iter() + .position(|hash| hash == &header.hash()) + .unwrap() as u64; + WitnessArgs::new_builder() + .input_type(Some(Bytes::from(index.to_le_bytes().to_vec())).pack()) + .build() + .as_bytes() + .pack() + }) + .collect::>(); + Ok(TransactionBuilder::default() + .inputs(inputs) + .output(output) + .cell_deps(cell_deps) + .header_deps(header_deps) + .witnesses(witnesses) + .output_data(Default::default()) + .build()) + } + + fn txo_headers( + &self, + rpc_client: &mut HttpRpcClient, + out_points: Vec, + ) -> Result, String> { + let mut ret = Vec::new(); + for out_point in out_points.into_iter() { + let tx_status = rpc_client + .get_transaction(out_point.tx_hash().unpack())? + .ok_or_else(|| "get_transaction None".to_string())?; + let tx: packed::Transaction = tx_status.transaction.inner.into(); + let tx = tx.into_view(); + let header: HeaderView = { + let block_hash = tx_status + .tx_status + .block_hash + .ok_or_else(|| "Tx is not on-chain".to_owned())?; + rpc_client + .get_header(block_hash)? + .expect("checked above") + .into() + }; + + let output_index: u32 = out_point.index().unpack(); + let output = tx + .outputs() + .get(output_index as usize) + .ok_or_else(|| "OutPoint is out of index".to_owned())?; + ret.push((out_point, output, header)) + } + Ok(ret) + } +} + +fn dao_type_script(genesis_info: &GenesisInfo) -> Result { + Ok(Script::new_builder() + .hash_type(ScriptHashType::Type.into()) + .code_hash(genesis_info.dao_type_hash().clone()) + .build()) +} diff --git a/src/subcommands/dao/command.rs b/src/subcommands/dao/command.rs new file mode 100644 index 00000000..934fd08f --- /dev/null +++ b/src/subcommands/dao/command.rs @@ -0,0 +1,188 @@ +use crate::subcommands::dao::util::{calculate_dao_maximum_withdraw, send_transaction}; +use crate::subcommands::{CliSubCommand, DAOSubCommand}; +use crate::utils::{ + arg, + arg_parser::{ + ArgParser, CapacityParser, FixedHashParser, OutPointParser, PrivkeyPathParser, + PrivkeyWrapper, + }, + other::{get_address, get_network_type}, + printer::{OutputFormat, Printable}, +}; +use ckb_crypto::secp::SECP256K1; +use ckb_sdk::{constants::SIGHASH_TYPE_HASH, Address, AddressPayload, NetworkType}; +use ckb_types::{ + packed::{Byte32, Script}, + prelude::*, + H160, H256, +}; +use clap::{App, Arg, ArgMatches, SubCommand}; +use std::collections::HashSet; + +impl<'a> CliSubCommand for DAOSubCommand<'a> { + fn process( + &mut self, + matches: &ArgMatches, + format: OutputFormat, + color: bool, + debug: bool, + ) -> Result { + let network_type = get_network_type(&mut self.rpc_client)?; + match matches.subcommand() { + ("deposit", Some(m)) => { + self.transact_args = Some(TransactArgs::from_matches(m, network_type)?); + let capacity: u64 = CapacityParser.from_matches(m, "capacity")?; + let transaction = self.deposit(capacity)?; + send_transaction(self.rpc_client(), transaction, format, color, debug) + } + ("prepare", Some(m)) => { + self.transact_args = Some(TransactArgs::from_matches(m, network_type)?); + let out_points = OutPointParser.from_matches_vec(m, "out-point")?; + if out_points.len() != out_points.iter().collect::>().len() { + return Err("Duplicated out-points".to_string()); + } + let transaction = self.prepare(out_points)?; + send_transaction(self.rpc_client(), transaction, format, color, debug) + } + ("withdraw", Some(m)) => { + self.transact_args = Some(TransactArgs::from_matches(m, network_type)?); + let out_points = OutPointParser.from_matches_vec(m, "out-point")?; + if out_points.len() != out_points.iter().collect::>().len() { + return Err("Duplicated out-points".to_string()); + } + let transaction = self.withdraw(out_points)?; + send_transaction(self.rpc_client(), transaction, format, color, debug) + } + ("query-deposited-cells", Some(m)) => { + let query_args = QueryArgs::from_matches(m, network_type)?; + let lock_hash = query_args.lock_hash; + let cells = self.query_deposit_cells(lock_hash)?; + let total_capacity = cells.iter().map(|live| live.capacity).sum::(); + let resp = serde_json::json!({ + "live_cells": cells.into_iter().map(|info| { + serde_json::to_value(&info).unwrap() + }).collect::>(), + "total_capacity": total_capacity, + }); + Ok(resp.render(format, color)) + } + ("query-prepared-cells", Some(m)) => { + let query_args = QueryArgs::from_matches(m, network_type)?; + let lock_hash = query_args.lock_hash; + let cells = self.query_prepare_cells(lock_hash)?; + let maximum_withdraws: Vec<_> = cells + .iter() + .map(|cell| calculate_dao_maximum_withdraw(self.rpc_client(), cell)) + .collect::, String>>()?; + let total_maximum_withdraw = maximum_withdraws.iter().sum::(); + let resp = serde_json::json!({ + "live_cells": (0..cells.len()).map(|i| { + let mut value = serde_json::to_value(&cells[i]).unwrap(); + let obj = value.as_object_mut().unwrap(); + obj.insert("maximum_withdraw".to_owned(), serde_json::json!(maximum_withdraws[i])); + value + }).collect::>(), + "total_maximum_withdraw": total_maximum_withdraw, + }); + Ok(resp.render(format, color)) + } + _ => Err(matches.usage().to_owned()), + } + } +} + +impl<'a> DAOSubCommand<'a> { + pub fn subcommand() -> App<'static, 'static> { + SubCommand::with_name("dao") + .about("Deposit / prepare / withdraw / query NervosDAO balance (with local index) / key utils") + .subcommands(vec![ + SubCommand::with_name("deposit") + .about("Deposit capacity into NervosDAO") + .args(&TransactArgs::args()) + .arg(arg::capacity().required(true)), + SubCommand::with_name("prepare") + .about("Prepare specified cells from NervosDAO") + .args(&TransactArgs::args()) + .arg(arg::out_point().required(true).multiple(true)), + SubCommand::with_name("withdraw") + .about("Withdraw specified cells from NervosDAO") + .args(&TransactArgs::args()) + .arg(arg::out_point().required(true).multiple(true)), + SubCommand::with_name("query-deposited-cells") + .about("Query NervosDAO deposited capacity by lock script hash or address") + .args(&QueryArgs::args()), + SubCommand::with_name("query-prepared-cells") + .about("Query NervosDAO prepared capacity by lock script hash or address") + .args(&QueryArgs::args()) + ]) + } +} + +pub(crate) struct QueryArgs { + pub(crate) lock_hash: Byte32, +} + +pub(crate) struct TransactArgs { + pub(crate) privkey: Option, + pub(crate) address: Address, + pub(crate) tx_fee: u64, +} + +impl QueryArgs { + fn from_matches(m: &ArgMatches, network_type: NetworkType) -> Result { + let lock_hash_opt: Option = + FixedHashParser::::default().from_matches_opt(m, "lock-hash", false)?; + let lock_hash = if let Some(lock_hash) = lock_hash_opt { + lock_hash.pack() + } else { + let address = get_address(Some(network_type), m)?; + Script::from(&address).calc_script_hash() + }; + + Ok(Self { lock_hash }) + } + + fn args<'a, 'b>() -> Vec> { + vec![arg::lock_hash(), arg::address()] + } +} + +impl TransactArgs { + fn from_matches(m: &ArgMatches, network_type: NetworkType) -> Result { + let privkey: Option = + PrivkeyPathParser.from_matches_opt(m, "privkey-path", false)?; + let address = if let Some(privkey) = privkey.as_ref() { + let pubkey = secp256k1::PublicKey::from_secret_key(&SECP256K1, privkey); + let payload = AddressPayload::from_pubkey(&pubkey); + Address::new(network_type, payload) + } else { + let account: Option = + FixedHashParser::::default().from_matches_opt(m, "from-account", false)?; + let payload = AddressPayload::from_pubkey_hash(account.clone().unwrap()); + Address::new(network_type, payload) + }; + assert_eq!(address.payload().code_hash(), SIGHASH_TYPE_HASH.pack()); + let tx_fee: u64 = CapacityParser.from_matches(m, "tx-fee")?; + Ok(Self { + privkey, + address, + tx_fee, + }) + } + + fn args<'a, 'b>() -> Vec> { + vec![ + arg::privkey_path().required_unless(arg::from_account().b.name), + arg::from_account().required_unless(arg::privkey_path().b.name), + arg::tx_fee().required(true), + ] + } + + pub(crate) fn sighash_args(&self) -> H160 { + H160::from_slice(self.address.payload().args().as_ref()).unwrap() + } + + pub(crate) fn lock_hash(&self) -> Byte32 { + Script::from(self.address.payload()).calc_script_hash() + } +} diff --git a/src/subcommands/dao/mod.rs b/src/subcommands/dao/mod.rs new file mode 100644 index 00000000..2e7abd5c --- /dev/null +++ b/src/subcommands/dao/mod.rs @@ -0,0 +1,382 @@ +use self::builder::DAOBuilder; +use self::command::TransactArgs; +use self::util::blake2b_args; +use crate::subcommands::dao::util::is_mature; +use crate::subcommands::IndexController; +use crate::utils::other::{ + get_max_mature_number, get_network_type, get_privkey_signer, read_password, serialize_signature, +}; +use byteorder::{ByteOrder, LittleEndian}; +use ckb_index::{with_index_db, IndexDatabase, LiveCellInfo}; +use ckb_jsonrpc_types::JsonBytes; +use ckb_sdk::{ + constants::{MIN_SECP_CELL_CAPACITY, SIGHASH_TYPE_HASH}, + wallet::KeyStore, + GenesisInfo, HttpRpcClient, SignerFn, +}; +use ckb_types::{ + bytes::Bytes, + core::{ScriptHashType, TransactionView}, + packed::{Byte32, CellOutput, OutPoint, Script, WitnessArgs}, + prelude::*, + {h256, H160, H256}, +}; +use itertools::Itertools; +use std::collections::HashSet; +use std::path::PathBuf; + +mod builder; +mod command; +mod util; + +// Should CLI handle "immature header problem"? +pub struct DAOSubCommand<'a> { + rpc_client: &'a mut HttpRpcClient, + key_store: &'a mut KeyStore, + genesis_info: GenesisInfo, + index_dir: PathBuf, + index_controller: IndexController, + transact_args: Option, +} + +impl<'a> DAOSubCommand<'a> { + pub fn new( + rpc_client: &'a mut HttpRpcClient, + key_store: &'a mut KeyStore, + genesis_info: GenesisInfo, + index_dir: PathBuf, + index_controller: IndexController, + ) -> Self { + Self { + rpc_client, + key_store, + genesis_info, + index_dir, + index_controller, + transact_args: None, + } + } + + pub fn deposit(&mut self, capacity: u64) -> Result { + self.check_db_ready()?; + let target_capacity = capacity + self.transact_args().tx_fee; + let cells = self.collect_sighash_cells(target_capacity)?; + let raw_transaction = self.build(cells).deposit(capacity)?; + self.sign(raw_transaction) + } + + pub fn prepare(&mut self, out_points: Vec) -> Result { + self.check_db_ready()?; + let tx_fee = self.transact_args().tx_fee; + let lock_hash = self.transact_args().lock_hash(); + let cells = { + let mut to_pay_fee = self.collect_sighash_cells(tx_fee)?; + let mut to_prepare = { + let deposit_cells = self.query_deposit_cells(lock_hash)?; + take_by_out_points(deposit_cells, &out_points)? + }; + to_prepare.append(&mut to_pay_fee); + to_prepare + }; + let raw_transaction = self.build(cells).prepare(self.rpc_client())?; + self.sign(raw_transaction) + } + + pub fn withdraw(&mut self, out_points: Vec) -> Result { + self.check_db_ready()?; + let lock_hash = self.transact_args().lock_hash(); + let cells = { + let prepare_cells = self.query_prepare_cells(lock_hash)?; + take_by_out_points(prepare_cells, &out_points)? + }; + let raw_transaction = self.build(cells).withdraw(self.rpc_client())?; + self.sign(raw_transaction) + } + + pub fn query_deposit_cells(&mut self, lock_hash: Byte32) -> Result, String> { + let dao_cells = self.collect_dao_cells(lock_hash)?; + assert!(dao_cells.iter().all(|cell| cell.data_bytes == 8)); + let mut ret = Vec::with_capacity(dao_cells.len()); + for cell in dao_cells { + if is_deposit_cell(self.rpc_client(), &cell)? { + ret.push(cell); + } + } + Ok(ret) + } + + pub fn query_prepare_cells(&mut self, lock_hash: Byte32) -> Result, String> { + let dao_cells = self.collect_dao_cells(lock_hash)?; + assert!(dao_cells.iter().all(|cell| cell.data_bytes == 8)); + let mut ret = Vec::with_capacity(dao_cells.len()); + for cell in dao_cells { + if is_prepare_cell(self.rpc_client(), &cell)? { + ret.push(cell); + } + } + Ok(ret) + } + + fn collect_dao_cells(&mut self, lock_hash: Byte32) -> Result, String> { + let dao_type_hash = self.dao_type_hash().clone(); + self.with_db(|db, _| { + let cells_by_lock = db + .get_live_cells_by_lock(lock_hash, Some(0), |_, _| (false, true)) + .into_iter() + .collect::>(); + let cells_by_code = db + .get_live_cells_by_code(dao_type_hash.clone(), Some(0), |_, _| (false, true)) + .into_iter() + .collect::>(); + cells_by_lock + .intersection(&cells_by_code) + .sorted_by_key(|live| (live.number, live.tx_index, live.index.output_index)) + .cloned() + .collect::>() + }) + } + + fn collect_sighash_cells(&mut self, target_capacity: u64) -> Result, String> { + let from_address = self.transact_args().address.clone(); + let mut enough = false; + let mut take_capacity = 0; + let max_mature_number = get_max_mature_number(self.rpc_client())?; + let terminator = |_, cell: &LiveCellInfo| { + if !(cell.type_hashes.is_none() && cell.data_bytes == 0) + && is_mature(cell, max_mature_number) + { + return (false, false); + } + + take_capacity += cell.capacity; + if take_capacity == target_capacity + || take_capacity >= target_capacity + MIN_SECP_CELL_CAPACITY + { + enough = true; + } + (enough, true) + }; + + let cells: Vec = { + self.with_db(|db, _| { + db.get_live_cells_by_lock( + Script::from(from_address.payload()).calc_script_hash(), + None, + terminator, + ) + })? + }; + + if !enough { + return Err(format!( + "Capacity not enough: {} => {}", + from_address, take_capacity, + )); + } + Ok(cells) + } + + fn build(&self, cells: Vec) -> DAOBuilder { + let tx_fee = self.transact_args().tx_fee; + DAOBuilder::new(self.genesis_info.clone(), tx_fee, cells) + } + + fn sign(&mut self, transaction: TransactionView) -> Result { + // 1. Install sighash lock script + let transaction = self.install_sighash_lock(transaction); + + // 2. Install signed sighash witnesses + let transaction = self.install_sighash_witness(transaction)?; + + Ok(transaction) + } + + fn install_sighash_lock(&self, transaction: TransactionView) -> TransactionView { + let sighash_args = self.transact_args().sighash_args(); + let genesis_info = &self.genesis_info; + let sighash_dep = genesis_info.sighash_dep(); + let sighash_type_hash = genesis_info.sighash_type_hash(); + let lock_script = Script::new_builder() + .hash_type(ScriptHashType::Type.into()) + .code_hash(sighash_type_hash.clone()) + .args(Bytes::from(sighash_args.as_bytes()).pack()) + .build(); + let outputs = transaction + .outputs() + .into_iter() + .map(|output: CellOutput| output.as_builder().lock(lock_script.clone()).build()) + .collect::>(); + transaction + .as_advanced_builder() + .set_outputs(outputs) + .cell_dep(sighash_dep) + .build() + } + + fn install_sighash_witness( + &self, + transaction: TransactionView, + ) -> Result { + for output in transaction.outputs() { + assert_eq!(output.lock().hash_type(), ScriptHashType::Type.into()); + assert_eq!(output.lock().args().len(), 20); + assert_eq!(output.lock().code_hash(), SIGHASH_TYPE_HASH.pack()); + } + for witness in transaction.witnesses() { + if let Ok(w) = WitnessArgs::from_slice(witness.as_slice()) { + assert!(w.lock().is_none()); + } + } + + let mut witnesses = transaction + .witnesses() + .into_iter() + .map(|w| w.unpack()) + .collect::>(); + let init_witness = { + let init_witness = if witnesses[0].is_empty() { + WitnessArgs::default() + } else { + WitnessArgs::from_slice(&witnesses[0]).map_err(|err| err.to_string())? + }; + init_witness + .as_builder() + .lock(Some(Bytes::from(&[0u8; 65][..])).pack()) + .build() + }; + let message = { + let mut sign_args = vec![ + transaction.hash().raw_data().to_vec(), + (init_witness.as_bytes().len() as u64) + .to_le_bytes() + .to_vec(), + init_witness.as_bytes().to_vec(), + ]; + for other_witness in witnesses.iter().skip(1) { + sign_args.push((other_witness.len() as u64).to_le_bytes().to_vec()); + sign_args.push(other_witness.to_vec()); + } + sign_args + }; + let signature = { + let account = self.transact_args().sighash_args(); + let mut signer = { + if let Some(ref privkey) = self.transact_args().privkey { + get_privkey_signer(privkey.clone()) + } else { + let password = read_password(false, None)?; + get_keystore_signer(self.key_store.clone(), account.clone(), password) + } + }; + let digest = H256::from_slice(&blake2b_args(&message)).unwrap(); + let accounts = vec![account].into_iter().collect::>(); + signer(&accounts, &digest)?.expect("signer missed") + }; + + witnesses[0] = init_witness + .as_builder() + .lock(Some(Bytes::from(&signature[..])).pack()) + .build() + .as_bytes(); + + Ok(transaction + .as_advanced_builder() + .set_witnesses(witnesses.into_iter().map(|w| w.pack()).collect::>()) + .build()) + } + + fn check_db_ready(&mut self) -> Result<(), String> { + self.with_db(|_, _| ()) + } + + fn with_db(&mut self, func: F) -> Result + where + F: FnOnce(IndexDatabase, &mut HttpRpcClient) -> T, + { + let network_type = get_network_type(self.rpc_client)?; + let genesis_info = self.genesis_info.clone(); + let genesis_hash: H256 = genesis_info.header().hash().unpack(); + with_index_db(&self.index_dir.clone(), genesis_hash, |backend, cf| { + let db = IndexDatabase::from_db(backend, cf, network_type, genesis_info, false)?; + Ok(func(db, self.rpc_client())) + }) + .map_err(|_err| { + format!( + "Index database may not ready, sync process: {}", + self.index_controller.state().read().to_string() + ) + }) + } + + fn transact_args(&self) -> &TransactArgs { + self.transact_args.as_ref().expect("exist") + } + + fn dao_type_hash(&self) -> &Byte32 { + self.genesis_info.dao_type_hash() + } + + pub(crate) fn rpc_client(&mut self) -> &mut HttpRpcClient { + &mut self.rpc_client + } +} + +// TODO remove the duplicated function later +fn get_keystore_signer(key_store: KeyStore, account: H160, password: String) -> SignerFn { + Box::new(move |lock_args: &HashSet, message: &H256| { + if lock_args.contains(&account) { + if message == &h256!("0x0") { + Ok(Some([0u8; 65])) + } else { + key_store + .sign_recoverable_with_password(&account, None, message, password.as_bytes()) + .map(|signature| Some(serialize_signature(&signature))) + .map_err(|err| err.to_string()) + } + } else { + Ok(None) + } + }) +} + +fn take_by_out_points( + cells: Vec, + out_points: &[OutPoint], +) -> Result, String> { + let mut set = out_points.iter().collect::>(); + let takes = cells + .into_iter() + .filter(|cell| set.remove(&cell.out_point())) + .collect::>(); + if !set.is_empty() { + return Err(format!("cells are not found: {:?}", set)); + } + Ok(takes) +} + +fn is_deposit_cell( + rpc_client: &mut HttpRpcClient, + dao_cell: &LiveCellInfo, +) -> Result { + get_cell_data(rpc_client, dao_cell) + .map(|content| LittleEndian::read_u64(&content.as_bytes()[0..8]) == 0) +} + +fn is_prepare_cell( + rpc_client: &mut HttpRpcClient, + dao_cell: &LiveCellInfo, +) -> Result { + get_cell_data(rpc_client, dao_cell) + .map(|content| LittleEndian::read_u64(&content.as_bytes()[0..8]) != 0) +} + +fn get_cell_data( + rpc_client: &mut HttpRpcClient, + dao_cell: &LiveCellInfo, +) -> Result { + let cell_info = rpc_client + .get_live_cell(dao_cell.out_point(), true)? + .cell + .ok_or_else(|| format!("cell is not found: {:?}", dao_cell.out_point()))?; + Ok(cell_info.data.unwrap().content) +} diff --git a/src/subcommands/dao/util.rs b/src/subcommands/dao/util.rs new file mode 100644 index 00000000..84abf4d0 --- /dev/null +++ b/src/subcommands/dao/util.rs @@ -0,0 +1,151 @@ +use crate::utils::{ + other::check_lack_of_capacity, + printer::{OutputFormat, Printable}, +}; +use ckb_hash::new_blake2b; +use ckb_index::LiveCellInfo; +use ckb_sdk::HttpRpcClient; +use ckb_types::core::TransactionView; +use ckb_types::{ + core::{EpochNumber, EpochNumberWithFraction, HeaderView}, + packed, + prelude::*, +}; + +pub(crate) fn is_mature(info: &LiveCellInfo, max_mature_number: u64) -> bool { + // Not cellbase cell + info.index.tx_index > 0 + // Live cells in genesis are all mature + || info.number == 0 + || info.number <= max_mature_number +} + +pub(crate) fn blake2b_args(args: &[Vec]) -> [u8; 32] { + let mut blake2b = new_blake2b(); + for arg in args.iter() { + blake2b.update(&arg); + } + let mut digest = [0u8; 32]; + blake2b.finalize(&mut digest); + digest +} + +pub(crate) fn calculate_dao_maximum_withdraw( + rpc_client: &mut HttpRpcClient, + info: &LiveCellInfo, +) -> Result { + let tx = rpc_client + .get_transaction(info.tx_hash.clone())? + .ok_or_else(|| "invalid prepare out_point, the tx is notfound".to_string())?; + let prepare_block_hash = tx + .tx_status + .block_hash + .ok_or("invalid prepare out_point, the tx is not committed")?; + let tx: packed::Transaction = tx.transaction.inner.into(); + let tx = tx.into_view(); + + let input = tx + .inputs() + .get(info.out_point().index().unpack()) + .expect("invalid prepare out_point"); + let deposit_out_point = input.previous_output(); + + let maximum = rpc_client + .calculate_dao_maximum_withdraw(deposit_out_point, prepare_block_hash)? + .as_u64(); + Ok(maximum) +} + +pub(crate) fn send_transaction( + rpc_client: &mut HttpRpcClient, + transaction: TransactionView, + format: OutputFormat, + color: bool, + debug: bool, +) -> Result { + check_lack_of_capacity(&transaction)?; + let transaction_view: ckb_jsonrpc_types::TransactionView = transaction.clone().into(); + if debug { + println!( + "[Send Transaction]:\n{}", + transaction_view.render(format, color) + ); + } + + let resp = rpc_client.send_transaction(transaction.data())?; + Ok(resp.render(format, color)) +} + +pub(crate) fn minimal_unlock_point( + deposit_header: &HeaderView, + prepare_header: &HeaderView, +) -> EpochNumberWithFraction { + const LOCK_PERIOD_EPOCHES: EpochNumber = 180; + + // https://github.com/nervosnetwork/ckb-system-scripts/blob/master/c/dao.c#L182-L223 + let deposit_point = deposit_header.epoch(); + let prepare_point = prepare_header.epoch(); + let prepare_fraction = prepare_point.index() * deposit_point.length(); + let deposit_fraction = deposit_point.index() * prepare_point.length(); + let passed_epoch_cnt = if prepare_fraction > deposit_fraction { + prepare_point.number() - deposit_point.number() + 1 + } else { + prepare_point.number() - deposit_point.number() + }; + let rest_epoch_cnt = + (passed_epoch_cnt + (LOCK_PERIOD_EPOCHES - 1)) / LOCK_PERIOD_EPOCHES * LOCK_PERIOD_EPOCHES; + EpochNumberWithFraction::new( + deposit_point.number() + rest_epoch_cnt, + deposit_point.index(), + deposit_point.length(), + ) +} + +#[cfg(test)] +mod tests { + use super::*; + use ckb_types::core::HeaderBuilder; + + #[test] + fn test_minimal_unlock_point() { + let cases = vec![ + ((5, 5, 1000), (184, 4, 1000), (5 + 180, 5, 1000)), + ((5, 5, 1000), (184, 5, 1000), (5 + 180, 5, 1000)), + ((5, 5, 1000), (184, 6, 1000), (5 + 180, 5, 1000)), + ((5, 5, 1000), (185, 4, 1000), (5 + 180, 5, 1000)), + ((5, 5, 1000), (185, 5, 1000), (5 + 180, 5, 1000)), + ((5, 5, 1000), (185, 6, 1000), (5 + 180 * 2, 5, 1000)), // 6/1000 > 5/1000 + ((5, 5, 1000), (186, 4, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (186, 5, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (186, 6, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (364, 4, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (364, 5, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (364, 6, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (365, 4, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (365, 5, 1000), (5 + 180 * 2, 5, 1000)), + ((5, 5, 1000), (365, 6, 1000), (5 + 180 * 3, 5, 1000)), + ((5, 5, 1000), (366, 4, 1000), (5 + 180 * 3, 5, 1000)), + ((5, 5, 1000), (366, 5, 1000), (5 + 180 * 3, 5, 1000)), + ((5, 5, 1000), (366, 6, 1000), (5 + 180 * 3, 5, 1000)), + ]; + for (deposit_point, prepare_point, expected) in cases { + let deposit_point = + EpochNumberWithFraction::new(deposit_point.0, deposit_point.1, deposit_point.2); + let prepare_point = + EpochNumberWithFraction::new(prepare_point.0, prepare_point.1, prepare_point.2); + let expected = EpochNumberWithFraction::new(expected.0, expected.1, expected.2); + let deposit_header = HeaderBuilder::default() + .epoch(deposit_point.full_value().pack()) + .build(); + let prepare_header = HeaderBuilder::default() + .epoch(prepare_point.full_value().pack()) + .build(); + let actual = minimal_unlock_point(&deposit_header, &prepare_header); + assert_eq!( + expected, actual, + "minimal_unlock_point deposit_point: {}, prepare_point: {}, expected: {}, actual: {}", + deposit_point, prepare_point, expected, actual, + ); + } + } +} diff --git a/src/subcommands/mod.rs b/src/subcommands/mod.rs index 898359a5..ea45a579 100644 --- a/src/subcommands/mod.rs +++ b/src/subcommands/mod.rs @@ -1,4 +1,5 @@ pub mod account; +pub mod dao; pub mod mock_tx; pub mod molecule; pub mod rpc; @@ -12,6 +13,7 @@ pub mod wallet; pub use self::tui::TuiSubCommand; pub use account::AccountSubCommand; +pub use dao::DAOSubCommand; pub use mock_tx::MockTxSubCommand; pub use molecule::MoleculeSubCommand; pub use rpc::RpcSubCommand; diff --git a/src/subcommands/wallet/mod.rs b/src/subcommands/wallet/mod.rs index e3adf505..248780d0 100644 --- a/src/subcommands/wallet/mod.rs +++ b/src/subcommands/wallet/mod.rs @@ -5,7 +5,7 @@ use std::path::PathBuf; use ckb_types::{ bytes::Bytes, - core::{BlockView, Capacity, EpochNumberWithFraction, ScriptHashType, TransactionView}, + core::{BlockView, Capacity, ScriptHashType, TransactionView}, h256, packed::{CellOutput, OutPoint, Script}, prelude::*, @@ -22,17 +22,15 @@ use crate::utils::{ }, index::IndexController, other::{ - check_capacity, get_address, get_live_cell_with_cache, get_network_type, - get_privkey_signer, get_to_data, read_password, serialize_signature, + check_capacity, get_address, get_live_cell_with_cache, get_max_mature_number, + get_network_type, get_privkey_signer, get_to_data, read_password, serialize_signature, }, printer::{OutputFormat, Printable}, }; use ckb_index::{with_index_db, IndexDatabase, LiveCellInfo}; use ckb_sdk::{ - calc_max_mature_number, constants::{ - CELLBASE_MATURITY, DAO_TYPE_HASH, MIN_SECP_CELL_CAPACITY, MULTISIG_TYPE_HASH, ONE_CKB, - SIGHASH_TYPE_HASH, + DAO_TYPE_HASH, MIN_SECP_CELL_CAPACITY, MULTISIG_TYPE_HASH, ONE_CKB, SIGHASH_TYPE_HASH, }, wallet::{DerivationPath, KeyStore}, Address, AddressPayload, GenesisInfo, HttpRpcClient, HumanCapacity, MultisigConfig, SignerFn, @@ -662,29 +660,6 @@ fn get_keystore_signer( }) } -// Get max mature block number -fn get_max_mature_number(client: &mut HttpRpcClient) -> Result { - let tip_epoch = client - .get_tip_header() - .map(|header| EpochNumberWithFraction::from_full_value(header.inner.epoch.0))?; - let tip_epoch_number = tip_epoch.number(); - if tip_epoch_number < 4 { - // No cellbase live cell is mature - Ok(0) - } else { - let max_mature_epoch = client - .get_epoch_by_number(tip_epoch_number - 4)? - .ok_or_else(|| "Can not get epoch less than current epoch number".to_string())?; - let start_number = max_mature_epoch.start_number; - let length = max_mature_epoch.length; - Ok(calc_max_mature_number( - tip_epoch, - Some((start_number, length)), - CELLBASE_MATURITY, - )) - } -} - fn is_mature(info: &LiveCellInfo, max_mature_number: u64) -> bool { // Not cellbase cell info.index.tx_index > 0 diff --git a/src/utils/arg.rs b/src/utils/arg.rs index 5c9b2c73..f825f1c3 100644 --- a/src/utils/arg.rs +++ b/src/utils/arg.rs @@ -1,6 +1,6 @@ use crate::utils::arg_parser::{ AddressParser, ArgParser, CapacityParser, FilePathParser, FixedHashParser, FromStrParser, - HexParser, PrivkeyPathParser, PubkeyHexParser, + HexParser, OutPointParser, PrivkeyPathParser, PubkeyHexParser, }; use ckb_types::{H160, H256}; use clap::Arg; @@ -194,3 +194,11 @@ pub fn top_n<'a, 'b>() -> Arg<'a, 'b> { .default_value("10") .help("Get top n capacity addresses") } + +pub fn out_point<'a, 'b>() -> Arg<'a, 'b> { + Arg::with_name("out-point") + .long("out-point") + .takes_value(true) + .validator(|input| { OutPointParser.validate(input) }) + .help("out-point to specify a cell. Example: 0xd56ed5d4e8984701714de9744a533413f79604b3b91461e2265614829d2005d1-1") +} diff --git a/src/utils/arg_parser.rs b/src/utils/arg_parser.rs index 19c1b56d..34831af8 100644 --- a/src/utils/arg_parser.rs +++ b/src/utils/arg_parser.rs @@ -497,7 +497,6 @@ impl ArgParser for CapacityParser { } } -#[allow(dead_code)] pub struct OutPointParser; impl ArgParser for OutPointParser { diff --git a/src/utils/other.rs b/src/utils/other.rs index eb87510a..ab5895dd 100644 --- a/src/utils/other.rs +++ b/src/utils/other.rs @@ -8,7 +8,8 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH}; use ckb_hash::blake2b_256; use ckb_index::VERSION; use ckb_sdk::{ - constants::{MIN_SECP_CELL_CAPACITY, ONE_CKB}, + calc_max_mature_number, + constants::{CELLBASE_MATURITY, MIN_SECP_CELL_CAPACITY, ONE_CKB}, rpc::AlertMessage, wallet::{KeyStore, ScryptType}, Address, AddressPayload, CodeHashIndex, GenesisInfo, HttpRpcClient, NetworkType, SignerFn, @@ -16,7 +17,7 @@ use ckb_sdk::{ }; use ckb_types::{ bytes::Bytes, - core::{service::Request, BlockView}, + core::{service::Request, BlockView, Capacity, EpochNumberWithFraction, TransactionView}, h256, packed::{CellOutput, OutPoint}, H160, H256, @@ -180,6 +181,29 @@ pub fn get_live_cell( }) } +// Get max mature block number +pub fn get_max_mature_number(rpc_client: &mut HttpRpcClient) -> Result { + let tip_epoch = rpc_client + .get_tip_header() + .map(|header| EpochNumberWithFraction::from_full_value(header.inner.epoch.0))?; + let tip_epoch_number = tip_epoch.number(); + if tip_epoch_number < 4 { + // No cellbase live cell is mature + Ok(0) + } else { + let max_mature_epoch = rpc_client + .get_epoch_by_number(tip_epoch_number - 4)? + .ok_or_else(|| "Can not get epoch less than current epoch number".to_string())?; + let start_number = max_mature_epoch.start_number; + let length = max_mature_epoch.length; + Ok(calc_max_mature_number( + tip_epoch, + Some((start_number, length)), + CELLBASE_MATURITY, + )) + } +} + pub fn get_network_type(rpc_client: &mut HttpRpcClient) -> Result { let chain_info = rpc_client.get_blockchain_info()?; NetworkType::from_raw_str(chain_info.chain.as_str()) @@ -222,6 +246,28 @@ pub fn check_capacity(capacity: u64, to_data_len: usize) -> Result<(), String> { Ok(()) } +pub fn check_lack_of_capacity(transaction: &TransactionView) -> Result<(), String> { + for (output, output_data) in transaction.outputs_with_data_iter() { + let exact = output + .clone() + .as_builder() + .build_exact_capacity(Capacity::bytes(output_data.len()).unwrap()) + .unwrap(); + let output_capacity: u64 = output.capacity().unpack(); + let exact_capacity: u64 = exact.capacity().unpack(); + if output_capacity < exact_capacity { + return Err(format!( + "Insufficient Cell Capacity, output_capacity({}) < exact_capacity({}), output: {}, output_data_size: {}", + output_capacity, + exact_capacity, + output, + output_data.len(), + )); + } + } + Ok(()) +} + pub fn get_to_data(m: &ArgMatches) -> Result { let to_data_opt: Option = HexParser.from_matches_opt(m, "to-data", false)?; match to_data_opt { From ae1f7c6b5ce73cc0eee23e7ad8aedc98fbdc2e28 Mon Sep 17 00:00:00 2001 From: keroro520 Date: Tue, 31 Dec 2019 11:42:29 +0800 Subject: [PATCH 07/10] fix: Rebase error --- src/interactive.rs | 4 ++-- src/main.rs | 4 ++-- src/subcommands/dao/builder.rs | 10 +++++++--- src/subcommands/dao/mod.rs | 2 +- src/utils/other.rs | 1 + 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/interactive.rs b/src/interactive.rs index 3a931cec..3b9919c1 100644 --- a/src/interactive.rs +++ b/src/interactive.rs @@ -12,8 +12,8 @@ use rustyline::{Cmd, CompletionType, Config, EditMode, Editor, KeyPress}; use serde_json::json; use crate::subcommands::{ - AccountSubCommand, CliSubCommand, DAOSubCommand, MockTxSubCommand, MoleculeSubCommand, RpcSubCommand, - TxSubCommand, UtilSubCommand, WalletSubCommand, + AccountSubCommand, CliSubCommand, DAOSubCommand, MockTxSubCommand, MoleculeSubCommand, + RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, }; use crate::utils::{ completer::CkbCompleter, diff --git a/src/main.rs b/src/main.rs index 577216cb..bb8fc7e2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,8 +17,8 @@ use subcommands::TuiSubCommand; use crate::utils::other::get_genesis_info; use interactive::InteractiveEnv; use subcommands::{ - start_index_thread, AccountSubCommand, CliSubCommand, DAOSubCommand, MockTxSubCommand, MoleculeSubCommand, - RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, + start_index_thread, AccountSubCommand, CliSubCommand, DAOSubCommand, MockTxSubCommand, + MoleculeSubCommand, RpcSubCommand, TxSubCommand, UtilSubCommand, WalletSubCommand, }; use utils::other::sync_to_tip; use utils::{ diff --git a/src/subcommands/dao/builder.rs b/src/subcommands/dao/builder.rs index 19d6a454..6561e725 100644 --- a/src/subcommands/dao/builder.rs +++ b/src/subcommands/dao/builder.rs @@ -1,6 +1,6 @@ use super::util::minimal_unlock_point; use ckb_index::LiveCellInfo; -use ckb_sdk::{GenesisInfo, HttpRpcClient, Since}; +use ckb_sdk::{GenesisInfo, HttpRpcClient, Since, SinceType}; use ckb_types::{ bytes::Bytes, core::{HeaderView, ScriptHashType, TransactionBuilder, TransactionView}, @@ -177,8 +177,12 @@ impl DAOBuilder { .zip(prepare_txo_headers.iter()) .map(|((_, _, deposit_header), (out_point, _, prepare_header))| { let minimal_unlock_point = minimal_unlock_point(deposit_header, prepare_header); - let since = Since::new_absolute_epoch(minimal_unlock_point.full_value()).value(); - CellInput::new(out_point.clone(), since) + let since = Since::new( + SinceType::EpochNumberWithFraction, + minimal_unlock_point.full_value(), + false, + ); + CellInput::new(out_point.clone(), since.value()) }); let total_capacity = deposit_txo_headers .iter() diff --git a/src/subcommands/dao/mod.rs b/src/subcommands/dao/mod.rs index 2e7abd5c..7779f2ea 100644 --- a/src/subcommands/dao/mod.rs +++ b/src/subcommands/dao/mod.rs @@ -2,7 +2,7 @@ use self::builder::DAOBuilder; use self::command::TransactArgs; use self::util::blake2b_args; use crate::subcommands::dao::util::is_mature; -use crate::subcommands::IndexController; +use crate::utils::index::IndexController; use crate::utils::other::{ get_max_mature_number, get_network_type, get_privkey_signer, read_password, serialize_signature, }; diff --git a/src/utils/other.rs b/src/utils/other.rs index ab5895dd..42493d93 100644 --- a/src/utils/other.rs +++ b/src/utils/other.rs @@ -20,6 +20,7 @@ use ckb_types::{ core::{service::Request, BlockView, Capacity, EpochNumberWithFraction, TransactionView}, h256, packed::{CellOutput, OutPoint}, + prelude::*, H160, H256, }; use clap::ArgMatches; From eff83e90b46c433638f1b01cef163e57525a8812 Mon Sep 17 00:00:00 2001 From: keroro520 Date: Thu, 2 Jan 2020 11:03:07 +0800 Subject: [PATCH 08/10] feat: Impl calculate_dao_maximum_withdraw locally --- Cargo.lock | 1 + Cargo.toml | 1 + src/subcommands/dao/builder.rs | 21 ++++---- src/subcommands/dao/util.rs | 87 +++++++++++++++++++++++++++------- 4 files changed, 85 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c586a820..53eaf4dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,6 +336,7 @@ dependencies = [ "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "ckb-build-info 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", "ckb-crypto 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-dao-utils 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", "ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", "ckb-index 0.26.1", "ckb-jsonrpc-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", diff --git a/Cargo.toml b/Cargo.toml index 89efd33f..df0434f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ ckb-util = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } ckb-sdk = { path = "ckb-sdk" } ckb-index = { path = "ckb-index" } ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-dao-utils = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } jsonrpc-client-core = "0.5.0" secp256k1 = {version = "0.15.0" } diff --git a/src/subcommands/dao/builder.rs b/src/subcommands/dao/builder.rs index 6561e725..c85d08e5 100644 --- a/src/subcommands/dao/builder.rs +++ b/src/subcommands/dao/builder.rs @@ -1,6 +1,8 @@ use super::util::minimal_unlock_point; +use crate::subcommands::dao::util::calculate_dao_maximum_withdraw4; use ckb_index::LiveCellInfo; use ckb_sdk::{GenesisInfo, HttpRpcClient, Since, SinceType}; +use ckb_types::core::Capacity; use ckb_types::{ bytes::Bytes, core::{HeaderView, ScriptHashType, TransactionBuilder, TransactionView}, @@ -187,14 +189,17 @@ impl DAOBuilder { let total_capacity = deposit_txo_headers .iter() .zip(prepare_txo_headers.iter()) - .map(|((deposit_txo, _, _), (_, _, prepare_header))| { - rpc_client - .calculate_dao_maximum_withdraw( - deposit_txo.clone(), - prepare_header.hash().unpack(), - ) - .expect("RPC calculate_dao_maximum_withdraw failed") - .as_u64() + .map(|((_, output, deposit_header), (_, _, prepare_header))| { + const DAO_OUTPUT_DATA_LEN: usize = 8; + let occupied_capacity = output + .occupied_capacity(Capacity::bytes(DAO_OUTPUT_DATA_LEN).unwrap()) + .unwrap(); + calculate_dao_maximum_withdraw4( + deposit_header, + prepare_header, + output, + occupied_capacity.as_u64(), + ) }) .sum::(); let output_capacity = total_capacity - self.tx_fee; diff --git a/src/subcommands/dao/util.rs b/src/subcommands/dao/util.rs index 84abf4d0..fb0bd014 100644 --- a/src/subcommands/dao/util.rs +++ b/src/subcommands/dao/util.rs @@ -2,10 +2,12 @@ use crate::utils::{ other::check_lack_of_capacity, printer::{OutputFormat, Printable}, }; +use ckb_dao_utils::extract_dao_data; use ckb_hash::new_blake2b; use ckb_index::LiveCellInfo; use ckb_sdk::HttpRpcClient; -use ckb_types::core::TransactionView; +use ckb_types::core::{Capacity, TransactionView}; +use ckb_types::packed::CellOutput; use ckb_types::{ core::{EpochNumber, EpochNumberWithFraction, HeaderView}, packed, @@ -32,28 +34,79 @@ pub(crate) fn blake2b_args(args: &[Vec]) -> [u8; 32] { pub(crate) fn calculate_dao_maximum_withdraw( rpc_client: &mut HttpRpcClient, - info: &LiveCellInfo, + prepare_cell: &LiveCellInfo, ) -> Result { - let tx = rpc_client - .get_transaction(info.tx_hash.clone())? - .ok_or_else(|| "invalid prepare out_point, the tx is notfound".to_string())?; - let prepare_block_hash = tx + // Get the deposit_header and prepare_header corresponding to the `prepare_cell` + let prepare_tx_status = rpc_client + .get_transaction(prepare_cell.tx_hash.clone())? + .ok_or_else(|| "invalid prepare out_point, the tx is not found".to_string())?; + let prepare_block_hash = prepare_tx_status .tx_status .block_hash .ok_or("invalid prepare out_point, the tx is not committed")?; - let tx: packed::Transaction = tx.transaction.inner.into(); - let tx = tx.into_view(); + let prepare_tx = { + let tx: packed::Transaction = prepare_tx_status.transaction.inner.into(); + tx.into_view() + }; + let deposit_tx_status = { + let input = prepare_tx + .inputs() + .get(prepare_cell.out_point().index().unpack()) + .expect("invalid prepare out_point"); + let deposit_tx_hash = input.previous_output().tx_hash(); + rpc_client + .get_transaction(deposit_tx_hash.unpack())? + .ok_or_else(|| "invalid deposit out_point, the tx is not found".to_string())? + }; + let deposit_block_hash = deposit_tx_status + .tx_status + .block_hash + .ok_or("invalid deposit out_point, the tx is not committed")?; + let deposit_tx = { + let tx: packed::Transaction = deposit_tx_status.transaction.inner.into(); + tx.into_view() + }; + let (output, output_data) = { + deposit_tx + .output_with_data(prepare_cell.out_point().index().unpack()) + .ok_or_else(|| "invalid deposit out_point, the cell is not found".to_string())? + }; + let deposit_header: HeaderView = rpc_client + .get_header(deposit_block_hash)? + .ok_or_else(|| "failed to get deposit_header".to_string())? + .into(); + let prepare_header: HeaderView = rpc_client + .get_header(prepare_block_hash)? + .ok_or_else(|| "failed to get prepare_header".to_string())? + .into(); - let input = tx - .inputs() - .get(info.out_point().index().unpack()) - .expect("invalid prepare out_point"); - let deposit_out_point = input.previous_output(); + // Calculate maximum withdraw of the deposited_output + // + // NOTE: It is safe to use `unwrap` for the data we fetch from ckb node. + let occupied_capacity = output + .occupied_capacity(Capacity::bytes(output_data.len()).unwrap()) + .unwrap(); + Ok(calculate_dao_maximum_withdraw4( + &deposit_header, + &prepare_header, + &output, + occupied_capacity.as_u64(), + )) +} - let maximum = rpc_client - .calculate_dao_maximum_withdraw(deposit_out_point, prepare_block_hash)? - .as_u64(); - Ok(maximum) +pub(crate) fn calculate_dao_maximum_withdraw4( + deposit_header: &HeaderView, + prepare_header: &HeaderView, + output: &CellOutput, + occupied_capacity: u64, +) -> u64 { + let (deposit_ar, _, _, _) = extract_dao_data(deposit_header.dao()).unwrap(); + let (prepare_ar, _, _, _) = extract_dao_data(prepare_header.dao()).unwrap(); + let output_capacity: Capacity = output.capacity().unpack(); + let counted_capacity = output_capacity.safe_sub(occupied_capacity).unwrap(); + let interest = + u128::from(counted_capacity.as_u64()) * u128::from(prepare_ar) / u128::from(deposit_ar); + output_capacity.as_u64() + interest as u64 } pub(crate) fn send_transaction( From 45571b9470b960be74d360a377d9fe65b04376a3 Mon Sep 17 00:00:00 2001 From: keroro520 Date: Thu, 2 Jan 2020 21:14:58 +0800 Subject: [PATCH 09/10] test: Add test for dao --- test/src/main.rs | 4 +- test/src/setup.rs | 2 +- test/src/spec/dao.rs | 101 +++++++++++++++++++++++++++++++++++++++++++ test/src/spec/mod.rs | 2 + 4 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 test/src/spec/dao.rs diff --git a/test/src/main.rs b/test/src/main.rs index 7f452e21..fea4c61e 100644 --- a/test/src/main.rs +++ b/test/src/main.rs @@ -6,7 +6,7 @@ pub mod util; use crate::app::App; use crate::setup::Setup; -use crate::spec::{RpcGetTipBlockNumber, Spec}; +use crate::spec::{DaoNormal, RpcGetTipBlockNumber, Spec}; use crate::util::{find_available_port, run_cmd, temp_dir}; use std::env; @@ -52,5 +52,5 @@ fn run_spec(spec: Box, app: &App) { } fn all_specs() -> Vec> { - vec![Box::new(RpcGetTipBlockNumber)] + vec![Box::new(RpcGetTipBlockNumber), Box::new(DaoNormal)] } diff --git a/test/src/setup.rs b/test/src/setup.rs index 3081b791..ea9e0410 100644 --- a/test/src/setup.rs +++ b/test/src/setup.rs @@ -69,7 +69,7 @@ impl Setup { log::info!("[Execute]: {}", command); loop { let mut child = Command::new(&self.cli_bin) - .args(vec!["--url", &self.rpc_url()]) + .args(vec!["--wait-for-sync", "--url", &self.rpc_url()]) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) diff --git a/test/src/spec/dao.rs b/test/src/spec/dao.rs new file mode 100644 index 00000000..e95250c1 --- /dev/null +++ b/test/src/spec/dao.rs @@ -0,0 +1,101 @@ +use crate::miner::Miner; +use crate::setup::Setup; +use crate::spec::Spec; +use ckb_chain_spec::ChainSpec; + +const EPOCH_LENGTH: u64 = 32; +const LOCK_PERIOD_EPOCHES: u64 = 180; + +pub struct DaoNormal; + +impl Spec for DaoNormal { + fn run(&self, setup: &mut Setup) { + let privkey_path = setup.miner().privkey_path().to_string(); + assert_eq!(deposited_capacity(setup), 0); + assert_eq!(prepared_capacity(setup), 0); + + let deposit_tx_hash = setup.cli(&format!( + "dao deposit --tx-fee 0.00001 --capacity 102 --privkey-path {}", + privkey_path, + )); + assert!(deposit_tx_hash.starts_with("0x")); + setup.miner().generate_blocks(3); + assert_eq!(deposited_capacity(setup), 10_200_000_000); + assert_eq!(prepared_capacity(setup), 0); + + let prepare_tx_hash = setup.cli(&format!( + "dao prepare --tx-fee 0.00001 --out-point {}-{} --privkey-path {}", + deposit_tx_hash, 0, privkey_path, + )); + assert!(prepare_tx_hash.starts_with("0x")); + setup.miner().generate_blocks(3); + assert_eq!(deposited_capacity(setup), 0); + assert_eq!(prepared_capacity(setup), 10_200_000_000); + + let output = setup.cli(&format!( + "dao withdraw --tx-fee 0.00001 --out-point {}-{} --privkey-path {}", + prepare_tx_hash, 0, privkey_path, + )); + assert!(!output.starts_with("0x")); // withdraw failed because of since immature + + setup + .miner() + .generate_blocks(LOCK_PERIOD_EPOCHES * EPOCH_LENGTH); + + let withdraw_tx_hash = setup.cli(&format!( + "dao withdraw --tx-fee 0.00001 --out-point {}-{} --privkey-path {}", + prepare_tx_hash, 0, privkey_path, + )); + setup.miner().generate_blocks(3); + assert!(withdraw_tx_hash.starts_with("0x")); + assert_eq!(deposited_capacity(setup), 0); + assert_eq!(prepared_capacity(setup), 0); + + let output = setup.cli(&format!( + "wallet get-live-cells --address {} --limit 10000000", + Miner::address(), + )); + assert!(output.contains(&withdraw_tx_hash)); + } + + fn modify_spec_toml(&self, spec_toml: &mut ChainSpec) { + spec_toml.params.genesis_epoch_length = EPOCH_LENGTH; + spec_toml.params.permanent_difficulty_in_dummy = true; + } +} + +fn deposited_capacity(setup: &Setup) -> u64 { + let output = setup.cli(&format!( + "dao query-deposited-cells --address {}", + Miner::address(), + )); + // "total_capacity: 10200000000" + if let Some(line) = output + .lines() + .find(|line| line.contains("total_capacity: ")) + { + line.trim_end()[line.find(' ').unwrap() + 1..] + .parse() + .unwrap() + } else { + 0 + } +} + +fn prepared_capacity(setup: &Setup) -> u64 { + let output = setup.cli(&format!( + "dao query-prepared-cells --address {}", + Miner::address(), + )); + // "total_maximum_withdraw: 10200000000" + if let Some(line) = output + .lines() + .find(|line| line.contains("total_maximum_withdraw: ")) + { + line.trim_end()[line.find(' ').unwrap() + 1..] + .parse() + .unwrap() + } else { + 0 + } +} diff --git a/test/src/spec/mod.rs b/test/src/spec/mod.rs index f38bc1e6..d7e81882 100644 --- a/test/src/spec/mod.rs +++ b/test/src/spec/mod.rs @@ -1,5 +1,7 @@ +mod dao; mod rpc; +pub use dao::*; pub use rpc::*; use crate::setup::Setup; From ef20a7cf8f4a4337c0962e6992787fe60233b59d Mon Sep 17 00:00:00 2001 From: Linfeng Qian Date: Fri, 10 Jan 2020 15:30:18 +0800 Subject: [PATCH 10/10] chore: Update ckb dependency to v0.27.0 --- Cargo.lock | 540 ++++++++++++++++++++------------------- Cargo.toml | 20 +- Makefile | 2 +- ckb-index/Cargo.toml | 4 +- ckb-sdk-types/Cargo.toml | 14 +- ckb-sdk/Cargo.toml | 14 +- test/Cargo.toml | 12 +- 7 files changed, 307 insertions(+), 299 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 53eaf4dc..474fdffc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,9 +72,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "atty" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -84,6 +85,11 @@ name = "autocfg" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "backtrace" version = "0.3.40" @@ -132,7 +138,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -152,7 +158,7 @@ dependencies = [ "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -196,7 +202,7 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -254,7 +260,7 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -275,7 +281,7 @@ name = "cc" version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -296,56 +302,56 @@ name = "chrono" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-build-info" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" [[package]] name = "ckb-chain-spec" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" -dependencies = [ - "ckb-crypto 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-dao-utils 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-error 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-jsonrpc-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-pow 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-rational 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-resource 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" +dependencies = [ + "ckb-crypto 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-dao-utils 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-error 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-jsonrpc-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-pow 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-rational 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-resource 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-cli" -version = "0.26.1" +version = "0.27.0" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-build-info 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-crypto 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-dao-utils 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-index 0.26.1", - "ckb-jsonrpc-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-resource 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-sdk 0.26.1", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-util 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-build-info 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-crypto 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-dao-utils 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-index 0.27.0", + "ckb-jsonrpc-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-resource 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-sdk 0.27.0", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-util 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "colored 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -357,12 +363,12 @@ dependencies = [ "jsonrpc-client-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustyline 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.15.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", "shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -374,10 +380,10 @@ dependencies = [ [[package]] name = "ckb-crypto" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-fixed-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-fixed-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "faster-hex 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -387,52 +393,52 @@ dependencies = [ [[package]] name = "ckb-dao-utils" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-error 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-error 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "enum-display-derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-error" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-occupied-capacity 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-occupied-capacity 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "enum-display-derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-fixed-hash" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-fixed-hash-core 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-fixed-hash-hack 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-fixed-hash-core 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-fixed-hash-hack 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-fixed-hash-core" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "faster-hex 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-fixed-hash-hack" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-fixed-hash-core 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-fixed-hash-core 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -441,42 +447,42 @@ dependencies = [ [[package]] name = "ckb-hash" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "blake2b-rs 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-index" -version = "0.26.1" +version = "0.27.0" dependencies = [ "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-sdk 0.26.1", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-sdk 0.27.0", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rocksdb 0.12.2 (git+https://github.com/nervosnetwork/rust-rocksdb?rev=14d2991)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-jsonrpc-types" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "faster-hex 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-logger" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -486,35 +492,35 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "sentry 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-occupied-capacity" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-occupied-capacity-core 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-occupied-capacity-macros 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-occupied-capacity-core 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-occupied-capacity-macros 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-occupied-capacity-core" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-occupied-capacity-macros" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-occupied-capacity-core 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-occupied-capacity-core 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", @@ -522,80 +528,80 @@ dependencies = [ [[package]] name = "ckb-pow" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "eaglesong 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-rational" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "numext-fixed-uint 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-resource" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "ckb-system-scripts 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "includedir 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "includedir_codegen 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-script" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-chain-spec 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-error 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-logger 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-script-data-loader 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-chain-spec 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-error 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-logger 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-script-data-loader 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "ckb-vm 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "faster-hex 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ckb-script-data-loader" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", ] [[package]] name = "ckb-sdk" -version = "0.26.1" +version = "0.27.0" dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "bech32 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitcoin_hashes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-crypto 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-jsonrpc-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-resource 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-script 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-sdk-types 0.26.1", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-crypto 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-jsonrpc-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-resource 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-script 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-sdk-types 0.27.0", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "faster-hex 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -606,8 +612,8 @@ dependencies = [ "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "scrypt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.15.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -615,16 +621,16 @@ dependencies = [ [[package]] name = "ckb-sdk-types" -version = "0.26.1" +version = "0.27.0" dependencies = [ - "ckb-crypto 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-error 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-jsonrpc-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-script 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "ckb-crypto 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-error 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-jsonrpc-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-script 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -641,16 +647,16 @@ dependencies = [ [[package]] name = "ckb-types" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "ckb-error 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-fixed-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-occupied-capacity 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", - "ckb-rational 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)", + "ckb-error 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-fixed-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-occupied-capacity 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", + "ckb-rational 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)", "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "merkle-cbt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -660,8 +666,8 @@ dependencies = [ [[package]] name = "ckb-util" -version = "0.26.1-pre" -source = "git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1#04c00b0398d7e47ccebae951b3f01a28183672d1" +version = "0.27.0-pre" +source = "git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1#6a3c972ebd8b642917196947ab3bc693848f9b7a" dependencies = [ "linked-hash-map 0.5.1 (git+https://github.com/nervosnetwork/linked-hash-map?rev=df27f21)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -703,7 +709,7 @@ version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -721,10 +727,10 @@ dependencies = [ [[package]] name = "colored" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -753,7 +759,7 @@ dependencies = [ "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -822,9 +828,10 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -881,8 +888,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -894,7 +901,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -934,7 +941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "encoding_rs" -version = "0.8.20" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -954,10 +961,10 @@ name = "env_logger" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -984,9 +991,9 @@ name = "failure_derive" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1090,12 +1097,12 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1145,7 +1152,7 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1205,7 +1212,7 @@ name = "humantime" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1221,7 +1228,7 @@ dependencies = [ "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1345,7 +1352,7 @@ name = "ipnetwork" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1370,7 +1377,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1394,8 +1401,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1406,8 +1413,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1481,7 +1488,7 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1542,7 +1549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "mime" -version = "0.3.14" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1550,7 +1557,7 @@ name = "mime_guess" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1660,19 +1667,19 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1680,7 +1687,7 @@ name = "num_cpus" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1713,7 +1720,7 @@ dependencies = [ "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "numext-constructor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1792,7 +1799,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multihash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1805,8 +1812,8 @@ dependencies = [ "blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1825,7 +1832,7 @@ name = "parking_lot" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1946,9 +1953,9 @@ name = "proc-macro-hack" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1961,7 +1968,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1975,13 +1982,13 @@ dependencies = [ "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quick-error" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2002,7 +2009,7 @@ name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2061,7 +2068,7 @@ name = "rand" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2104,7 +2111,7 @@ name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2173,21 +2180,21 @@ dependencies = [ [[package]] name = "rayon" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2227,18 +2234,18 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2266,17 +2273,17 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "encoding_rs 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2315,7 +2322,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2420,7 +2427,7 @@ dependencies = [ "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "pbkdf2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2480,7 +2487,7 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "sentry-types 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2496,7 +2503,7 @@ dependencies = [ "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "debugid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2505,20 +2512,20 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2528,7 +2535,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2538,7 +2545,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2549,13 +2556,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sha-1" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2566,7 +2573,7 @@ dependencies = [ [[package]] name = "sha2" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2635,7 +2642,7 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2691,10 +2698,10 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2712,9 +2719,9 @@ name = "synstructure" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2775,7 +2782,7 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3026,7 +3033,7 @@ name = "toml" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3096,7 +3103,7 @@ name = "unicode-normalization" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3141,7 +3148,7 @@ dependencies = [ [[package]] name = "url" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3154,7 +3161,7 @@ name = "url_serde" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3169,7 +3176,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3229,7 +3236,7 @@ dependencies = [ [[package]] name = "wasi" -version = "0.7.0" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -3330,8 +3337,9 @@ dependencies = [ "checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" @@ -3344,7 +3352,7 @@ dependencies = [ "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" "checksum blake2b-rs 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6e35e362830ef90ecea16f09b21b75d22d33a8562a679c74ab4f4fa49b4fcb87" -"checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" +"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" @@ -3358,34 +3366,34 @@ dependencies = [ "checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" -"checksum ckb-build-info 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-chain-spec 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-crypto 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-dao-utils 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-error 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-fixed-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-fixed-hash-core 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-fixed-hash-hack 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-hash 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-jsonrpc-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-logger 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-occupied-capacity 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-occupied-capacity-core 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-occupied-capacity-macros 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-pow 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-rational 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-resource 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-script 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-script-data-loader 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" +"checksum ckb-build-info 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-chain-spec 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-crypto 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-dao-utils 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-error 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-fixed-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-fixed-hash-core 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-fixed-hash-hack 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-hash 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-jsonrpc-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-logger 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-occupied-capacity 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-occupied-capacity-core 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-occupied-capacity-macros 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-pow 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-rational 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-resource 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-script 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-script-data-loader 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" "checksum ckb-system-scripts 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "261dd95a93c09ea24397c85b4fbca061e1da2d6573189749aeb99fe840aaf0c9" -"checksum ckb-types 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" -"checksum ckb-util 0.26.1-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.26.1-rc1)" = "" +"checksum ckb-types 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" +"checksum ckb-util 0.27.0-pre (git+https://github.com/nervosnetwork/ckb?tag=v0.27.0-rc1)" = "" "checksum ckb-vm 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "684aca846d958bc5c2196b10839b69ec573cc693b14dc701986adda123ffbef0" "checksum ckb-vm-definitions 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4a65696efd8974a3c785619f2bfc4c40f2cf318ac184c30aa72d0f539a4a4f" "checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "433e7ac7d511768127ed85b0c4947f47a254131e37864b2dc13f52aa32cd37e5" +"checksum colored 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f930f8b286023ed451756fe2527d73484d667adf9e905e9932e81d52996a343a" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" "checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" "checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" @@ -3396,7 +3404,7 @@ dependencies = [ "checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" "checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" +"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" "checksum crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" @@ -3410,7 +3418,7 @@ dependencies = [ "checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" "checksum eaglesong 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8d978bd5d343e8ab9b5c0fc8d93ff9c602fdc96616ffff9c05ac7a155419b824" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" -"checksum encoding_rs 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)" = "87240518927716f79692c2ed85bfe6e98196d18c6401ec75355760233a7e12e9" +"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum enum-display-derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "53f76eb63c4bfc6fce5000f106254701b741fc9a65ee08445fde0ff39e583f1c" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" "checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" @@ -3431,13 +3439,13 @@ dependencies = [ "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum goblin 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "e3fa261d919c1ae9d1e4533c4a2f99e10938603c4208d56c05bec7a872b661b0" "checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" -"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" +"checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" "checksum hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" "checksum hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e" "checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" @@ -3472,7 +3480,7 @@ dependencies = [ "checksum linked-hash-map 0.5.1 (git+https://github.com/nervosnetwork/linked-hash-map?rev=df27f21)" = "" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" -"checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" +"checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" @@ -3481,7 +3489,7 @@ dependencies = [ "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" "checksum merkle-cbt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d589b5a7ca642540e7ccfbca3bcd0aa18693eb9287e2a6b17c79b1d062d52863" -"checksum mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "dd1d63acd1b78403cc0c325605908475dd9b9a3acbf65ed8bcab97e27014afcf" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" "checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" @@ -3492,8 +3500,8 @@ dependencies = [ "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nix 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4dbdc256eaac2e3bd236d93ad999d3479ef775c863dbda3068c4006a92eec51b" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" -"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" +"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" "checksum numext-constructor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "983983b13ec50f55d5b9536faa553d7fadaa12fae9e0dfda76ba74aebfcc7522" "checksum numext-fixed-uint 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "84f38aa6a49599f6cf38edbf3af3da0eda190ed3f3889afa5f4cb13be5673259" @@ -3526,9 +3534,9 @@ dependencies = [ "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" +"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" "checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" @@ -3549,14 +3557,14 @@ dependencies = [ "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" "checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43739f8831493b276363637423d3622d4bd6394ab6f0a9c4a552e208aeb7fddd" -"checksum rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8bf17de6f23b05473c437eb958b9c850bfc8af0961fe17b4cc92d5a627b4791" +"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" +"checksum regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5508c1941e4e7cb19965abef075d35a9a8b5cdf0846f30b4050e9b55dc55e87" +"checksum regex-syntax 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e734e891f5b408a29efbf8309e656876276f49ab6a6ac208600b4419bd893d90" "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" @@ -3583,13 +3591,13 @@ dependencies = [ "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum sentry 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "509c5fbb9e875fafcd9c4612c0e49d476083b848bf87380cfe1126ebc745c140" "checksum sentry-types 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b23e3d9c8c6e4a1523f24df6753c4088bfe16c44a73c8881c1d23c70f28ae280" -"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" -"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" "checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" "checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" -"checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" -"checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" +"checksum sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +"checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" "checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" "checksum shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39acde55a154c4cd3ae048ac78cc21c25f3a0145e44111b523279113dce0d94a" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" @@ -3599,7 +3607,7 @@ dependencies = [ "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" +"checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum stream-cipher 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c" "checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" @@ -3607,7 +3615,7 @@ dependencies = [ "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" +"checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" @@ -3616,7 +3624,7 @@ dependencies = [ "checksum termion 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "818ef3700c2a7b447dca1a1dd28341fe635e6ee103c806c636bb9c929991b2cd" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum thread_local 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88ddf1ad580c7e3d1efff877d972bcc93f995556b9087a5a259630985c88ceab" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" @@ -3653,7 +3661,7 @@ dependencies = [ "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f0023a96687fe169081e8adce3f65e3874426b7886e9234d490af2dc077959" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" "checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea" "checksum utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d" "checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" @@ -3665,7 +3673,7 @@ dependencies = [ "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" "checksum want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" "checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" diff --git a/Cargo.toml b/Cargo.toml index df0434f3..e668c770 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,21 @@ [package] name = "ckb-cli" -version = "0.26.1" +version = "0.27.0" license = "MIT" authors = ["Linfeng Qian ", "Nervos Core Dev "] edition = "2018" [dependencies] -ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1", features = ["secp"] } -ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-util = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1", features = ["secp"] } +ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-util = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } ckb-sdk = { path = "ckb-sdk" } ckb-index = { path = "ckb-index" } -ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-dao-utils = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-dao-utils = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } jsonrpc-client-core = "0.5.0" secp256k1 = {version = "0.15.0" } @@ -51,7 +51,7 @@ tui = "0.6.0" termion = "1.5" [build-dependencies] -ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } [workspace] members = ["ckb-sdk", "ckb-index", "ckb-sdk-types"] diff --git a/Makefile b/Makefile index 12a43d94..da5b54f7 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ci: fmt clippy test security-audit git diff --exit-code Cargo.lock integration: - bash devtools/ci/integration.sh v0.26.1-rc1 + bash devtools/ci/integration.sh v0.27.0-rc1 prod: ## Build binary with release profile. cargo build --release diff --git a/ckb-index/Cargo.toml b/ckb-index/Cargo.toml index 4ce1d8e6..04bbf6d2 100644 --- a/ckb-index/Cargo.toml +++ b/ckb-index/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ckb-index" -version = "0.26.1" +version = "0.27.0" authors = ["Linfeng Qian ", "Nervos Core Dev "] edition = "2018" license = "MIT" @@ -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.26.1-rc1" } +ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } ckb-sdk = { path = "../ckb-sdk" } [dependencies.rocksdb] diff --git a/ckb-sdk-types/Cargo.toml b/ckb-sdk-types/Cargo.toml index 3933bffe..d5393493 100644 --- a/ckb-sdk-types/Cargo.toml +++ b/ckb-sdk-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ckb-sdk-types" -version = "0.26.1" +version = "0.27.0" authors = ["Linfeng Qian ", "Nervos Core Dev "] edition = "2018" license = "MIT" @@ -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.26.1-rc1" } -ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1", default-features = false } -ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-error = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1", default-features = false } +ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-error = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } [dev-dependencies] -ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1", features = ["secp"] } +ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1", features = ["secp"] } [features] default = ["ckb-script/default"] diff --git a/ckb-sdk/Cargo.toml b/ckb-sdk/Cargo.toml index 40f6d51d..ccb38b6d 100644 --- a/ckb-sdk/Cargo.toml +++ b/ckb-sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ckb-sdk" -version = "0.26.1" +version = "0.27.0" authors = ["Linfeng Qian ", "Nervos Core Dev "] edition = "2018" license = "MIT" @@ -27,10 +27,10 @@ chrono = "0.4.6" failure = "0.1.5" lazy_static = "1.4.0" -ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1", features = ["secp"] } +ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-script = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-resource = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1", features = ["secp"] } ckb-sdk-types = { path = "../ckb-sdk-types" } diff --git a/test/Cargo.toml b/test/Cargo.toml index 37836625..4834a730 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cli-test" -version = "0.26.1" +version = "0.27.0" authors = ["Linfeng Qian "] edition = "2018" @@ -13,11 +13,11 @@ log = "0.4" env_logger = "0.6" toml = "0.5.0" ckb-sdk = { path = "../ckb-sdk" } -ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-app-config = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-chain-spec = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } -ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1", features = ["secp"] } -ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.26.1-rc1" } +ckb-types = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-app-config = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-chain-spec = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } +ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1", features = ["secp"] } +ckb-hash = { git = "https://github.com/nervosnetwork/ckb", tag = "v0.27.0-rc1" } regex = "1.1.6" # Prevent this from interfering with workspaces