From d9cd8593a69760e1dbc8082eb4ba99110ef6d85c Mon Sep 17 00:00:00 2001 From: xiemener Date: Mon, 7 Dec 2020 14:58:14 +0800 Subject: [PATCH 01/10] add substrate --- Cargo.toml | 1 + common/src/apdu.rs | 33 +++++ common/src/constants.rs | 4 +- device/src/app_delete.rs | 2 +- device/src/app_download.rs | 2 +- device/src/device_binding.rs | 2 +- proto/build.rs | 4 + proto/src/substrate.proto | 10 ++ wallet/coin-substrate/Cargo.toml | 17 +++ wallet/coin-substrate/src/address.rs | 155 ++++++++++++++++++++++ wallet/coin-substrate/src/lib.rs | 18 +++ wallet/coin-substrate/src/substrateapi.rs | 10 ++ wallet/coin-substrate/src/transaction.rs | 62 +++++++++ 13 files changed, 316 insertions(+), 4 deletions(-) create mode 100644 proto/src/substrate.proto create mode 100644 wallet/coin-substrate/Cargo.toml create mode 100644 wallet/coin-substrate/src/address.rs create mode 100644 wallet/coin-substrate/src/lib.rs create mode 100644 wallet/coin-substrate/src/substrateapi.rs create mode 100644 wallet/coin-substrate/src/transaction.rs diff --git a/Cargo.toml b/Cargo.toml index 28baa903..452a0678 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,4 +9,5 @@ members = [ "wallet/coin-ethereum", "wallet/coin-eos", "wallet/coin-cosmos", + "wallet/coin-substrate", ] \ No newline at end of file diff --git a/common/src/apdu.rs b/common/src/apdu.rs index ac5f3a31..04e5f2d2 100644 --- a/common/src/apdu.rs +++ b/common/src/apdu.rs @@ -261,6 +261,39 @@ impl Secp256k1Apdu { } } +pub struct Ed25519Apdu(); + +impl Default for Ed25519Apdu { + fn default() -> Self { + Ed25519Apdu() + } +} + +impl Ed25519Apdu { + pub fn sign(data: &[u8]) -> Vec { + Apdu::prepare_sign(0x81, data.to_vec()) + } + + pub fn get_xpub(data: &[u8]) -> String { + if data.len() as u32 > LC_MAX { + panic!("data to long"); + } + let mut apdu = ApduHeader::new(0x80, 0x82, 0x00, 0x00, data.len() as u8).to_array(); + apdu.extend(data); + apdu.push(0x00); //Le + hex::encode(apdu) + } + + pub fn register_address(name: &[u8], address: &[u8]) -> String { + let mut data: Vec = vec![]; + data.push(address.len() as u8); + data.extend(address); + data.push(name.len() as u8); + data.extend(name); + Apdu::register_address(0x83, &data) + } +} + pub struct Apdu {} struct ApduHeader { diff --git a/common/src/constants.rs b/common/src/constants.rs index fe567359..983b9ac7 100644 --- a/common/src/constants.rs +++ b/common/src/constants.rs @@ -1,5 +1,5 @@ pub const VERSION: &str = "2.0.0"; -pub const URL: &str = "https://imkey.online:1000/imkey"; +pub const URL: &str = "https://imkeyserver.com:10443/imkey/"; pub const TSM_ACTION_SE_SECURE_CHECK: &str = "/seSecureCheck"; pub const TSM_ACTION_APP_DOWNLOAD: &str = "/appDownload"; @@ -29,6 +29,8 @@ pub const COSMOS_PATH: &str = "m/44'/118'/0'/0/0"; pub const EOS_PATH: &str = "m/44'/194'/0'/0/0"; pub const ETH_PATH: &str = "m/44'/60'/0'/0/0"; pub const FILECOIN_PATH: &str = "m/44'/461'/0/0/0"; +pub const POLKADOT_PATH: &str = "m/44'/354'/0'/0'/0'"; +pub const KUSAMA_PATH: &str = "m/44'/434'/0'/0'/0'"; pub const MAX_UTXO_NUMBER: usize = 252; pub const EACH_ROUND_NUMBER: usize = 5; diff --git a/device/src/app_delete.rs b/device/src/app_delete.rs index 363547c2..0730a6ee 100644 --- a/device/src/app_delete.rs +++ b/device/src/app_delete.rs @@ -87,7 +87,7 @@ mod test { assert!(hid_connect("imKey Pro").is_ok()); let seid = get_se_id().unwrap(); let device_cert = get_cert().unwrap(); - let instance_aid = "695F627463".to_string(); + let instance_aid = "695F656473725F646F74".to_string(); assert!( AppDeleteRequest::build_request_data(seid, instance_aid, device_cert) .send_message() diff --git a/device/src/app_download.rs b/device/src/app_download.rs index 80d7d6ff..60fa6219 100644 --- a/device/src/app_download.rs +++ b/device/src/app_download.rs @@ -94,7 +94,7 @@ mod test { assert!(hid_connect("imKey Pro").is_ok()); let seid = get_se_id().unwrap(); let device_cert = get_cert().unwrap(); - let instance_aid = "695F627463".to_string(); + let instance_aid = "695F656473725F646F74".to_string(); let exe_result = AppDownloadRequest::build_request_data(seid, instance_aid, device_cert, None) .send_message(); diff --git a/device/src/device_binding.rs b/device/src/device_binding.rs index 8d293c36..69940961 100644 --- a/device/src/device_binding.rs +++ b/device/src/device_binding.rs @@ -246,7 +246,7 @@ pub fn bind_test() { // pub const TEST_KEY_PATH: &str = "/tmp/"; // pub const TEST_BIND_CODE: &str = "MCYNK5AH"; pub const TEST_KEY_PATH: &str = "/Users/joe/work/sdk_gen_key"; -pub const TEST_BIND_CODE: &str = "YDSGQPKX"; +pub const TEST_BIND_CODE: &str = "u5qgen7u"; #[cfg(test)] mod test { diff --git a/proto/build.rs b/proto/build.rs index a4537341..c1b5a5b6 100644 --- a/proto/build.rs +++ b/proto/build.rs @@ -33,6 +33,10 @@ fn main() { // tcx-filecoin env::set_var("OUT_DIR", "../wallet/coin-filecoin/src"); prost_build::compile_protos(&["src/filecoin.proto"], &["src/"]).unwrap(); + + // subtrate + env::set_var("OUT_DIR", "../wallet/coin-substrate/src"); + prost_build::compile_protos(&["src/substrate.proto"], &["src/"]).unwrap(); } #[cfg(test)] diff --git a/proto/src/substrate.proto b/proto/src/substrate.proto new file mode 100644 index 00000000..902c7890 --- /dev/null +++ b/proto/src/substrate.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package substrateapi; + +message SubstrateRawTxIn { + string rawData = 1; +} + +message SubstrateTxOut { + string signature = 1; +} diff --git a/wallet/coin-substrate/Cargo.toml b/wallet/coin-substrate/Cargo.toml new file mode 100644 index 00000000..f8b99ab1 --- /dev/null +++ b/wallet/coin-substrate/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "coin-substrate" +version = "0.1.0" +authors = ["xiemener "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +common = {path = "../../common"} +device = {path = "../../device"} +transport = {path = "../../transport"} +failure = "0.1.6" +sp-core = "2.0.0-rc3" +hex = "0.3" +prost = "0.6.1" +prost-types = "0.6.1" \ No newline at end of file diff --git a/wallet/coin-substrate/src/address.rs b/wallet/coin-substrate/src/address.rs new file mode 100644 index 00000000..9a132e90 --- /dev/null +++ b/wallet/coin-substrate/src/address.rs @@ -0,0 +1,155 @@ +use crate::Result; +use common::apdu::{Apdu, ApduCheck, BtcApdu, CoinCommonApdu, Ed25519Apdu}; +use common::error::CoinError; +use common::path::check_path_validity; +use common::utility::{secp256k1_sign, secp256k1_sign_verify, uncompress_pubkey_2_compress}; +use device::device_binding::KEY_MANAGER; +use sp_core::crypto::{Ss58AddressFormat, Ss58Codec}; +use sp_core::ed25519::Public; +use sp_core::Public as TraitPublic; +use std::str::FromStr; +use transport::message::send_apdu; + +pub struct SubstrateAddress(); +impl SubstrateAddress { + pub fn from_public_key(public_key: &[u8], address_type: AddressType) -> Result { + let public_obj = Public::from_slice(public_key); + let address = match address_type { + AddressType::Polkadot => { + public_obj.to_ss58check_with_version(Ss58AddressFormat::PolkadotAccount) + } + AddressType::Kusama => { + public_obj.to_ss58check_with_version(Ss58AddressFormat::KusamaAccount) + } + _ => panic!("address type support"), + }; + + Ok(address) + } + pub fn get_address(path: &str, address_type: AddressType) -> Result { + // check_path_validity(path).expect("check path error"); + + let select_apdu = Apdu::select_applet("695F656473725F646F74"); + let select_response = send_apdu(select_apdu)?; + ApduCheck::check_response(&select_response)?; + + let key_manager_obj = KEY_MANAGER.lock().unwrap(); + let bind_signature = secp256k1_sign(&key_manager_obj.pri_key, path.as_bytes())?; + + let mut apdu_pack: Vec = vec![]; + apdu_pack.push(0x00); + apdu_pack.push(bind_signature.len() as u8); + apdu_pack.extend(bind_signature.as_slice()); + apdu_pack.push(0x01); + apdu_pack.push(path.as_bytes().len() as u8); + apdu_pack.extend(path.as_bytes()); + let path_hex = hex::encode(path.as_bytes()); + println!("{}", path_hex); + + //get public + let msg_pubkey = Ed25519Apdu::get_xpub(&apdu_pack); + let res_msg_pubkey = send_apdu(msg_pubkey)?; + ApduCheck::check_response(&res_msg_pubkey)?; + + let sign_source_val = &res_msg_pubkey[..64]; + let sign_result = &res_msg_pubkey[64..res_msg_pubkey.len() - 4]; + + //verify + let sign_verify_result = secp256k1_sign_verify( + &key_manager_obj.se_pub_key, + hex::decode(sign_result).unwrap().as_slice(), + hex::decode(sign_source_val).unwrap().as_slice(), + )?; + if !sign_verify_result { + return Err(CoinError::ImkeySignatureVerifyFail.into()); + } + // let comprs_pubkey = uncompress_pubkey_2_compress(&res_msg_pubkey[..res_msg_pubkey.len()-4]); + // let comprs_pubkey_bytes = hex::decode(&comprs_pubkey).expect("decode ckb pubkey error"); + let address = SubstrateAddress::from_public_key( + &hex::decode(sign_source_val).expect("invalid pubkey"), + address_type, + )?; + Ok(address) + } + + pub fn display_address(path: &str, address_type: AddressType) -> Result { + let address = SubstrateAddress::get_address(path, address_type)?; + let menu_name = match address_type { + AddressType::Polkadot => "Polkadot", + AddressType::Kusama => "Kusama", + _ => panic!("address type support"), + }; + let menu_name = "Polkadot".as_bytes(); + let reg_apdu = Ed25519Apdu::register_address(menu_name, address.as_bytes()); + let res_reg = send_apdu(reg_apdu)?; + ApduCheck::check_response(&res_reg)?; + Ok(address) + } +} + +/** +get xpub +*/ +pub fn get_pub_key(path: &str, verify_flag: bool) -> Result { + let select_response = send_apdu(BtcApdu::select_applet())?; + ApduCheck::check_response(&select_response)?; + let xpub_data = send_apdu(BtcApdu::get_xpub(path, verify_flag))?; + ApduCheck::check_response(&xpub_data)?; + Ok(xpub_data[..130].to_string()) +} + +#[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Clone, Hash)] +pub enum AddressType { + Polkadot, + Kusama, +} + +#[cfg(test)] +mod test { + use crate::address::{AddressType, SubstrateAddress}; + use common::constants::{KUSAMA_PATH, POLKADOT_PATH}; + use device::device_binding::bind_test; + use sp_core::crypto::Ss58AddressFormat; + use sp_core::crypto::Ss58Codec; + use sp_core::sr25519::{Pair, Public}; + use sp_core::Pair as TraitPair; + + #[test] + fn test_address_from_public() { + let pub_key = + hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") + .expect("hex decode error"); + let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Polkadot) + .expect("invalid public key"); + assert_eq!("12pWV6LvG4iAfNpFNTvvkWy3H9H8wtCkjiXupAzo2BCmPViM", address); + + let pub_key = + hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") + .expect("hex decode error"); + let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Kusama) + .expect("invalid public key"); + assert_eq!("EPq15Rj2eTcyVdBBXgyWKVta7Zj4FTo7beB3YHPwtPjxEkr", address); + } + + #[test] + fn test_get_address() { + bind_test(); + let address = SubstrateAddress::get_address(POLKADOT_PATH, AddressType::Polkadot) + .expect("get address error"); + assert_eq!("13uHFKh5zEGnfpoQ11eMRhNFX28vctXVnrYVPd5MC8EpYqec", address); + // let address = SubstrateAddress::get_address(KUSAMA_PATH, AddressType::Kusama) + // .expect("get address error"); + // assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); + } + + #[test] + fn test_display_address() { + bind_test(); + let address = SubstrateAddress::display_address(POLKADOT_PATH, AddressType::Polkadot) + .expect("get address error"); + assert_eq!("13uHFKh5zEGnfpoQ11eMRhNFX28vctXVnrYVPd5MC8EpYqec", address); + let address = SubstrateAddress::display_address(KUSAMA_PATH, AddressType::Kusama) + .expect("get address error"); + assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); + } +} diff --git a/wallet/coin-substrate/src/lib.rs b/wallet/coin-substrate/src/lib.rs new file mode 100644 index 00000000..1bbdfd36 --- /dev/null +++ b/wallet/coin-substrate/src/lib.rs @@ -0,0 +1,18 @@ +pub mod address; +pub mod substrateapi; +pub mod transaction; +use core::result; +pub type Result = result::Result; +#[macro_use] +extern crate failure; + +pub(crate) const SIGNATURE_TYPE_SR25519: u8 = 0x01; +pub(crate) const PAYLOAD_HASH_THRESHOLD: usize = 256; + +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(2 + 2, 4); + } +} diff --git a/wallet/coin-substrate/src/substrateapi.rs b/wallet/coin-substrate/src/substrateapi.rs new file mode 100644 index 00000000..0fd3fbd5 --- /dev/null +++ b/wallet/coin-substrate/src/substrateapi.rs @@ -0,0 +1,10 @@ +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SubstrateRawTxIn { + #[prost(string, tag = "1")] + pub raw_data: std::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SubstrateTxOut { + #[prost(string, tag = "1")] + pub signature: std::string::String, +} diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs new file mode 100644 index 00000000..cae2e12c --- /dev/null +++ b/wallet/coin-substrate/src/transaction.rs @@ -0,0 +1,62 @@ +use crate::substrateapi::{SubstrateRawTxIn, SubstrateTxOut}; +use crate::Result; +use crate::{PAYLOAD_HASH_THRESHOLD, SIGNATURE_TYPE_SR25519}; +use common::SignParam; +use sp_core::blake2_256; + +#[derive(Debug)] +pub struct Transaction {} + +impl Transaction { + pub fn hash_unsigned_payload(payload: &[u8]) -> Result> { + if payload.len() > PAYLOAD_HASH_THRESHOLD { + Ok(blake2_256(&payload).to_vec()) + } else { + Ok(payload.to_vec()) + } + } + + pub fn sign_transaction( + tx: &SubstrateRawTxIn, + sign_param: &SignParam, + ) -> Result { + let raw_data_bytes = if tx.raw_data.starts_with("0x") { + tx.raw_data[2..].to_string() + } else { + tx.raw_data.clone() + }; + let raw_data_bytes = hex::decode(&raw_data_bytes)?; + let hash = Transaction::hash_unsigned_payload(&raw_data_bytes)?; + + // let sig = sign_recoverable_hash(&hash, symbol, address, None)?; + + let sig_with_type = [vec![SIGNATURE_TYPE_SR25519], vec![SIGNATURE_TYPE_SR25519]].concat(); + + let tx_out = SubstrateTxOut { + signature: format!("0x{}", hex::encode(sig_with_type)), + }; + Ok(tx_out) + } +} + +#[cfg(test)] +mod test { + + #[test] + fn test_sign_transaction() { + // let message: &[u8] = b"616263"; + // let pub_key = + // hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") + // .expect("hex decode error"); + // let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Polkadot) + // .expect("invalid public key"); + // assert_eq!("12pWV6LvG4iAfNpFNTvvkWy3H9H8wtCkjiXupAzo2BCmPViM", address); + // + // let pub_key = + // hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") + // .expect("hex decode error"); + // let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Kusama) + // .expect("invalid public key"); + // assert_eq!("EPq15Rj2eTcyVdBBXgyWKVta7Zj4FTo7beB3YHPwtPjxEkr", address); + } +} From 3b6385857afdbd3a3f022e2a580d3e8fd824fd7d Mon Sep 17 00:00:00 2001 From: xiemener Date: Tue, 8 Dec 2020 01:54:17 +0800 Subject: [PATCH 02/10] add transaction test --- wallet/coin-substrate/src/address.rs | 18 ++--- wallet/coin-substrate/src/lib.rs | 1 + wallet/coin-substrate/src/transaction.rs | 99 +++++++++++++++++++----- 3 files changed, 88 insertions(+), 30 deletions(-) diff --git a/wallet/coin-substrate/src/address.rs b/wallet/coin-substrate/src/address.rs index 9a132e90..73b6437c 100644 --- a/wallet/coin-substrate/src/address.rs +++ b/wallet/coin-substrate/src/address.rs @@ -43,30 +43,28 @@ impl SubstrateAddress { apdu_pack.push(0x01); apdu_pack.push(path.as_bytes().len() as u8); apdu_pack.extend(path.as_bytes()); - let path_hex = hex::encode(path.as_bytes()); - println!("{}", path_hex); //get public let msg_pubkey = Ed25519Apdu::get_xpub(&apdu_pack); let res_msg_pubkey = send_apdu(msg_pubkey)?; ApduCheck::check_response(&res_msg_pubkey)?; - let sign_source_val = &res_msg_pubkey[..64]; + let pubkey = &res_msg_pubkey[..64]; let sign_result = &res_msg_pubkey[64..res_msg_pubkey.len() - 4]; + println!("pubkey: {}",pubkey); + //verify let sign_verify_result = secp256k1_sign_verify( &key_manager_obj.se_pub_key, hex::decode(sign_result).unwrap().as_slice(), - hex::decode(sign_source_val).unwrap().as_slice(), + hex::decode(pubkey).unwrap().as_slice(), )?; if !sign_verify_result { return Err(CoinError::ImkeySignatureVerifyFail.into()); } - // let comprs_pubkey = uncompress_pubkey_2_compress(&res_msg_pubkey[..res_msg_pubkey.len()-4]); - // let comprs_pubkey_bytes = hex::decode(&comprs_pubkey).expect("decode ckb pubkey error"); let address = SubstrateAddress::from_public_key( - &hex::decode(sign_source_val).expect("invalid pubkey"), + &hex::decode(pubkey).expect("invalid pubkey"), address_type, )?; Ok(address) @@ -117,7 +115,7 @@ mod test { #[test] fn test_address_from_public() { let pub_key = - hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") + hex::decode("EDB9955556C8E07287DF95AD77FAD826168F8A50488CCE0D738DF3769E24613A") .expect("hex decode error"); let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Polkadot) .expect("invalid public key"); @@ -136,7 +134,7 @@ mod test { bind_test(); let address = SubstrateAddress::get_address(POLKADOT_PATH, AddressType::Polkadot) .expect("get address error"); - assert_eq!("13uHFKh5zEGnfpoQ11eMRhNFX28vctXVnrYVPd5MC8EpYqec", address); + assert_eq!("147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT", address); // let address = SubstrateAddress::get_address(KUSAMA_PATH, AddressType::Kusama) // .expect("get address error"); // assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); @@ -147,7 +145,7 @@ mod test { bind_test(); let address = SubstrateAddress::display_address(POLKADOT_PATH, AddressType::Polkadot) .expect("get address error"); - assert_eq!("13uHFKh5zEGnfpoQ11eMRhNFX28vctXVnrYVPd5MC8EpYqec", address); + assert_eq!("147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT", address); let address = SubstrateAddress::display_address(KUSAMA_PATH, AddressType::Kusama) .expect("get address error"); assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); diff --git a/wallet/coin-substrate/src/lib.rs b/wallet/coin-substrate/src/lib.rs index 1bbdfd36..29de5b63 100644 --- a/wallet/coin-substrate/src/lib.rs +++ b/wallet/coin-substrate/src/lib.rs @@ -6,6 +6,7 @@ pub type Result = result::Result; #[macro_use] extern crate failure; +pub(crate) const SIGNATURE_TYPE_ED25519: u8 = 0x00; pub(crate) const SIGNATURE_TYPE_SR25519: u8 = 0x01; pub(crate) const PAYLOAD_HASH_THRESHOLD: usize = 256; diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs index cae2e12c..4862df20 100644 --- a/wallet/coin-substrate/src/transaction.rs +++ b/wallet/coin-substrate/src/transaction.rs @@ -1,8 +1,12 @@ use crate::substrateapi::{SubstrateRawTxIn, SubstrateTxOut}; -use crate::Result; -use crate::{PAYLOAD_HASH_THRESHOLD, SIGNATURE_TYPE_SR25519}; -use common::SignParam; +use crate::{Result, SIGNATURE_TYPE_ED25519,PAYLOAD_HASH_THRESHOLD}; +use common::{SignParam, constants, utility}; use sp_core::blake2_256; +use common::apdu::{Ed25519Apdu, ApduCheck}; +use transport::message::send_apdu_timeout; +use common::utility::secp256k1_sign; +use common::error::CoinError; +use device::device_binding::KEY_MANAGER; #[derive(Debug)] pub struct Transaction {} @@ -28,12 +32,60 @@ impl Transaction { let raw_data_bytes = hex::decode(&raw_data_bytes)?; let hash = Transaction::hash_unsigned_payload(&raw_data_bytes)?; - // let sig = sign_recoverable_hash(&hash, symbol, address, None)?; + //organize data + let mut data_pack: Vec = Vec::new(); - let sig_with_type = [vec![SIGNATURE_TYPE_SR25519], vec![SIGNATURE_TYPE_SR25519]].concat(); + data_pack.extend([1, hash.len() as u8].iter()); + data_pack.extend(hash.iter()); + + //path + data_pack.extend([2, sign_param.path.as_bytes().len() as u8].iter()); + data_pack.extend(sign_param.path.as_bytes().iter()); + //payment info in TLV format + data_pack.extend([7, sign_param.payment.as_bytes().len() as u8].iter()); + data_pack.extend(sign_param.payment.as_bytes().iter()); + //receiver info in TLV format + data_pack.extend([8, sign_param.receiver.as_bytes().len() as u8].iter()); + data_pack.extend(sign_param.receiver.as_bytes().iter()); + //fee info in TLV format + data_pack.extend([9, sign_param.fee.as_bytes().len() as u8].iter()); + data_pack.extend(sign_param.fee.as_bytes().iter()); + + let key_manager_obj = KEY_MANAGER.lock().unwrap(); + let bind_signature = secp256k1_sign(&key_manager_obj.pri_key, &data_pack).unwrap(); + + let mut apdu_pack: Vec = Vec::new(); + apdu_pack.push(0x00); + apdu_pack.push(bind_signature.len() as u8); + apdu_pack.extend(bind_signature.as_slice()); + apdu_pack.extend(data_pack.as_slice()); + + //sign + let mut sign_response = "".to_string(); + let sign_apdus = Ed25519Apdu::sign(&apdu_pack); + for apdu in sign_apdus { + sign_response = send_apdu_timeout(apdu, constants::TIMEOUT_LONG)?; + ApduCheck::check_response(&sign_response)?; + } + + // verify + let sign_source_val = &sign_response[..132]; + let sign_result = &sign_response[132..sign_response.len() - 4]; + let sign_verify_result = utility::secp256k1_sign_verify( + &key_manager_obj.se_pub_key, + hex::decode(sign_result).unwrap().as_slice(), + hex::decode(sign_source_val).unwrap().as_slice(), + )?; + + if !sign_verify_result { + return Err(CoinError::ImkeySignatureVerifyFail.into()); + } + + let sig = hex::decode(&sign_response[2..130])?; + let sig_with_type = [vec![SIGNATURE_TYPE_ED25519], sig.to_vec()].concat(); let tx_out = SubstrateTxOut { - signature: format!("0x{}", hex::encode(sig_with_type)), + signature: format!("0x{}", hex::encode(&sig_with_type)), }; Ok(tx_out) } @@ -41,22 +93,29 @@ impl Transaction { #[cfg(test)] mod test { + use common::SignParam; + use common::constants::POLKADOT_PATH; + use crate::transaction::Transaction; + use crate::substrateapi::SubstrateRawTxIn; #[test] fn test_sign_transaction() { - // let message: &[u8] = b"616263"; - // let pub_key = - // hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") - // .expect("hex decode error"); - // let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Polkadot) - // .expect("invalid public key"); - // assert_eq!("12pWV6LvG4iAfNpFNTvvkWy3H9H8wtCkjiXupAzo2BCmPViM", address); - // - // let pub_key = - // hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") - // .expect("hex decode error"); - // let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Kusama) - // .expect("invalid public key"); - // assert_eq!("EPq15Rj2eTcyVdBBXgyWKVta7Zj4FTo7beB3YHPwtPjxEkr", address); + let sign_param = SignParam { + chain_type: "POLKADOT".to_string(), + path: POLKADOT_PATH.to_string(), + network: "".to_string(), + input: None, + payment: "25 DOT".to_string(), + receiver: "12pWV6LvG4iAfNpFNTvvkWy3H9H8wtCkjiXupAzo2BCmPViM".to_string(), + sender: "147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT".to_string(), + fee: "15.4000 milli DOT".to_string(), + }; + + let input = SubstrateRawTxIn{ + raw_data: "0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() + }; + let ret = Transaction::sign_transaction(&input,&sign_param).expect("sign error"); + + assert_eq!("sig",ret.signature); } } From e988cb2853e8c51188b274b12448e835897a2211 Mon Sep 17 00:00:00 2001 From: xiemener Date: Tue, 8 Dec 2020 09:13:11 +0800 Subject: [PATCH 03/10] fix select applet error --- common/src/constants.rs | 1 + wallet/coin-substrate/src/transaction.rs | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/src/constants.rs b/common/src/constants.rs index 983b9ac7..2d32838d 100644 --- a/common/src/constants.rs +++ b/common/src/constants.rs @@ -21,6 +21,7 @@ pub const BTC_AID: &str = "695F627463"; pub const COSMOS_AID: &str = "695F636F736D6F73"; pub const FILECOIN_AID: &str = "695F6B315F66696C"; pub const IMK_AID: &str = "695F696D6B"; +pub const POLKADOT_AID: &str = "695F656473725F646F74"; pub const BL_AID: &str = "D0426F6F746C6F61646572"; diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs index 4862df20..9d472652 100644 --- a/wallet/coin-substrate/src/transaction.rs +++ b/wallet/coin-substrate/src/transaction.rs @@ -2,11 +2,12 @@ use crate::substrateapi::{SubstrateRawTxIn, SubstrateTxOut}; use crate::{Result, SIGNATURE_TYPE_ED25519,PAYLOAD_HASH_THRESHOLD}; use common::{SignParam, constants, utility}; use sp_core::blake2_256; -use common::apdu::{Ed25519Apdu, ApduCheck}; -use transport::message::send_apdu_timeout; +use common::apdu::{Ed25519Apdu, ApduCheck, Apdu}; +use transport::message::{send_apdu_timeout, send_apdu}; use common::utility::secp256k1_sign; use common::error::CoinError; use device::device_binding::KEY_MANAGER; +use common::constants::POLKADOT_AID; #[derive(Debug)] pub struct Transaction {} @@ -24,6 +25,10 @@ impl Transaction { tx: &SubstrateRawTxIn, sign_param: &SignParam, ) -> Result { + let select_apdu = Apdu::select_applet(POLKADOT_AID); + let select_result = send_apdu(select_apdu)?; + ApduCheck::check_response(&select_result)?; + let raw_data_bytes = if tx.raw_data.starts_with("0x") { tx.raw_data[2..].to_string() } else { @@ -97,9 +102,11 @@ mod test { use common::constants::POLKADOT_PATH; use crate::transaction::Transaction; use crate::substrateapi::SubstrateRawTxIn; + use device::device_binding::bind_test; #[test] fn test_sign_transaction() { + bind_test(); let sign_param = SignParam { chain_type: "POLKADOT".to_string(), path: POLKADOT_PATH.to_string(), From f3647ea552ed366493b0dd203564ede8cca4b7a4 Mon Sep 17 00:00:00 2001 From: xiemener Date: Tue, 8 Dec 2020 15:01:56 +0800 Subject: [PATCH 04/10] fix sig verify error --- wallet/coin-substrate/src/address.rs | 8 +++---- wallet/coin-substrate/src/transaction.rs | 28 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/wallet/coin-substrate/src/address.rs b/wallet/coin-substrate/src/address.rs index 73b6437c..28486701 100644 --- a/wallet/coin-substrate/src/address.rs +++ b/wallet/coin-substrate/src/address.rs @@ -52,7 +52,7 @@ impl SubstrateAddress { let pubkey = &res_msg_pubkey[..64]; let sign_result = &res_msg_pubkey[64..res_msg_pubkey.len() - 4]; - println!("pubkey: {}",pubkey); + println!("pubkey: {}", pubkey); //verify let sign_verify_result = secp256k1_sign_verify( @@ -135,9 +135,9 @@ mod test { let address = SubstrateAddress::get_address(POLKADOT_PATH, AddressType::Polkadot) .expect("get address error"); assert_eq!("147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT", address); - // let address = SubstrateAddress::get_address(KUSAMA_PATH, AddressType::Kusama) - // .expect("get address error"); - // assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); + let address = SubstrateAddress::get_address(KUSAMA_PATH, AddressType::Kusama) + .expect("get address error"); + assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); } #[test] diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs index 9d472652..9a487bd4 100644 --- a/wallet/coin-substrate/src/transaction.rs +++ b/wallet/coin-substrate/src/transaction.rs @@ -1,13 +1,13 @@ use crate::substrateapi::{SubstrateRawTxIn, SubstrateTxOut}; -use crate::{Result, SIGNATURE_TYPE_ED25519,PAYLOAD_HASH_THRESHOLD}; -use common::{SignParam, constants, utility}; -use sp_core::blake2_256; -use common::apdu::{Ed25519Apdu, ApduCheck, Apdu}; -use transport::message::{send_apdu_timeout, send_apdu}; -use common::utility::secp256k1_sign; +use crate::{Result, PAYLOAD_HASH_THRESHOLD, SIGNATURE_TYPE_ED25519}; +use common::apdu::{Apdu, ApduCheck, Ed25519Apdu}; +use common::constants::POLKADOT_AID; use common::error::CoinError; +use common::utility::secp256k1_sign; +use common::{constants, utility, SignParam}; use device::device_binding::KEY_MANAGER; -use common::constants::POLKADOT_AID; +use sp_core::blake2_256; +use transport::message::{send_apdu, send_apdu_timeout}; #[derive(Debug)] pub struct Transaction {} @@ -74,8 +74,8 @@ impl Transaction { } // verify - let sign_source_val = &sign_response[..132]; - let sign_result = &sign_response[132..sign_response.len() - 4]; + let sign_source_val = &sign_response[..130]; + let sign_result = &sign_response[130..sign_response.len() - 4]; let sign_verify_result = utility::secp256k1_sign_verify( &key_manager_obj.se_pub_key, hex::decode(sign_result).unwrap().as_slice(), @@ -98,10 +98,10 @@ impl Transaction { #[cfg(test)] mod test { - use common::SignParam; - use common::constants::POLKADOT_PATH; - use crate::transaction::Transaction; use crate::substrateapi::SubstrateRawTxIn; + use crate::transaction::Transaction; + use common::constants::POLKADOT_PATH; + use common::SignParam; use device::device_binding::bind_test; #[test] @@ -121,8 +121,8 @@ mod test { let input = SubstrateRawTxIn{ raw_data: "0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() }; - let ret = Transaction::sign_transaction(&input,&sign_param).expect("sign error"); + let ret = Transaction::sign_transaction(&input, &sign_param).expect("sign error"); - assert_eq!("sig",ret.signature); + assert_eq!("sig", ret.signature); } } From c220f87434fe4c46c78b69247147c77e462600b1 Mon Sep 17 00:00:00 2001 From: xiemener Date: Tue, 8 Dec 2020 18:00:53 +0800 Subject: [PATCH 05/10] fix sign tx unit test --- wallet/coin-substrate/Cargo.toml | 1 + wallet/coin-substrate/src/address.rs | 15 +++++++++++---- wallet/coin-substrate/src/transaction.rs | 19 +++++++++++++++---- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/wallet/coin-substrate/Cargo.toml b/wallet/coin-substrate/Cargo.toml index f8b99ab1..8e97081f 100644 --- a/wallet/coin-substrate/Cargo.toml +++ b/wallet/coin-substrate/Cargo.toml @@ -12,6 +12,7 @@ device = {path = "../../device"} transport = {path = "../../transport"} failure = "0.1.6" sp-core = "2.0.0-rc3" +sp-runtime = "2.0.0-rc3" hex = "0.3" prost = "0.6.1" prost-types = "0.6.1" \ No newline at end of file diff --git a/wallet/coin-substrate/src/address.rs b/wallet/coin-substrate/src/address.rs index 28486701..a418fce5 100644 --- a/wallet/coin-substrate/src/address.rs +++ b/wallet/coin-substrate/src/address.rs @@ -26,8 +26,9 @@ impl SubstrateAddress { Ok(address) } - pub fn get_address(path: &str, address_type: AddressType) -> Result { - // check_path_validity(path).expect("check path error"); + + pub fn get_public_key(path: &str) -> Result{ + check_path_validity(path).expect("check path error"); let select_apdu = Apdu::select_applet("695F656473725F646F74"); let select_response = send_apdu(select_apdu)?; @@ -63,8 +64,14 @@ impl SubstrateAddress { if !sign_verify_result { return Err(CoinError::ImkeySignatureVerifyFail.into()); } + + Ok(pubkey.to_string()) + } + + pub fn get_address(path: &str, address_type: AddressType) -> Result { + let public_key = SubstrateAddress::get_public_key(path)?; let address = SubstrateAddress::from_public_key( - &hex::decode(pubkey).expect("invalid pubkey"), + &hex::decode(&public_key)?, address_type, )?; Ok(address) @@ -134,7 +141,7 @@ mod test { bind_test(); let address = SubstrateAddress::get_address(POLKADOT_PATH, AddressType::Polkadot) .expect("get address error"); - assert_eq!("147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT", address); + assert_eq!("16NhUkUTkYsYRjMD22Sop2DF8MAXUsjPcYtgHF3t1ccmohx1", address); let address = SubstrateAddress::get_address(KUSAMA_PATH, AddressType::Kusama) .expect("get address error"); assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs index 9a487bd4..b8af1440 100644 --- a/wallet/coin-substrate/src/transaction.rs +++ b/wallet/coin-substrate/src/transaction.rs @@ -103,6 +103,10 @@ mod test { use common::constants::POLKADOT_PATH; use common::SignParam; use device::device_binding::bind_test; + use crate::address::SubstrateAddress; + use sp_core::crypto::Ss58Codec; + use sp_runtime::traits::Verify; + use sp_core::Public; #[test] fn test_sign_transaction() { @@ -119,10 +123,17 @@ mod test { }; let input = SubstrateRawTxIn{ - raw_data: "0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() + raw_data: "0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() }; - let ret = Transaction::sign_transaction(&input, &sign_param).expect("sign error"); - - assert_eq!("sig", ret.signature); + let ret = Transaction::sign_transaction(&input, &sign_param).expect("sign transaction error"); + + let public_key = SubstrateAddress::get_public_key(POLKADOT_PATH).expect("get pub key error"); + let msg = hex::decode(input.raw_data).unwrap(); + let pk = sp_core::ed25519::Public::from_slice(&hex::decode(public_key).unwrap()); + let sig = sp_core::ed25519::Signature::from_slice(&hex::decode(&ret.signature[4..]).unwrap()); + assert!( + sp_core::ed25519::Signature::verify(&sig, msg.as_slice(), &pk), + "assert sig" + ); } } From d80785e651b935879250168a4b51b28f126844c1 Mon Sep 17 00:00:00 2001 From: xiemener Date: Tue, 8 Dec 2020 19:27:21 +0800 Subject: [PATCH 06/10] support kusama --- common/src/constants.rs | 1 + device/src/app_download.rs | 2 +- wallet/coin-substrate/src/address.rs | 61 ++++++++++-------------- wallet/coin-substrate/src/transaction.rs | 60 +++++++++++++++++++---- 4 files changed, 80 insertions(+), 44 deletions(-) diff --git a/common/src/constants.rs b/common/src/constants.rs index 2d32838d..ae5126b3 100644 --- a/common/src/constants.rs +++ b/common/src/constants.rs @@ -22,6 +22,7 @@ pub const COSMOS_AID: &str = "695F636F736D6F73"; pub const FILECOIN_AID: &str = "695F6B315F66696C"; pub const IMK_AID: &str = "695F696D6B"; pub const POLKADOT_AID: &str = "695F656473725F646F74"; +pub const KUSAMA_AID: &str = "695F656473725F6B736D"; pub const BL_AID: &str = "D0426F6F746C6F61646572"; diff --git a/device/src/app_download.rs b/device/src/app_download.rs index 60fa6219..a42a0845 100644 --- a/device/src/app_download.rs +++ b/device/src/app_download.rs @@ -94,7 +94,7 @@ mod test { assert!(hid_connect("imKey Pro").is_ok()); let seid = get_se_id().unwrap(); let device_cert = get_cert().unwrap(); - let instance_aid = "695F656473725F646F74".to_string(); + let instance_aid = "695F656473725F6B736D".to_string(); let exe_result = AppDownloadRequest::build_request_data(seid, instance_aid, device_cert, None) .send_message(); diff --git a/wallet/coin-substrate/src/address.rs b/wallet/coin-substrate/src/address.rs index a418fce5..282549d4 100644 --- a/wallet/coin-substrate/src/address.rs +++ b/wallet/coin-substrate/src/address.rs @@ -1,5 +1,6 @@ use crate::Result; use common::apdu::{Apdu, ApduCheck, BtcApdu, CoinCommonApdu, Ed25519Apdu}; +use common::constants::{KUSAMA_AID, POLKADOT_AID}; use common::error::CoinError; use common::path::check_path_validity; use common::utility::{secp256k1_sign, secp256k1_sign_verify, uncompress_pubkey_2_compress}; @@ -12,7 +13,7 @@ use transport::message::send_apdu; pub struct SubstrateAddress(); impl SubstrateAddress { - pub fn from_public_key(public_key: &[u8], address_type: AddressType) -> Result { + pub fn from_public_key(public_key: &[u8], address_type: &AddressType) -> Result { let public_obj = Public::from_slice(public_key); let address = match address_type { AddressType::Polkadot => { @@ -21,16 +22,21 @@ impl SubstrateAddress { AddressType::Kusama => { public_obj.to_ss58check_with_version(Ss58AddressFormat::KusamaAccount) } - _ => panic!("address type support"), + _ => panic!("address type not support"), }; Ok(address) } - pub fn get_public_key(path: &str) -> Result{ + pub fn get_public_key(path: &str, address_type: &AddressType) -> Result { check_path_validity(path).expect("check path error"); - let select_apdu = Apdu::select_applet("695F656473725F646F74"); + let aid = match address_type { + AddressType::Polkadot => POLKADOT_AID, + AddressType::Kusama => KUSAMA_AID, + _ => panic!("address type not support"), + }; + let select_apdu = Apdu::select_applet(aid); let select_response = send_apdu(select_apdu)?; ApduCheck::check_response(&select_response)?; @@ -68,41 +74,26 @@ impl SubstrateAddress { Ok(pubkey.to_string()) } - pub fn get_address(path: &str, address_type: AddressType) -> Result { - let public_key = SubstrateAddress::get_public_key(path)?; - let address = SubstrateAddress::from_public_key( - &hex::decode(&public_key)?, - address_type, - )?; + pub fn get_address(path: &str, address_type: &AddressType) -> Result { + let public_key = SubstrateAddress::get_public_key(path, address_type)?; + let address = SubstrateAddress::from_public_key(&hex::decode(&public_key)?, address_type)?; Ok(address) } - pub fn display_address(path: &str, address_type: AddressType) -> Result { + pub fn display_address(path: &str, address_type: &AddressType) -> Result { let address = SubstrateAddress::get_address(path, address_type)?; let menu_name = match address_type { AddressType::Polkadot => "Polkadot", AddressType::Kusama => "Kusama", - _ => panic!("address type support"), + _ => panic!("address type not support"), }; - let menu_name = "Polkadot".as_bytes(); - let reg_apdu = Ed25519Apdu::register_address(menu_name, address.as_bytes()); + let reg_apdu = Ed25519Apdu::register_address(menu_name.as_bytes(), address.as_bytes()); let res_reg = send_apdu(reg_apdu)?; ApduCheck::check_response(&res_reg)?; Ok(address) } } -/** -get xpub -*/ -pub fn get_pub_key(path: &str, verify_flag: bool) -> Result { - let select_response = send_apdu(BtcApdu::select_applet())?; - ApduCheck::check_response(&select_response)?; - let xpub_data = send_apdu(BtcApdu::get_xpub(path, verify_flag))?; - ApduCheck::check_response(&xpub_data)?; - Ok(xpub_data[..130].to_string()) -} - #[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Clone, Hash)] pub enum AddressType { Polkadot, @@ -124,14 +115,14 @@ mod test { let pub_key = hex::decode("EDB9955556C8E07287DF95AD77FAD826168F8A50488CCE0D738DF3769E24613A") .expect("hex decode error"); - let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Polkadot) + let address = SubstrateAddress::from_public_key(&pub_key, &AddressType::Polkadot) .expect("invalid public key"); - assert_eq!("12pWV6LvG4iAfNpFNTvvkWy3H9H8wtCkjiXupAzo2BCmPViM", address); + assert_eq!("16NhUkUTkYsYRjMD22Sop2DF8MAXUsjPcYtgHF3t1ccmohx1", address); let pub_key = hex::decode("50780547322a1ceba67ea8c552c9bc6c686f8698ac9a8cafab7cd15a1db19859") .expect("hex decode error"); - let address = SubstrateAddress::from_public_key(&pub_key, AddressType::Kusama) + let address = SubstrateAddress::from_public_key(&pub_key, &AddressType::Kusama) .expect("invalid public key"); assert_eq!("EPq15Rj2eTcyVdBBXgyWKVta7Zj4FTo7beB3YHPwtPjxEkr", address); } @@ -139,22 +130,22 @@ mod test { #[test] fn test_get_address() { bind_test(); - let address = SubstrateAddress::get_address(POLKADOT_PATH, AddressType::Polkadot) + let address = SubstrateAddress::get_address(POLKADOT_PATH, &AddressType::Polkadot) .expect("get address error"); assert_eq!("16NhUkUTkYsYRjMD22Sop2DF8MAXUsjPcYtgHF3t1ccmohx1", address); - let address = SubstrateAddress::get_address(KUSAMA_PATH, AddressType::Kusama) + let address = SubstrateAddress::get_address(KUSAMA_PATH, &AddressType::Kusama) .expect("get address error"); - assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); + assert_eq!("Fde6T2hDvbvuQrRizcjPoQNZTxuVSbTp78zwFcxzUb86xXS", address); } #[test] fn test_display_address() { bind_test(); - let address = SubstrateAddress::display_address(POLKADOT_PATH, AddressType::Polkadot) + let address = SubstrateAddress::display_address(POLKADOT_PATH, &AddressType::Polkadot) .expect("get address error"); - assert_eq!("147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT", address); - let address = SubstrateAddress::display_address(KUSAMA_PATH, AddressType::Kusama) + assert_eq!("16NhUkUTkYsYRjMD22Sop2DF8MAXUsjPcYtgHF3t1ccmohx1", address); + let address = SubstrateAddress::display_address(KUSAMA_PATH, &AddressType::Kusama) .expect("get address error"); - assert_eq!("DXQbtNdVTDL5CDFW4DoGL8v14A5zaGWukRdQsY1xT1vCJgH", address); + assert_eq!("Fde6T2hDvbvuQrRizcjPoQNZTxuVSbTp78zwFcxzUb86xXS", address); } } diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs index b8af1440..2835d7c5 100644 --- a/wallet/coin-substrate/src/transaction.rs +++ b/wallet/coin-substrate/src/transaction.rs @@ -1,8 +1,10 @@ +use crate::address::AddressType; use crate::substrateapi::{SubstrateRawTxIn, SubstrateTxOut}; use crate::{Result, PAYLOAD_HASH_THRESHOLD, SIGNATURE_TYPE_ED25519}; use common::apdu::{Apdu, ApduCheck, Ed25519Apdu}; -use common::constants::POLKADOT_AID; +use common::constants::{KUSAMA_AID, POLKADOT_AID}; use common::error::CoinError; +use common::path::check_path_validity; use common::utility::secp256k1_sign; use common::{constants, utility, SignParam}; use device::device_binding::KEY_MANAGER; @@ -25,7 +27,14 @@ impl Transaction { tx: &SubstrateRawTxIn, sign_param: &SignParam, ) -> Result { - let select_apdu = Apdu::select_applet(POLKADOT_AID); + check_path_validity(&sign_param.path).expect("check path error"); + + let aid = match sign_param.chain_type.as_str() { + "POLKADOT" => POLKADOT_AID, + "KUSAMA" => KUSAMA_AID, + _ => panic!("chain type not support"), + }; + let select_apdu = Apdu::select_applet(aid); let select_result = send_apdu(select_apdu)?; ApduCheck::check_response(&select_result)?; @@ -98,15 +107,15 @@ impl Transaction { #[cfg(test)] mod test { + use crate::address::{AddressType, SubstrateAddress}; use crate::substrateapi::SubstrateRawTxIn; use crate::transaction::Transaction; - use common::constants::POLKADOT_PATH; + use common::constants::{KUSAMA_PATH, POLKADOT_PATH}; use common::SignParam; use device::device_binding::bind_test; - use crate::address::SubstrateAddress; use sp_core::crypto::Ss58Codec; - use sp_runtime::traits::Verify; use sp_core::Public; + use sp_runtime::traits::Verify; #[test] fn test_sign_transaction() { @@ -125,12 +134,47 @@ mod test { let input = SubstrateRawTxIn{ raw_data: "0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() }; - let ret = Transaction::sign_transaction(&input, &sign_param).expect("sign transaction error"); + let ret = + Transaction::sign_transaction(&input, &sign_param).expect("sign transaction error"); + + let public_key = SubstrateAddress::get_public_key(POLKADOT_PATH, &AddressType::Polkadot) + .expect("get pub key error"); + let msg = hex::decode(input.raw_data).unwrap(); + let pk = sp_core::ed25519::Public::from_slice(&hex::decode(public_key).unwrap()); + let sig = + sp_core::ed25519::Signature::from_slice(&hex::decode(&ret.signature[4..]).unwrap()); + assert!( + sp_core::ed25519::Signature::verify(&sig, msg.as_slice(), &pk), + "assert sig" + ); + } + + #[test] + fn test_sign_kusama() { + bind_test(); + let sign_param = SignParam { + chain_type: "KUSAMA".to_string(), + path: KUSAMA_PATH.to_string(), + network: "".to_string(), + input: None, + payment: "25 DOT".to_string(), + receiver: "12pWV6LvG4iAfNpFNTvvkWy3H9H8wtCkjiXupAzo2BCmPViM".to_string(), + sender: "147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT".to_string(), + fee: "15.4000 milli DOT".to_string(), + }; + + let input = SubstrateRawTxIn{ + raw_data: "0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() + }; + let ret = + Transaction::sign_transaction(&input, &sign_param).expect("sign transaction error"); - let public_key = SubstrateAddress::get_public_key(POLKADOT_PATH).expect("get pub key error"); + let public_key = SubstrateAddress::get_public_key(KUSAMA_PATH, &AddressType::Kusama) + .expect("get pub key error"); let msg = hex::decode(input.raw_data).unwrap(); let pk = sp_core::ed25519::Public::from_slice(&hex::decode(public_key).unwrap()); - let sig = sp_core::ed25519::Signature::from_slice(&hex::decode(&ret.signature[4..]).unwrap()); + let sig = + sp_core::ed25519::Signature::from_slice(&hex::decode(&ret.signature[4..]).unwrap()); assert!( sp_core::ed25519::Signature::verify(&sig, msg.as_slice(), &pk), "assert sig" From 3220882271637907af1ee3d7868ac75a92dce797 Mon Sep 17 00:00:00 2001 From: xiemener Date: Wed, 9 Dec 2020 09:53:12 +0800 Subject: [PATCH 07/10] add substrate api --- api/Cargo.toml | 1 + api/src/lib.rs | 14 ++++++++++++++ api/src/substrate_address.rs | 27 +++++++++++++++++++++++++++ api/src/substrate_signer.rs | 12 ++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 api/src/substrate_address.rs create mode 100644 api/src/substrate_signer.rs diff --git a/api/Cargo.toml b/api/Cargo.toml index e939e45e..70ab7c79 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -17,6 +17,7 @@ coin-bitcoin = {path = "../wallet/coin-bitcoin"} coin-eos = {path = "../wallet/coin-eos"} coin-cosmos = {path = "../wallet/coin-cosmos"} coin-filecoin = {path = "../wallet/coin-filecoin"} +coin-substrate = {path = "../wallet/coin-substrate"} common = {path = "../common"} bitcoin = "0.25.0" ethereum-types = "0.6.0" diff --git a/api/src/lib.rs b/api/src/lib.rs index 43866ce1..94afa198 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -16,6 +16,8 @@ pub mod ethereum_address; pub mod ethereum_signer; pub mod filecoin_address; pub mod filecoin_signer; +pub mod substrate_address; +pub mod substrate_signer; pub mod message_handler; use std::sync::Mutex; @@ -119,6 +121,8 @@ pub unsafe extern "C" fn call_imkey_api(hex_str: *const c_char) -> *const c_char "ETHEREUM" => ethereum_address::get_address(¶m), "COSMOS" => cosmos_address::get_address(¶m), "FILECOIN" => filecoin_address::get_address(¶m), + "POLKADOT" => substrate_address::get_address(¶m), + "KUSAMA" => substrate_address::get_address(¶m), _ => Err(format_err!("get_address unsupported_chain")), } }), @@ -149,6 +153,8 @@ pub unsafe extern "C" fn call_imkey_api(hex_str: *const c_char) -> *const c_char "ETHEREUM" => ethereum_address::register_address(¶m), "COSMOS" => cosmos_address::display_cosmos_address(¶m), "FILECOIN" => filecoin_address::display_filecoin_address(¶m), + "POLKADOT" => substrate_address::display_address(¶m), + "KUSAMA" => substrate_address::display_address(¶m), _ => Err(format_err!("register_address unsupported_chain")), } }), @@ -175,6 +181,14 @@ pub unsafe extern "C" fn call_imkey_api(hex_str: *const c_char) -> *const c_char ¶m.clone().input.unwrap().value, ¶m, ), + "POLKADOT" => substrate_signer::sign_transaction( + ¶m.clone().input.unwrap().value, + ¶m, + ), + "KUSAMA" => substrate_signer::sign_transaction( + ¶m.clone().input.unwrap().value, + ¶m, + ), _ => Err(format_err!("sign_tx unsupported_chain")), } }), diff --git a/api/src/substrate_address.rs b/api/src/substrate_address.rs new file mode 100644 index 00000000..cf7c167a --- /dev/null +++ b/api/src/substrate_address.rs @@ -0,0 +1,27 @@ +use crate::api::{AddressParam, AddressResult}; +use crate::error_handling::Result; +use crate::message_handler::encode_message; +use coin_substrate::address::SubstrateAddress; +use prost::Message; + +pub fn get_address(param: &AddressParam) -> Result> { + let address = SubstrateAddress::get_address(param.path.as_ref(), param.chain_type.as_ref())?; + + let address_message = AddressResult { + path: param.path.to_owned(), + chain_type: param.chain_type.to_string(), + address, + }; + encode_message(address_message) +} + +pub fn display_address(param: &AddressParam) -> Result> { + let address = SubstrateAddress::display_address(param.path.as_ref(), param.chain_type.as_ref())?; + + let address_message = AddressResult { + path: param.path.to_owned(), + chain_type: param.chain_type.to_string(), + address, + }; + encode_message(address_message) +} diff --git a/api/src/substrate_signer.rs b/api/src/substrate_signer.rs new file mode 100644 index 00000000..f9199487 --- /dev/null +++ b/api/src/substrate_signer.rs @@ -0,0 +1,12 @@ +use crate::error_handling::Result; +use crate::message_handler::encode_message; +use common::SignParam; +use prost::Message; +use coin_substrate::substrateapi::SubstrateRawTxIn; +use coin_substrate::transaction::Transaction; + +pub fn sign_transaction(data: &[u8], sign_param: &SignParam) -> Result> { + let input: SubstrateRawTxIn = SubstrateRawTxIn::decode(data).unwrap(); + let signed = Transaction::sign_transaction(input, sign_param)?; + encode_message(signed) +} From 7340af70ee43a504eb8150490925741cdaf4183f Mon Sep 17 00:00:00 2001 From: Neal Xu Date: Wed, 9 Dec 2020 17:21:19 +0800 Subject: [PATCH 08/10] add ksm instant id --- cargo.lock.bak | 3632 ---------------------- common/src/applet.rs | 8 +- common/src/constants.rs | 2 +- wallet/coin-substrate/src/transaction.rs | 12 + 4 files changed, 17 insertions(+), 3637 deletions(-) delete mode 100644 cargo.lock.bak diff --git a/cargo.lock.bak b/cargo.lock.bak deleted file mode 100644 index 4bca9a1f..00000000 --- a/cargo.lock.bak +++ /dev/null @@ -1,3632 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "addr2line" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49806b9dadc843c61e7c97e72490ad7f7220ae249012fbda9ad0609457c0543" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler32" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d" - -[[package]] -name = "aes-ctr" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" -dependencies = [ - "aes-soft", - "aesni", - "ctr", - "stream-cipher", -] - -[[package]] -name = "aes-soft" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" -dependencies = [ - "block-cipher-trait", - "byteorder", - "opaque-debug", -] - -[[package]] -name = "aesni" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" -dependencies = [ - "block-cipher-trait", - "opaque-debug", - "stream-cipher", -] - -[[package]] -name = "aho-corasick" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" -dependencies = [ - "memchr", -] - -[[package]] -name = "aho-corasick" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f" - -[[package]] -name = "api" -version = "0.1.0" -dependencies = [ - "bitcoin", - "bytes 0.5.4", - "coin-bitcoin", - "coin-cosmos", - "coin-eos", - "coin-ethereum", - "coin-filecoin", - "common", - "device", - "ethereum-types", - "failure", - "hex 0.4.2", - "lazy_static", - "linked-hash-map", - "log 0.4.8", - "prost 0.6.1", - "prost-types 0.6.1", - "serde_json", - "transport", -] - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -dependencies = [ - "nodrop", -] - -[[package]] -name = "arrayvec" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" - -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" - -[[package]] -name = "backtrace" -version = "0.3.49" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05100821de9e028f12ae3d189176b41ee198341eb8f369956407fea2f5cc666c" -dependencies = [ - "addr2line", - "cfg-if 0.1.10", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base-x" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" - -[[package]] -name = "base32" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" - -[[package]] -name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - -[[package]] -name = "base64" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e223af0dc48c96d4f8342ec01a4974f139df863896b316681efd36742f22cc67" - -[[package]] -name = "bech32" -version = "0.1.0" -source = "git+https://github.com/sipa/bech32#bdc264f84014c234e908d72026b7b780122be11f" - -[[package]] -name = "bech32" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdcf67bb7ba7797a081cd19009948ab533af7c355d5caf1d08c777582d351e9c" - -[[package]] -name = "bitcoin" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302fba01c5210a0321cc459dbe7f6b4fc21dffe77241c1690bce129814fa11fc" -dependencies = [ - "bech32 0.7.2", - "bitcoin_hashes 0.9.3", - "secp256k1", -] - -[[package]] -name = "bitcoin_hashes" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b375d62f341cef9cd9e77793ec8f1db3fc9ce2e4d57e982c8fe697a2c16af3b6" - -[[package]] -name = "bitcoin_hashes" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d7f47af3cbd7f41c5d9207d10c76aede44087f7c6be090aab6bd431a9daae28" - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "blake2b-rs" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e35e362830ef90ecea16f09b21b75d22d33a8562a679c74ab4f4fa49b4fcb87" -dependencies = [ - "cc", -] - -[[package]] -name = "blake2b_simd" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" -dependencies = [ - "arrayref", - "arrayvec 0.5.1", - "constant_time_eq", -] - -[[package]] -name = "blake2s_simd" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9e07352b829279624ceb7c64adb4f585dacdb81d35cafae81139ccd617cf44" -dependencies = [ - "arrayref", - "arrayvec 0.5.1", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array", -] - -[[package]] -name = "block-cipher-trait" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-modes" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31aa8410095e39fdb732909fb5730a48d5bd7c2e3cd76bd1b07b3dbea130c529" -dependencies = [ - "block-cipher-trait", - "block-padding", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "bls-signatures" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863020d4fead1c6090d754cf542cd723c124859543f595c65e8c6f11377a4223" -dependencies = [ - "fff", - "groupy", - "hkdf", - "paired", - "rand_core 0.5.1", - "rayon", - "sha2ni", - "thiserror", -] - -[[package]] -name = "bumpalo" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" - -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "either", - "iovec", -] - -[[package]] -name = "bytes" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" - -[[package]] -name = "cargo-husky" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" - -[[package]] -name = "cc" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "coin-bitcoin" -version = "0.1.0" -dependencies = [ - "bitcoin", - "bitcoin_hashes 0.7.6", - "bytes 0.5.4", - "common", - "device", - "failure", - "hex 0.4.2", - "num-bigint 0.2.6", - "prost 0.6.1", - "prost-types 0.6.1", - "ring", - "secp256k1", - "transport", -] - -[[package]] -name = "coin-cosmos" -version = "0.1.0" -dependencies = [ - "base64 0.12.2", - "bech32 0.1.0", - "bitcoin", - "bitcoin_hashes 0.7.6", - "bytes 0.5.4", - "common", - "device", - "failure", - "hex 0.3.2", - "hyper-timeout", - "linked-hash-map", - "num-bigint 0.2.6", - "num-integer", - "num-traits", - "prost 0.6.1", - "prost-types 0.6.1", - "ring", - "secp256k1", - "serde", - "serde_derive", - "serde_json", - "transport", -] - -[[package]] -name = "coin-eos" -version = "0.1.0" -dependencies = [ - "bitcoin", - "bitcoin_hashes 0.7.6", - "bytes 0.5.4", - "common", - "device", - "failure", - "hex 0.4.2", - "prost 0.6.1", - "prost-types 0.6.1", - "transport", -] - -[[package]] -name = "coin-ethereum" -version = "0.1.0" -dependencies = [ - "bitcoin", - "bitcoin_hashes 0.7.6", - "bytes 0.5.4", - "common", - "device", - "dotenv", - "ethereum-types", - "failure", - "hex 0.3.2", - "jsonrpc-core", - "keccak-hash", - "lazy_static", - "num-bigint 0.2.6", - "num-integer", - "num-traits", - "prost 0.6.1", - "prost-types 0.6.1", - "regex 1.3.9", - "reqwest", - "rlp", - "rustc-hex", - "secp256k1", - "serde", - "serde_derive", - "serde_json", - "tiny-keccak", - "transport", -] - -[[package]] -name = "coin-filecoin" -version = "0.1.0" -dependencies = [ - "base32", - "base64 0.12.2", - "bech32 0.1.0", - "bitcoin_hashes 0.7.6", - "blake2b-rs", - "bytes 0.5.4", - "common", - "device", - "failure", - "forest_address", - "forest_bigint", - "forest_cid", - "forest_encoding", - "forest_message", - "forest_vm", - "hex 0.3.2", - "linked-hash-map", - "num-bigint 0.2.6", - "num-integer", - "num-traits", - "prost 0.6.1", - "prost-types 0.6.1", - "ring", - "secp256k1", - "serde", - "serde_cbor", - "serde_json", - "transport", -] - -[[package]] -name = "common" -version = "0.1.0" -dependencies = [ - "bytes 0.5.4", - "failure", - "hex 0.4.2", - "hyper 0.13.6", - "hyper-timeout", - "hyper-tls 0.4.1", - "num-bigint 0.2.6", - "num-integer", - "num-traits", - "prost 0.6.1", - "prost-types 0.6.1", - "regex 1.3.9", - "ring", - "rustc-serialize", - "secp256k1", - "serde", - "serde_derive", - "serde_json", - "tokio 0.2.21", -] - -[[package]] -name = "const_fn" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "cookie" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -dependencies = [ - "time", - "url 1.7.2", -] - -[[package]] -name = "cookie_store" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" -dependencies = [ - "cookie", - "failure", - "idna 0.1.5", - "log 0.4.8", - "publicsuffix", - "serde", - "serde_json", - "time", - "try_from", - "url 1.7.2", -] - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - -[[package]] -name = "crc32fast" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.0", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch 0.9.0", - "crossbeam-utils 0.8.0", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg 1.0.0", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" -dependencies = [ - "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils 0.8.0", - "lazy_static", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg 1.0.0", - "cfg-if 0.1.10", - "lazy_static", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" -dependencies = [ - "autocfg 1.0.0", - "cfg-if 1.0.0", - "const_fn", - "lazy_static", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-mac" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" -dependencies = [ - "generic-array", - "subtle 1.0.0", -] - -[[package]] -name = "ctr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" -dependencies = [ - "block-cipher-trait", - "stream-cipher", -] - -[[package]] -name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.18", - "quote 1.0.7", - "strsim", - "syn 1.0.31", -] - -[[package]] -name = "darling_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" -dependencies = [ - "darling_core", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "data-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" - -[[package]] -name = "data-encoding-macro" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de6489dde5128f5ab2f71f88f8807a237cecf08d96dc7ca4be64e0730dc7d961" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", - "proc-macro-hack", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2d6daefd5f1d4b74a891a5d2ab7dccba028d423107c074232a0c5dc0d40a9e" -dependencies = [ - "data-encoding", - "proc-macro-hack", - "syn 1.0.31", -] - -[[package]] -name = "derive_builder" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" -dependencies = [ - "darling", - "derive_builder_core", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "derive_builder_core" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" -dependencies = [ - "darling", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "device" -version = "0.1.0" -dependencies = [ - "aes-ctr", - "aes-soft", - "base64 0.12.2", - "block-modes", - "bytes 0.5.4", - "common", - "failure", - "hex 0.4.2", - "hex-literal", - "lazy_static", - "log 0.4.8", - "prost 0.6.1", - "prost-types 0.6.1", - "rand 0.6.5", - "regex 1.3.9", - "ring", - "rsa", - "secp256k1", - "serde", - "serde_derive", - "serde_json", - "sha1", - "transport", -] - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "dotenv" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "400b347fe65ccfbd8f545c9d9a75d04b0caf23fec49aaa838a9a05398f94c019" -dependencies = [ - "regex 0.2.11", -] - -[[package]] -name = "dtoa" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" - -[[package]] -name = "either" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" - -[[package]] -name = "encoding_rs" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "error-chain" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" -dependencies = [ - "version_check", -] - -[[package]] -name = "ethbloom" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3932e82d64d347a045208924002930dc105a138995ccdc1479d0f05f0359f17c" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-rlp", - "impl-serde", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62d1bc682337e2c5ec98930853674dd2b4bd5d0d246933a9e98e5280f7c76c5f" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-rlp", - "impl-serde", - "primitive-types", - "uint", -] - -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", - "synstructure", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "fff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2544d325b4870bd803d371a7df3c6845e84dcfcb6ebe7ffcae0eac6d5d676133" -dependencies = [ - "byteorder", - "cc", - "fff_derive", - "lazy_static", - "rand_core 0.5.1", -] - -[[package]] -name = "fff_derive" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "844b389fbe323d3b35ed1b3b119e75b11dca536d291d31342acea5b4c8984558" -dependencies = [ - "num-bigint 0.2.6", - "num-integer", - "num-traits", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "fixed-hash" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" -dependencies = [ - "byteorder", - "heapsize", - "rand 0.5.6", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fixedbitset" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" - -[[package]] -name = "flate2" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" -dependencies = [ - "cfg-if 0.1.10", - "crc32fast", - "libc", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "forest_address" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afbeb5f4ef22090f06bb119390a7403bab1c6dc7fc52ed8fe2fe5e3538c02f4" -dependencies = [ - "data-encoding", - "data-encoding-macro", - "forest_encoding", - "leb128", - "num-derive", - "num-traits", - "serde", - "thiserror", -] - -[[package]] -name = "forest_bigint" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873f603bf958f05ef24387824c98d92d1f64b879613941e6a4749f2d26216325" -dependencies = [ - "num-bigint 0.3.0", - "serde", - "serde_bytes", -] - -[[package]] -name = "forest_cid" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003af967e98db9e8f5fd05a6b051592663a77747994558aa38111a5dc06194ab" -dependencies = [ - "forest_json_utils", - "integer-encoding", - "multibase", - "multihash", - "serde", - "serde_bytes", - "serde_cbor", - "thiserror", -] - -[[package]] -name = "forest_crypto" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc96474746a712e786253a8add8932c4e65db8b3e262e885af077de703c50bf" -dependencies = [ - "bls-signatures", - "forest_address", - "forest_encoding", - "libsecp256k1", - "num-derive", - "num-traits", - "serde", - "thiserror", -] - -[[package]] -name = "forest_encoding" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3089143aa84ee90819b787bba0f306462c05517758afc217b5b7c61b088cfe87" -dependencies = [ - "blake2b_simd", - "forest_cid", - "serde", - "serde_bytes", - "serde_cbor", - "serde_repr", - "serde_tuple", - "thiserror", -] - -[[package]] -name = "forest_json_utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bf972b7dade88cf8524249b2ae9d8e32b5d3ec7dbd3052abbcd1b8c2c29d62" -dependencies = [ - "serde", -] - -[[package]] -name = "forest_message" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5931390a615c19a0674fa8dc871f4e520d3bc8d606228df6e377715d448cf68d" -dependencies = [ - "derive_builder", - "forest_address", - "forest_bigint", - "forest_cid", - "forest_crypto", - "forest_encoding", - "forest_vm", - "num-traits", - "serde", -] - -[[package]] -name = "forest_vm" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c8e1bae85f536b3b2111c3504757069ef1ebc9460dd65db9ec7fdc4411f604" -dependencies = [ - "forest_address", - "forest_bigint", - "forest_cid", - "forest_encoding", - "lazy_static", - "num-derive", - "num-traits", - "serde", - "thiserror", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" - -[[package]] -name = "futures-channel" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" - -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -dependencies = [ - "futures", - "num_cpus", -] - -[[package]] -name = "futures-sink" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" - -[[package]] -name = "futures-task" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" - -[[package]] -name = "futures-util" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" -dependencies = [ - "futures-core", - "futures-task", - "pin-project", - "pin-utils", -] - -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -dependencies = [ - "typenum", -] - -[[package]] -name = "getrandom" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" - -[[package]] -name = "groupy" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d38f1bec17d75a7c30b754cd74db6e7cb5927529021ced14fbd622411c04d8b" -dependencies = [ - "fff", - "rand 0.7.3", - "rand_xorshift 0.2.0", - "thiserror", -] - -[[package]] -name = "h2" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "fnv", - "futures", - "http 0.1.21", - "indexmap", - "log 0.4.8", - "slab", - "string", - "tokio-io", -] - -[[package]] -name = "h2" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" -dependencies = [ - "bytes 0.5.4", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.1", - "indexmap", - "log 0.4.8", - "slab", - "tokio 0.2.21", - "tokio-util", -] - -[[package]] -name = "half" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" - -[[package]] -name = "heapsize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" -dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "heck" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" - -[[package]] -name = "hex" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" - -[[package]] -name = "hex-literal" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" -dependencies = [ - "hex-literal-impl", - "proc-macro-hack", -] - -[[package]] -name = "hex-literal-impl" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853f769599eb31de176303197b7ba4973299c38c7a7604a6bc88c3eef05b9b46" -dependencies = [ - "proc-macro-hack", -] - -[[package]] -name = "hidapi" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95d0287c6c92c3fe5426a25dace368e0cf1b93e63beacbd7720176e713b001d" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "hkdf" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa08a006102488bd9cd5b8013aabe84955cf5ae22e304c2caf655b633aefae3" -dependencies = [ - "digest", - "hmac", -] - -[[package]] -name = "hmac" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" -dependencies = [ - "crypto-mac", - "digest", -] - -[[package]] -name = "hmac-drbg" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" -dependencies = [ - "digest", - "generic-array", - "hmac", -] - -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -dependencies = [ - "bytes 0.4.12", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" -dependencies = [ - "bytes 0.5.4", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -dependencies = [ - "bytes 0.4.12", - "futures", - "http 0.1.21", - "tokio-buf", -] - -[[package]] -name = "http-body" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" -dependencies = [ - "bytes 0.5.4", - "http 0.2.1", -] - -[[package]] -name = "httparse" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" - -[[package]] -name = "hyper" -version = "0.12.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" -dependencies = [ - "bytes 0.4.12", - "futures", - "futures-cpupool", - "h2 0.1.26", - "http 0.1.21", - "http-body 0.1.0", - "httparse", - "iovec", - "itoa", - "log 0.4.8", - "net2", - "rustc_version", - "time", - "tokio 0.1.22", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "want 0.2.0", -] - -[[package]] -name = "hyper" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e7655b9594024ad0ee439f3b5a7299369dc2a3f459b47c696f9ff676f9aa1f" -dependencies = [ - "bytes 0.5.4", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.2.5", - "http 0.2.1", - "http-body 0.3.1", - "httparse", - "itoa", - "log 0.4.8", - "pin-project", - "socket2", - "time", - "tokio 0.2.21", - "tower-service", - "want 0.3.0", -] - -[[package]] -name = "hyper-timeout" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d1f9b0b8258e3ef8f45928021d3ef14096c2b93b99e4b8cfcabf1f58ec84b0a" -dependencies = [ - "bytes 0.5.4", - "hyper 0.13.6", - "tokio 0.2.21", - "tokio-io-timeout", -] - -[[package]] -name = "hyper-tls" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" -dependencies = [ - "bytes 0.4.12", - "futures", - "hyper 0.12.35", - "native-tls", - "tokio-io", -] - -[[package]] -name = "hyper-tls" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3adcd308402b9553630734e9c36b77a7e48b3821251ca2493e8cd596763aafaa" -dependencies = [ - "bytes 0.5.4", - "hyper 0.13.6", - "native-tls", - "tokio 0.2.21", - "tokio-tls", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "impl-codec" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b" -dependencies = [ - "parity-codec", -] - -[[package]] -name = "impl-rlp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e3cae7e99c7ff5a995da2cf78dd0a5383740eda71d98cf7b1910c301ac69b8" -dependencies = [ - "serde", -] - -[[package]] -name = "indexmap" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" -dependencies = [ - "autocfg 1.0.0", -] - -[[package]] -name = "integer-encoding" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4ebd0bd29be0f11973e9b3e219005661042a019fd757798c36a47c87852625" - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" - -[[package]] -name = "js-sys" -version = "0.3.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "jsonrpc-core" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf83704f4e79979a424d1082dd2c1e52683058056c9280efa19ac5f6bc9033c" -dependencies = [ - "futures", - "log 0.3.9", - "serde", - "serde_derive", - "serde_json", -] - -[[package]] -name = "keccak" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" - -[[package]] -name = "keccak-hash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e8ee697b9aa6dcc34d7657565fa5052763a1627a5b59e4c3c0ae3ed0d70a65" -dependencies = [ - "primitive-types", - "tiny-keccak", -] - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin", -] - -[[package]] -name = "leb128" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" - -[[package]] -name = "libc" -version = "0.2.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" - -[[package]] -name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - -[[package]] -name = "libsecp256k1" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962" -dependencies = [ - "arrayref", - "crunchy", - "digest", - "hmac-drbg", - "rand 0.7.3", - "sha2", - "subtle 2.2.3", - "typenum", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" -dependencies = [ - "serde", - "serde_test", -] - -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.8", -] - -[[package]] -name = "log" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" - -[[package]] -name = "memoffset" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" -dependencies = [ - "autocfg 1.0.0", -] - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "mime_guess" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "miniz_oxide" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" -dependencies = [ - "adler32", -] - -[[package]] -name = "mio" -version = "0.6.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log 0.4.8", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "miow" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "multibase" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47fbc227f7e2b1cb701f95404579ecb2668abbdd3c7ef7a6cbb3cc0d3b236869" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "digest", - "sha-1", - "sha2", - "sha3", - "unsigned-varint", -] - -[[package]] -name = "multimap" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce" - -[[package]] -name = "native-tls" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" -dependencies = [ - "lazy_static", - "libc", - "log 0.4.8", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "net2" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.8", -] - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg 1.0.0", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f3fc75e3697059fb1bc465e3d8cca6cf92f56854f201158b3f9c77d5a3cfa0" -dependencies = [ - "autocfg 1.0.0", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8552a8edd6289764deab155204f86ccf3b0027e10f960a55d5a53deaf6688c" -dependencies = [ - "autocfg 0.1.7", - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.6.5", - "serde", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-derive" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f09b9841adb6b5e1f89ef7087ea636e0fd94b2851f887c1e3eb5d5f8228fab3" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "num-integer" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" -dependencies = [ - "autocfg 1.0.0", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" -dependencies = [ - "autocfg 1.0.0", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" -dependencies = [ - "autocfg 1.0.0", -] - -[[package]] -name = "num_cpus" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "openssl" -version = "0.10.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd" -dependencies = [ - "bitflags", - "cfg-if 0.1.10", - "foreign-types", - "lazy_static", - "libc", - "openssl-sys", -] - -[[package]] -name = "openssl-probe" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" - -[[package]] -name = "openssl-sys" -version = "0.9.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" -dependencies = [ - "autocfg 1.0.0", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "paired" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ae957e986289a03f1407ce9c88f19e8280e8106d5498a364e3e5b60b1b9fc" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest", - "fff", - "groupy", - "hkdf", - "rand_core 0.5.1", -] - -[[package]] -name = "parity-codec" -version = "3.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b9df1283109f542d8852cd6b30e9341acc2137481eb6157d2e62af68b0afec9" -dependencies = [ - "arrayvec 0.4.12", - "serde", -] - -[[package]] -name = "parking_lot" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -dependencies = [ - "lock_api", - "parking_lot_core", - "rustc_version", -] - -[[package]] -name = "parking_lot_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi", - "libc", - "redox_syscall", - "rustc_version", - "smallvec", - "winapi 0.3.8", -] - -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "petgraph" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "pin-project-lite" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" - -[[package]] -name = "ppv-lite86" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" - -[[package]] -name = "primitive-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2288eb2a39386c4bc817974cc413afe173010dc80e470fcb1e9a35580869f024" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "uint", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" -dependencies = [ - "unicode-xid 0.2.0", -] - -[[package]] -name = "prost" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d14b1c185652833d24aaad41c5832b0be5616a590227c1fbff57c616754b23" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "prost-derive 0.5.0", -] - -[[package]] -name = "prost" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" -dependencies = [ - "bytes 0.5.4", - "prost-derive 0.6.1", -] - -[[package]] -name = "prost-build" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" -dependencies = [ - "bytes 0.5.4", - "heck", - "itertools", - "log 0.4.8", - "multimap", - "petgraph", - "prost 0.6.1", - "prost-types 0.6.1", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e7dc378b94ac374644181a2247cebf59a6ec1c88b49ac77f3a94b86b79d0e11" -dependencies = [ - "failure", - "itertools", - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", -] - -[[package]] -name = "prost-derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "prost-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de482a366941c8d56d19b650fac09ca08508f2a696119ee7513ad590c8bac6f" -dependencies = [ - "bytes 0.4.12", - "prost 0.5.0", -] - -[[package]] -name = "prost-types" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" -dependencies = [ - "bytes 0.5.4", - "prost 0.6.1", -] - -[[package]] -name = "proto" -version = "0.1.0" -dependencies = [ - "bytes 0.5.4", - "prost 0.6.1", - "prost-build", - "prost-types 0.5.0", -] - -[[package]] -name = "publicsuffix" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" -dependencies = [ - "error-chain", - "idna 0.2.0", - "lazy_static", - "regex 1.3.9", - "url 2.1.1", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - -[[package]] -name = "quote" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" -dependencies = [ - "proc-macro2 1.0.18", -] - -[[package]] -name = "rand" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "winapi 0.3.8", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift 0.1.1", - "winapi 0.3.8", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.8", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.8", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "raw-cpuid" -version = "7.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" -dependencies = [ - "bitflags", - "cc", - "rustc_version", -] - -[[package]] -name = "rayon" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" -dependencies = [ - "autocfg 1.0.0", - "crossbeam-deque 0.8.0", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.0", - "lazy_static", - "num_cpus", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "redox_syscall" -version = "0.1.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" - -[[package]] -name = "regex" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -dependencies = [ - "aho-corasick 0.6.10", - "memchr", - "regex-syntax 0.5.6", - "thread_local 0.3.6", - "utf8-ranges", -] - -[[package]] -name = "regex" -version = "1.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" -dependencies = [ - "aho-corasick 0.7.10", - "memchr", - "regex-syntax 0.6.18", - "thread_local 1.0.1", -] - -[[package]] -name = "regex-syntax" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" -dependencies = [ - "ucd-util", -] - -[[package]] -name = "regex-syntax" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "reqwest" -version = "0.9.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" -dependencies = [ - "base64 0.10.1", - "bytes 0.4.12", - "cookie", - "cookie_store", - "encoding_rs", - "flate2", - "futures", - "http 0.1.21", - "hyper 0.12.35", - "hyper-tls 0.3.2", - "log 0.4.8", - "mime", - "mime_guess", - "native-tls", - "serde", - "serde_json", - "serde_urlencoded", - "time", - "tokio 0.1.22", - "tokio-executor", - "tokio-io", - "tokio-threadpool", - "tokio-timer", - "url 1.7.2", - "uuid", - "winreg", -] - -[[package]] -name = "ring" -version = "0.16.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba5a8ec64ee89a76c98c549af81ff14813df09c3e6dc4766c3856da48597a0c" -dependencies = [ - "cc", - "lazy_static", - "libc", - "spin", - "untrusted", - "web-sys", - "winapi 0.3.8", -] - -[[package]] -name = "rlp" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7d3f9bed94764eac15b8f14af59fac420c236adaff743b7bcc88e265cb4345" -dependencies = [ - "rustc-hex", -] - -[[package]] -name = "rsa" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5108a8bbfb84fe77d829d77d5a89255dcd189dfe5c4de5a33d0a47f12808bb15" -dependencies = [ - "byteorder", - "failure", - "lazy_static", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "rand 0.6.5", - "subtle 2.2.3", - "zeroize", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "schannel" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" -dependencies = [ - "lazy_static", - "winapi 0.3.8", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "secp256k1" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6179428c22c73ac0fbb7b5579a56353ce78ba29759b3b8575183336ea74cdfb" -dependencies = [ - "rand 0.6.5", - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11553d210db090930f4432bea123b31f70bbf693ace14504ea2a35e796c28dd2" -dependencies = [ - "cc", -] - -[[package]] -name = "security-framework" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "serde" -version = "1.0.112" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736aac72d1eafe8e5962d1d1c3d99b0df526015ba40915cb3c49d042e92ec243" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_bytes" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_cbor" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" -dependencies = [ - "half", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.112" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0343ce212ac0d3d6afd9391ac8e9c9efe06b533c8d33f660f6390cc4093f57" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "serde_json" -version = "1.0.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "serde_test" -version = "1.0.112" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326d93a77b25d5516844911b9df1d02375405a5b2671c1d23b0fbd9ac7af4f3" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_tuple" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f025b91216f15a2a32aa39669329a475733590a015835d1783549a56d09427" -dependencies = [ - "serde", - "serde_tuple_macros", -] - -[[package]] -name = "serde_tuple_macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "serde_urlencoded" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" -dependencies = [ - "dtoa", - "itoa", - "serde", - "url 1.7.2", -] - -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", -] - -[[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" - -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", -] - -[[package]] -name = "sha2ni" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce234f44a9c36fb84a168d4201b596d800e170aaa966a68857058cbe2d041a3" -dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "lazy_static", - "opaque-debug", - "raw-cpuid", -] - -[[package]] -name = "sha3" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" -dependencies = [ - "block-buffer", - "byte-tools", - "digest", - "keccak", - "opaque-debug", -] - -[[package]] -name = "slab" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" - -[[package]] -name = "smallvec" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "socket2" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "redox_syscall", - "winapi 0.3.8", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "static_assertions" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" - -[[package]] -name = "stream-cipher" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c" -dependencies = [ - "generic-array", -] - -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes 0.4.12", -] - -[[package]] -name = "strsim" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" - -[[package]] -name = "subtle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" - -[[package]] -name = "subtle" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" - -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - -[[package]] -name = "syn" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "unicode-xid 0.2.0", -] - -[[package]] -name = "synstructure" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", - "unicode-xid 0.2.0", -] - -[[package]] -name = "tempfile" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "rand 0.7.3", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.8", -] - -[[package]] -name = "thiserror" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", -] - -[[package]] -name = "thread_local" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "time" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" -dependencies = [ - "libc", - "winapi 0.3.8", -] - -[[package]] -name = "tiny-keccak" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinyvec" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" - -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures", - "mio", - "num_cpus", - "tokio-current-thread", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", -] - -[[package]] -name = "tokio" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58" -dependencies = [ - "bytes 0.5.4", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "memchr", - "mio", - "pin-project-lite", - "slab", -] - -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -dependencies = [ - "bytes 0.4.12", - "either", - "futures", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -dependencies = [ - "bytes 0.4.12", - "futures", - "log 0.4.8", -] - -[[package]] -name = "tokio-io-timeout" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9390a43272c8a6ac912ed1d1e2b6abeafd5047e05530a2fa304deee041a06215" -dependencies = [ - "bytes 0.5.4", - "tokio 0.2.21", -] - -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures", - "lazy_static", - "log 0.4.8", - "mio", - "num_cpus", - "parking_lot", - "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", -] - -[[package]] -name = "tokio-sync" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" -dependencies = [ - "fnv", - "futures", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -dependencies = [ - "bytes 0.4.12", - "futures", - "iovec", - "mio", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -dependencies = [ - "crossbeam-deque 0.7.3", - "crossbeam-queue", - "crossbeam-utils 0.7.2", - "futures", - "lazy_static", - "log 0.4.8", - "num_cpus", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" -dependencies = [ - "native-tls", - "tokio 0.2.21", -] - -[[package]] -name = "tokio-util" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" -dependencies = [ - "bytes 0.5.4", - "futures-core", - "futures-sink", - "log 0.4.8", - "pin-project-lite", - "tokio 0.2.21", -] - -[[package]] -name = "tower-service" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" - -[[package]] -name = "transport" -version = "0.1.0" -dependencies = [ - "cargo-husky", - "failure", - "hex 0.4.2", - "hidapi", - "lazy_static", -] - -[[package]] -name = "try-lock" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" - -[[package]] -name = "try_from" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" - -[[package]] -name = "ucd-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85f514e095d348c279b1e5cd76795082cf15bd59b93207832abe0b1d8fed236" - -[[package]] -name = "uint" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2143cded94692b156c356508d92888acc824db5bffc0b4089732264c6fcf86d4" -dependencies = [ - "byteorder", - "crunchy", - "heapsize", - "rustc-hex", -] - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] -name = "unicode-xid" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" - -[[package]] -name = "unsigned-varint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67332660eb59a6f1eb24ff1220c9e8d01738a8503c6002e30bcfe4bd9f2b4a9" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "url" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" -dependencies = [ - "idna 0.2.0", - "matches", - "percent-encoding 2.1.0", -] - -[[package]] -name = "utf8-ranges" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" - -[[package]] -name = "uuid" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" -dependencies = [ - "rand 0.6.5", -] - -[[package]] -name = "vcpkg" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" - -[[package]] -name = "version_check" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" - -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -dependencies = [ - "futures", - "log 0.4.8", - "try-lock", -] - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log 0.4.8", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasm-bindgen" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2dc4aa152834bc334f506c1a06b866416a8b6697d5c9f75b9a689c8486def0" -dependencies = [ - "cfg-if 0.1.10", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded84f06e0ed21499f6184df0e0cb3494727b0c5da89534e0fcc55c51d812101" -dependencies = [ - "bumpalo", - "lazy_static", - "log 0.4.8", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3" -dependencies = [ - "quote 1.0.7", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" - -[[package]] -name = "web-sys" -version = "0.3.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "winreg" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" -dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "zeroize" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4090487fa66630f7b166fba2bbb525e247a5449f41c468cc1d98f8ae6ac03120" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc9ce59c69fc43078c6f4250b0c866bb06b9ff7ac955c7ddb82a8c189281dcae" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.31", - "synstructure", -] diff --git a/common/src/applet.rs b/common/src/applet.rs index fc8dd8ce..dc47bf42 100644 --- a/common/src/applet.rs +++ b/common/src/applet.rs @@ -5,8 +5,8 @@ pub fn get_appname_by_instid(instid: &str) -> Option<&str> { "695F656F73" => Some("EOS"), "695F636F736D6F73" => Some("COSMOS"), "695F6B315F66696C" => Some("FILECOIN"), - "695F6B315F66696C02" => Some("FILECOIN2"), - "695F6B315F66696C03" => Some("FILECOIN3"), + "695F656473725F6B736D" => Some("KSM"), + "695F656473725F646F74" => Some("DOT"), "695F696D6B" => Some("IMK"), _ => None, } @@ -18,8 +18,8 @@ pub fn get_instid_by_appname(appname: &str) -> Option<&str> { "EOS" => Some("695F656F73"), "COSMOS" => Some("695F636F736D6F73"), "FILECOIN" => Some("695F6B315F66696C"), - "FILECOIN2" => Some("695F6B315F66696C02"), - "FILECOIN3" => Some("695F6B315F66696C03"), + "KSM" => Some("695F656473725F6B736D"), + "DOT" => Some("695F656473725F646F74"), "IMK" => Some("695F696D6B"), _ => None, } diff --git a/common/src/constants.rs b/common/src/constants.rs index ae5126b3..a0daf79b 100644 --- a/common/src/constants.rs +++ b/common/src/constants.rs @@ -1,5 +1,5 @@ pub const VERSION: &str = "2.0.0"; -pub const URL: &str = "https://imkeyserver.com:10443/imkey/"; +pub const URL: &str = "https://imkeyserver.com:10443/imkey"; pub const TSM_ACTION_SE_SECURE_CHECK: &str = "/seSecureCheck"; pub const TSM_ACTION_APP_DOWNLOAD: &str = "/appDownload"; diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs index 2835d7c5..1b431860 100644 --- a/wallet/coin-substrate/src/transaction.rs +++ b/wallet/coin-substrate/src/transaction.rs @@ -107,10 +107,16 @@ impl Transaction { #[cfg(test)] mod test { +<<<<<<< HEAD use crate::address::{AddressType, SubstrateAddress}; use crate::substrateapi::SubstrateRawTxIn; use crate::transaction::Transaction; use common::constants::{KUSAMA_PATH, POLKADOT_PATH}; +======= + use crate::substrateapi::SubstrateRawTxIn; + use crate::transaction::Transaction; + use common::constants::POLKADOT_PATH; +>>>>>>> add ksm instant id use common::SignParam; use device::device_binding::bind_test; use sp_core::crypto::Ss58Codec; @@ -162,6 +168,7 @@ mod test { sender: "147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT".to_string(), fee: "15.4000 milli DOT".to_string(), }; +<<<<<<< HEAD let input = SubstrateRawTxIn{ raw_data: "0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() @@ -179,5 +186,10 @@ mod test { sp_core::ed25519::Signature::verify(&sig, msg.as_slice(), &pk), "assert sig" ); +======= + let ret = Transaction::sign_transaction(&input, &sign_param).expect("sign error"); + + assert_eq!("sig", ret.signature); +>>>>>>> add ksm instant id } } From 037e8a5ff3c1f06ef6dae7d080126e2b3420e50d Mon Sep 17 00:00:00 2001 From: Neal Xu Date: Wed, 9 Dec 2020 17:42:47 +0800 Subject: [PATCH 09/10] fix merge error --- api/src/lib.rs | 16 +++++++--------- api/src/substrate_address.rs | 3 ++- api/src/substrate_signer.rs | 4 ++-- wallet/coin-substrate/src/transaction.rs | 12 ------------ 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/api/src/lib.rs b/api/src/lib.rs index 94afa198..64642736 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -16,9 +16,9 @@ pub mod ethereum_address; pub mod ethereum_signer; pub mod filecoin_address; pub mod filecoin_signer; +pub mod message_handler; pub mod substrate_address; pub mod substrate_signer; -pub mod message_handler; use std::sync::Mutex; #[macro_use] @@ -181,14 +181,12 @@ pub unsafe extern "C" fn call_imkey_api(hex_str: *const c_char) -> *const c_char ¶m.clone().input.unwrap().value, ¶m, ), - "POLKADOT" => substrate_signer::sign_transaction( - ¶m.clone().input.unwrap().value, - ¶m, - ), - "KUSAMA" => substrate_signer::sign_transaction( - ¶m.clone().input.unwrap().value, - ¶m, - ), + "POLKADOT" => { + substrate_signer::sign_transaction(¶m.clone().input.unwrap().value, ¶m) + } + "KUSAMA" => { + substrate_signer::sign_transaction(¶m.clone().input.unwrap().value, ¶m) + } _ => Err(format_err!("sign_tx unsupported_chain")), } }), diff --git a/api/src/substrate_address.rs b/api/src/substrate_address.rs index cf7c167a..d8a52b0d 100644 --- a/api/src/substrate_address.rs +++ b/api/src/substrate_address.rs @@ -16,7 +16,8 @@ pub fn get_address(param: &AddressParam) -> Result> { } pub fn display_address(param: &AddressParam) -> Result> { - let address = SubstrateAddress::display_address(param.path.as_ref(), param.chain_type.as_ref())?; + let address = + SubstrateAddress::display_address(param.path.as_ref(), param.chain_type.as_ref())?; let address_message = AddressResult { path: param.path.to_owned(), diff --git a/api/src/substrate_signer.rs b/api/src/substrate_signer.rs index f9199487..f8c91cef 100644 --- a/api/src/substrate_signer.rs +++ b/api/src/substrate_signer.rs @@ -1,9 +1,9 @@ use crate::error_handling::Result; use crate::message_handler::encode_message; -use common::SignParam; -use prost::Message; use coin_substrate::substrateapi::SubstrateRawTxIn; use coin_substrate::transaction::Transaction; +use common::SignParam; +use prost::Message; pub fn sign_transaction(data: &[u8], sign_param: &SignParam) -> Result> { let input: SubstrateRawTxIn = SubstrateRawTxIn::decode(data).unwrap(); diff --git a/wallet/coin-substrate/src/transaction.rs b/wallet/coin-substrate/src/transaction.rs index 1b431860..2835d7c5 100644 --- a/wallet/coin-substrate/src/transaction.rs +++ b/wallet/coin-substrate/src/transaction.rs @@ -107,16 +107,10 @@ impl Transaction { #[cfg(test)] mod test { -<<<<<<< HEAD use crate::address::{AddressType, SubstrateAddress}; use crate::substrateapi::SubstrateRawTxIn; use crate::transaction::Transaction; use common::constants::{KUSAMA_PATH, POLKADOT_PATH}; -======= - use crate::substrateapi::SubstrateRawTxIn; - use crate::transaction::Transaction; - use common::constants::POLKADOT_PATH; ->>>>>>> add ksm instant id use common::SignParam; use device::device_binding::bind_test; use sp_core::crypto::Ss58Codec; @@ -168,7 +162,6 @@ mod test { sender: "147mvrDYhFpZzvFASKBDNVcxoyz8XCVNyyFKSZcpbQxN33TT".to_string(), fee: "15.4000 milli DOT".to_string(), }; -<<<<<<< HEAD let input = SubstrateRawTxIn{ raw_data: "0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c0703d148e25901007b000000dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025bde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7".to_string() @@ -186,10 +179,5 @@ mod test { sp_core::ed25519::Signature::verify(&sig, msg.as_slice(), &pk), "assert sig" ); -======= - let ret = Transaction::sign_transaction(&input, &sign_param).expect("sign error"); - - assert_eq!("sig", ret.signature); ->>>>>>> add ksm instant id } } From 0448c0b369fb1d8b6294cc7d8ef35d973a204627 Mon Sep 17 00:00:00 2001 From: xiemener Date: Wed, 9 Dec 2020 18:46:53 +0800 Subject: [PATCH 10/10] fix type build error --- api/src/substrate_address.rs | 17 +++++++++++++---- api/src/substrate_signer.rs | 2 +- examples/ios/iosExample/Proto/device.pb.swift | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/api/src/substrate_address.rs b/api/src/substrate_address.rs index d8a52b0d..9c03541c 100644 --- a/api/src/substrate_address.rs +++ b/api/src/substrate_address.rs @@ -1,11 +1,16 @@ use crate::api::{AddressParam, AddressResult}; use crate::error_handling::Result; use crate::message_handler::encode_message; -use coin_substrate::address::SubstrateAddress; +use coin_substrate::address::{AddressType, SubstrateAddress}; use prost::Message; pub fn get_address(param: &AddressParam) -> Result> { - let address = SubstrateAddress::get_address(param.path.as_ref(), param.chain_type.as_ref())?; + let address_type = match param.chain_type.as_str() { + "POLKADOT" => AddressType::Polkadot, + "KUSAMA" => AddressType::Kusama, + _ => panic!("address type not support"), + }; + let address = SubstrateAddress::get_address(param.path.as_ref(), &address_type)?; let address_message = AddressResult { path: param.path.to_owned(), @@ -16,8 +21,12 @@ pub fn get_address(param: &AddressParam) -> Result> { } pub fn display_address(param: &AddressParam) -> Result> { - let address = - SubstrateAddress::display_address(param.path.as_ref(), param.chain_type.as_ref())?; + let address_type = match param.chain_type.as_str() { + "POLKADOT" => AddressType::Polkadot, + "KUSAMA" => AddressType::Kusama, + _ => panic!("address type not support"), + }; + let address = SubstrateAddress::display_address(param.path.as_ref(), &address_type)?; let address_message = AddressResult { path: param.path.to_owned(), diff --git a/api/src/substrate_signer.rs b/api/src/substrate_signer.rs index f8c91cef..9e8696ef 100644 --- a/api/src/substrate_signer.rs +++ b/api/src/substrate_signer.rs @@ -7,6 +7,6 @@ use prost::Message; pub fn sign_transaction(data: &[u8], sign_param: &SignParam) -> Result> { let input: SubstrateRawTxIn = SubstrateRawTxIn::decode(data).unwrap(); - let signed = Transaction::sign_transaction(input, sign_param)?; + let signed = Transaction::sign_transaction(&input, sign_param)?; encode_message(signed) } diff --git a/examples/ios/iosExample/Proto/device.pb.swift b/examples/ios/iosExample/Proto/device.pb.swift index ee6d4a30..bb894d55 100644 --- a/examples/ios/iosExample/Proto/device.pb.swift +++ b/examples/ios/iosExample/Proto/device.pb.swift @@ -307,7 +307,7 @@ fileprivate let _protobuf_package = "deviceapi" extension Deviceapi_AppDownloadReq: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".AppDownloadReq" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "appName"), + 1: .standard(proto: "app_name"), ] public mutating func decodeMessage(decoder: inout D) throws {