diff --git a/Cargo.lock b/Cargo.lock index bc2871dd..3695755c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -704,6 +704,7 @@ dependencies = [ "move-vm-types", "once_cell", "pontem", + "pontem-client", "rand 0.7.3", "regex", "reqwest", @@ -1057,6 +1058,16 @@ dependencies = [ "tracing-futures", ] +[[package]] +name = "hash_project" +version = "0.1.0" +dependencies = [ + "anyhow", + "log", + "sha256", + "toml", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -1417,6 +1428,16 @@ version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + [[package]] name = "linked-hash-map" version = "0.5.4" @@ -2750,6 +2771,19 @@ dependencies = [ "rust-base58", ] +[[package]] +name = "pontem-client" +version = "0.15.0" +dependencies = [ + "anyhow", + "env_logger", + "hash_project", + "libloading", + "log", + "rand 0.8.4", + "url", +] + [[package]] name = "ppv-lite86" version = "0.2.16" @@ -3357,6 +3391,16 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "sha256" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e84a7f596c081d359de5e06a83877138bc3c4483591e1af1916e1472e6e146e" +dependencies = [ + "hex", + "sha2", +] + [[package]] name = "sha3" version = "0.9.1" diff --git a/Cargo.toml b/Cargo.toml index 0d230fb0..c3a841ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,9 @@ members = [ "dove", "lang", "common/git-hash", + "pontem/client" ] +exclude = [ "pontem/hash_project", "pontem/pontemapi"] [profile.release] lto = "thin" diff --git a/README.md b/README.md index 9a9048ae..8f56bc33 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ cargo install --path ./dove dove -h ``` -##### Create new project: +## Create new project: ```shell script dove new first_project @@ -36,7 +36,7 @@ dove new first_project This command will create `first_project/` directory with special `Move.toml` manifest file and `sources/` directory for Move source code. -##### Build project: +## Build project: ```shell script dove build @@ -60,7 +60,7 @@ The contents of the directories will be deleted: - `/build` - `~/.move/` -### Pallet Transactions +## Pallet Transactions Command `call` allows you to create transactions for Polkadot chain with [Move Pallete](https://github.com/pontem-network/sp-move) on board. @@ -130,10 +130,11 @@ Migrated inside Dove, see help: dove run --help ``` -### Manage wallet keys +## Manage wallet keys Command `key` allows you to save the secret keys to the wallet on your computer and access them under an alias. -Saved key can be used when publishing a module `$ dove deploy module --account ...` or package `$ dove deploy package --account ...`, as well as when execute a transaction `$ dove call --account ...`. +Saved key can be used when publishing a module or bundle `$ dove deploy --account ...`, +as well as when execute a transaction `$ dove call --account ...`. Keys are stored on your computer in the `~/.move/` directory. Before saving, they are encrypted with the aes + password. #### Adding a key: @@ -169,6 +170,32 @@ Deleting all saved keys: dove key delete --all ``` +## Publishing a module or package + +```bash +$ dove deploy [FILE_NAME|PATH_TO_FILE] [OPTIONS] +``` +### Input parameters +- [FILE_NAME] - Name of module or package to be published. +- [PATH_TO_FILE] - Path to the file to be published. Expected file extension: + - `pac` bundle + - `mv` module + - `mvt` transaction +- `-g` / `--gas` Limitation of gas consumption per operation. A positive integer is expected +- `-u` / `--url` The url of the substrate node to query [default: ws://localhost:9944]. HTTP, HTTPS, WS protocols are supported. It is recommended to use WS. When using HTTP or HTTPS, you cannot get the publication status. +- `--account` Account from whom to publish. Address or test account name or name wallet key. Example: //Alice, alice, bob, NAME_WALLET_KEY... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY. When used in combination with `--secret` is ignored. +- `-s` / `--secret` Secret phrase. If a secret phrase is specified, you do not need to specify. +- `modules_exclude` Names of modules to exclude from the package process. + +### Examples: +```bash +dove deploy +dove deploy PACKAGE_NAME --account WALLET_KEY --gas 300 +dove deploy PACKAGE_NAME --secret --url ws://127.0.0.1:9944 --gas 400 --modules_exclude MODULE_NAME_1 MODULE_NAME_2 .. +dove deploy MODULE_NAME --secret --url https://127.0.0.1:9933 --gas 400 +dove deploy PATH/TO/FILE --account //Alice --gas 300 +``` + ## LICENSE [LICENSE](/LICENSE) diff --git a/dove/Cargo.toml b/dove/Cargo.toml index 76f355f9..8275a285 100644 --- a/dove/Cargo.toml +++ b/dove/Cargo.toml @@ -13,6 +13,7 @@ edition = "2021" # LOCAL git-hash = { path = "../common/git-hash" } lang = { path = "../lang" } +pontem-client = { path = "../pontem/client" } # DIEM move-core-types = { git = "https://github.com/pontem-network/move.git", branch = "release-1.6" } diff --git a/dove/src/cmd/deploy.rs b/dove/src/cmd/deploy.rs index e8addd8b..ca10c215 100644 --- a/dove/src/cmd/deploy.rs +++ b/dove/src/cmd/deploy.rs @@ -1,26 +1,41 @@ use core::mem; use std::collections::HashMap; use std::fs; -use std::ffi::OsStr; +use std::str::FromStr; use std::fs::remove_file; use std::path::{PathBuf, Path}; + use anyhow::Error; use structopt::StructOpt; +use serde::{Serialize, Deserialize}; use anyhow::Result; +use itertools::Itertools; + use move_binary_format::access::ModuleAccess; use move_binary_format::CompiledModule; - use move_cli::Command as MoveCommand; use move_cli::package::cli::PackageCommand; use move_cli::run_cli; use move_core_types::language_storage::ModuleId; use crate::context::Context; -use serde::{Serialize, Deserialize}; +use crate::publish::{NodeAccessParams, Publish}; -#[derive(StructOpt, Debug, Default)] +#[derive(StructOpt, Debug)] #[structopt(setting(structopt::clap::AppSettings::ColoredHelp))] +#[structopt(usage = "dove deploy [FILE_NAME|PATH] [OPTIONS] + Examples: + $ dove deploy + $ dove deploy PACKAGE_NAME --account WALLET_KEY --gas 300 + $ dove deploy PACKAGE_NAME --secret --url ws://127.0.0.1:9944 --gas 400 --modules_exclude MODULE_NAME_1 MODULE_NAME_2 .. + $ dove deploy MODULE_NAME --secret --url https://127.0.0.1:9933 --gas 400 + $ dove deploy PATH/TO/FILE --account //Alice --gas 300 +")] pub struct Deploy { + #[structopt(help = "Module/Bundle name or path")] + file: Option, + + // * Only for bundle // Names of modules to exclude from the package process. // Modules are taken from the /build//bytecode_modules directory. // The names are case-insensitive and can be specified with an extension.mv or without it. @@ -31,12 +46,8 @@ pub struct Deploy { )] modules_exclude: Vec, - #[structopt( - help = "File name of the resulting .pac file.", - short = "o", - long = "output" - )] - output: Option, + #[structopt(flatten)] + request: NodeAccessParams, } impl Deploy { @@ -47,19 +58,18 @@ impl Deploy { // packaging of modules self.bundle_modules_into_pac(ctx)?; - Ok(()) + if !self.request.need_to_publish() { + return Ok(()); + } + + // Publish a bundle or module to a node + self.publish(ctx) } -} -impl Deploy { fn bundle_modules_into_pac(&self, ctx: &Context) -> Result<()> { // Path to the output file let output_file_path = ctx - .bundles_output_path( - self.output - .as_deref() - .unwrap_or_else(|| ctx.manifest.package.name.as_str()), - )? + .bundles_output_path(ctx.manifest.package.name.as_str())? .with_extension("pac"); if output_file_path.exists() { remove_file(&output_file_path)?; @@ -96,41 +106,26 @@ impl Deploy { ); Ok(()) } -} -/// Return file paths from ./PROJECT_FOLDER/build/PROJECT_NAME/bytecode_modules -/// Only with the .mv extension -fn get_bytecode_modules_path(project_dir: &Path, project_name: &str) -> Result> { - let path = project_dir - .join("build") - .join(project_name) - .join("bytecode_modules"); - if !path.exists() { - return Ok(Vec::new()); - } + /// Publish a bundle or module to a node + fn publish(&self, ctx: &Context) -> Result<()> { + let file_name = self + .file + .as_ref() + .ok_or(anyhow!("File name not specified"))?; - let list = fs::read_dir(path)? - .map(|res| res.map(|e| e.path())) - .collect::, _>>() - .map(|list| { - list.into_iter() - .filter(|path| path.is_file() && path.extension() == Some(OsStr::new("mv"))) - .collect::>() - })?; - Ok(list) -} + let file_path = if let Some(path) = str_to_path(file_name) { + path + } else { + search_by_file_name(&ctx.project_root_dir, file_name)? + }; -pub fn run_dove_package_build(ctx: &mut Context) -> Result<()> { - let build_cmd = MoveCommand::Package { - cmd: PackageCommand::Build {}, - }; - run_cli( - ctx.native_functions.clone(), - &ctx.cost_table, - &ctx.error_descriptions, - &ctx.move_args, - &build_cmd, - ) + Publish::try_from((&self.request, file_path))? + .apply() + .map(|address| { + println!("Address: {}", address); + }) + } } #[derive(Serialize, Deserialize, Debug, Default)] @@ -193,3 +188,87 @@ impl ModulePackage { bcs::to_bytes(&self).map_err(|err| err.into()) } } + +/// Return file paths from ./PROJECT_FOLDER/build/PROJECT_NAME/bytecode_modules +/// Only with the .mv extension +fn get_bytecode_modules_path(project_dir: &Path, project_name: &str) -> Result> { + let path = project_dir + .join("build") + .join(project_name) + .join("bytecode_modules"); + if !path.exists() { + return Ok(Vec::new()); + } + + search_by_extension(&path, &["mv"]) +} + +pub fn run_dove_package_build(ctx: &mut Context) -> Result<()> { + let build_cmd = MoveCommand::Package { + cmd: PackageCommand::Build {}, + }; + run_cli( + ctx.native_functions.clone(), + &ctx.cost_table, + &ctx.error_descriptions, + &ctx.move_args, + &build_cmd, + ) +} + +#[inline] +fn str_to_path(path: &str) -> Option { + PathBuf::from_str(path) + .ok() + .and_then(|path| path.canonicalize().ok()) +} + +/// Recursive file search by extension list +fn search_by_extension(path: &Path, list_extension: &[&str]) -> Result> { + let list = fs::read_dir(path)? + .map(|res| res.map(|e| e.path())) + .collect::, _>>()? + .into_iter() + .filter_map(|path| { + if path.is_dir() { + search_by_extension(&path, list_extension).ok() + } else if path.is_file() { + let ext = path + .extension() + .and_then(|t| t.to_str()) + .unwrap_or_default(); + if list_extension.contains(&ext) { + Some(vec![path]) + } else { + None + } + } else { + None + } + }) + .flatten() + .collect::>(); + Ok(list) +} + +fn search_by_file_name(path_project: &Path, file_name: &str) -> Result { + let mut list: Vec = search_by_extension(path_project, &["mv", "mvt", "pac"])? + .into_iter() + .filter(|path| { + let name_ext = path.file_name().and_then(|name| name.to_str()); + let name = path.file_stem().and_then(|name| name.to_str()); + name_ext == Some(file_name) || name == Some(file_name) + }) + .collect(); + if list.is_empty() { + bail!(r#"File named "{}" not found"#, file_name); + } else if list.len() > 1 { + let paths_string: String = list.iter().map(|path| path.display()).join("\n"); + bail!( + r"Found more than one file named {:?}\nSpecify the full path to the file\n{}", + file_name, + paths_string + ) + } + Ok(list.remove(0)) +} diff --git a/dove/src/cmd/key.rs b/dove/src/cmd/key.rs index 7d4b08a2..ef290a62 100644 --- a/dove/src/cmd/key.rs +++ b/dove/src/cmd/key.rs @@ -74,7 +74,7 @@ impl Key { fn add(alias: &str, without_password: bool) -> Result<()> { let alias = wallet_key::valid_alias(alias)?; - if wallet_key::isset(&alias) { + if wallet_key::existence(&alias) { bail!(r#"A key with name "{}" already exists"#, alias); } @@ -124,7 +124,7 @@ fn read_password() -> Result { Ok(password) } -fn cli_entering_a_secret_phrase() -> Result { +pub fn cli_entering_a_secret_phrase() -> Result { println!("Please enter secret phrase:"); let key_phrase = cli_read_line()?; diff --git a/dove/src/lib.rs b/dove/src/lib.rs index e304da84..76483adb 100644 --- a/dove/src/lib.rs +++ b/dove/src/lib.rs @@ -33,6 +33,8 @@ pub mod natives; /// To work with stored access keys pub mod wallet_key; +pub mod publish; + /// Get the location of the ".move" directory. /// Default: ~/.move/ /// If the directory "~/.move/" does not exist, it will be created. diff --git a/dove/src/publish.rs b/dove/src/publish.rs new file mode 100644 index 00000000..3b39263b --- /dev/null +++ b/dove/src/publish.rs @@ -0,0 +1,200 @@ +use std::path::PathBuf; + +use anyhow::Error; +use structopt::StructOpt; +use anyhow::Result; +use url::Url; + +use pontem_client::PontemClient; +use crate::cmd::key::cli_entering_a_secret_phrase; +use crate::wallet_key; +use crate::wallet_key::WalletKey; + +#[derive(StructOpt, Debug)] +#[structopt(setting(structopt::clap::AppSettings::ColoredHelp))] +pub struct NodeAccessParams { + /// Account from whom to publish. Address or test account name or name secret key. + /// Example: //Alice, alice, bob, NAME_WALLET_KEY... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + #[structopt(long = "account")] + account: Option, + + /// Secret phrase. + /// If a secret phrase is specified, you do not need to specify an account + #[structopt(long = "secret", short)] + secret_phrase: bool, + + /// The url of the substrate node to query + #[structopt( + long = "url", + short, + parse(try_from_str), + default_value = "ws://localhost:9944" + )] + url_to_node: Url, + + /// Limitation of gas consumption per operation + #[structopt(long = "gas", short)] + gas_limit: Option, +} + +impl NodeAccessParams { + pub fn need_to_publish(&self) -> bool { + self.account.is_some() || self.secret_phrase + } +} + +pub struct Publish { + /// Client for connecting to "Pontem" + client: PontemClient, + + /// Path to the file to be published + file_path: PathBuf, + + /// Limitation of gas consumption per operation + gas_limit: u64, + + /// Access type - by secret phrase or through a test account + access: AccessType, +} + +impl Publish { + pub fn apply(&self) -> Result { + match self.file_type()? { + FileType::Module => match &self.access { + AccessType::SecretPhrase(secret) => self.client.tx_mvm_publish_module( + self.file_path_as_str()?, + self.gas_limit, + secret, + ), + AccessType::TestAccount(test_account) => self.client.tx_mvm_publish_module_dev( + self.file_path_as_str()?, + self.gas_limit, + test_account, + ), + }, + FileType::Bundle => match &self.access { + AccessType::SecretPhrase(secret) => self.client.tx_mvm_publish_package( + self.file_path_as_str()?, + self.gas_limit, + secret, + ), + AccessType::TestAccount(test_account) => self.client.tx_mvm_publish_package_dev( + self.file_path_as_str()?, + self.gas_limit, + test_account, + ), + }, + FileType::TX => match &self.access { + AccessType::SecretPhrase(secret) => { + self.client + .tx_mvm_execute(self.file_path_as_str()?, self.gas_limit, secret) + } + AccessType::TestAccount(test_account) => self.client.tx_mvm_execute_dev( + self.file_path_as_str()?, + self.gas_limit, + test_account, + ), + }, + } + } +} + +/// PublishParamsCmd - Connection parameters +/// PathBuf - The path to the file to be published (*.mvt, *.mv, *.pac) +impl TryFrom<(&NodeAccessParams, PathBuf)> for Publish { + type Error = Error; + + fn try_from(value: (&NodeAccessParams, PathBuf)) -> std::result::Result { + let (params, file_path) = value; + let gas_limit = params + .gas_limit + .ok_or(anyhow!("Please specify gas limit"))?; + let mut url_to_node = params.url_to_node.clone(); + + let access = if params.secret_phrase { + // Request secret phrases + let secret = cli_entering_a_secret_phrase()?; + AccessType::SecretPhrase(secret) + } else if let Some(test_account_or_name_key) = ¶ms.account { + match cli_name_to_key(test_account_or_name_key)? { + Some(WalletKey { + secret_phrase, + node_address, + }) => { + url_to_node = node_address; + AccessType::SecretPhrase(secret_phrase) + } + None => AccessType::TestAccount(test_account_or_name_key.to_owned()), + } + } else { + bail!("Specify name of key or name of test account or secret phrase") + }; + + let client = PontemClient::new(url_to_node.as_str())?; + + Ok(Publish { + client, + access, + gas_limit, + file_path, + }) + } +} + +impl Publish { + fn file_type(&self) -> Result { + let ext = self + .file_path + .extension() + .and_then(|ext| ext.to_str()) + .unwrap_or_default() + .to_string(); + + Ok(match ext.as_str() { + "pac" => FileType::Bundle, + "mv" => FileType::Module, + "mvt" => FileType::TX, + _ => bail!( + "pac or mv extension was expected\n{}", + self.file_path.display() + ), + }) + } + + fn file_path_as_str(&self) -> Result<&str> { + self.file_path + .to_str() + .ok_or(anyhow!("Error converting path to string")) + } +} + +/// Access type - by secret phrase or through a test account +enum AccessType { + SecretPhrase(String), + TestAccount(String), +} + +enum FileType { + Bundle, + Module, + TX, +} + +/// Checking for a key with this name and getting the content +fn cli_name_to_key(key_name: &str) -> Result> { + // Checking for a saved key with this name + if !wallet_key::existence(key_name) { + return Ok(None); + } + + // Trying to get secret phrases without a password + let mut phrase = wallet_key::get(key_name, None); + if phrase.is_err() { + // Password required + println!("Please enter password for key:"); + let password = rpassword::read_password()?.trim().to_string(); + phrase = + wallet_key::get(key_name, Some(&password)).map_err(|_| anyhow!("Invalid password")) + } + phrase.map(Some) +} diff --git a/dove/src/wallet_key.rs b/dove/src/wallet_key.rs index d2e33175..99df0baf 100644 --- a/dove/src/wallet_key.rs +++ b/dove/src/wallet_key.rs @@ -68,7 +68,7 @@ pub fn get(alias: &str, password: Option<&str>) -> Result { /// Check if there is a secret phrase with this alias /// ~/.move/.key #[inline] -pub fn isset(alias: &str) -> bool { +pub fn existence(alias: &str) -> bool { path(alias).map_or(false, |path| path.exists()) } diff --git a/dove/tests/test_cmd_dove_deploy.rs b/dove/tests/test_cmd_dove_deploy.rs new file mode 100644 index 00000000..4ee5b1c6 --- /dev/null +++ b/dove/tests/test_cmd_dove_deploy.rs @@ -0,0 +1,46 @@ +mod helpers; + +use std::fs; +use std::io::Read; +use helpers::{delete_project, dove, new_demo_project}; + +/// Build a project and package +/// $ dove deploy --modules_exclude Demo1v Demo2v +#[test] +fn test_cmd_dove_deploy() { + let project_name = "project_deploy"; + let project_path = new_demo_project(project_name).unwrap(); + + dove( + &["deploy", "--modules_exclude", "Demo1v", "Demo2v"], + &project_path, + ) + .unwrap(); + + let mut content = Vec::new(); + fs::File::open( + project_path + .join("build") + .join("for_tests") + .join("bundles") + .join("for_tests.pac"), + ) + .unwrap() + .read_to_end(&mut content) + .unwrap(); + + assert!(find_u8(&content, b"Demo3v")); + assert!(!find_u8(&content, b"Demo2v")); + assert!(!find_u8(&content, b"Demo1v")); + assert!(!find_u8(&content, b"main")); + + delete_project(&project_path).unwrap(); +} + +fn find_u8(source: &[u8], need: &[u8]) -> bool { + source.iter().enumerate().any(|(pos, _)| { + need.iter() + .enumerate() + .all(|(index, byte)| Some(byte) == source.get(index + pos)) + }) +} diff --git a/pontem/client/Cargo.toml b/pontem/client/Cargo.toml new file mode 100644 index 00000000..2402a2b2 --- /dev/null +++ b/pontem/client/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "pontem-client" +version = "0.15.0" +edition = "2021" + +# the script for building the library "subxt" +build = "build.rs" + +[dependencies] +anyhow = "1.0" +libloading = ">=0.6" +rand = ">=0.3" +url = ">=2" +# +hash_project = { path = "../hash_project" } + +[dev-dependencies] +env_logger = "0.9" +log = "0.4" diff --git a/pontem/client/build.rs b/pontem/client/build.rs new file mode 100644 index 00000000..aedfde33 --- /dev/null +++ b/pontem/client/build.rs @@ -0,0 +1,19 @@ +use std::path::PathBuf; + +fn main() { + println!(r#"Building: pontemapi"#); + + let lib_path = PathBuf::from("../pontemapi").canonicalize().unwrap(); + let result = std::process::Command::new("cargo") + .args(["build", "--release"]) + .current_dir(&lib_path) + .output() + .unwrap(); + + if result.status.code() != Some(0) { + let error = String::from_utf8(result.stderr).unwrap_or_default(); + println!("Error: {}", error); + panic!(r#"Failed to create "pontemapi" library"#); + } + println!(r#"Building of the "pontempi" library is completed"#) +} diff --git a/pontem/client/src/lib.rs b/pontem/client/src/lib.rs new file mode 100644 index 00000000..7f709600 --- /dev/null +++ b/pontem/client/src/lib.rs @@ -0,0 +1,223 @@ +use std::fs; +use anyhow::{Error, Result}; +use libloading::Library; +use url::Url; + +/// Path to the compiled library +#[cfg(target_os = "linux")] +const LIB_PONTEMAPI: &[u8] = include_bytes!("../../pontemapi/target/release/libpontemapi.so"); + +/// Path to the compiled library +#[cfg(target_os = "macos")] +const LIB_PONTEMAPI: &[u8] = include_bytes!("../../pontemapi/target/release/libpontemapi.dylib"); + +/// Path to the compiled library +#[cfg(target_os = "windows")] +const LIB_PONTEMAPI: &[u8] = include_bytes!("../../pontemapi/target/release/libpontemapi.dll"); + +/// Library Version pontemapi +#[cfg(not(doc))] +const LIB_VERSION: &str = hash_project::version!("pontem/pontemapi"); + +/// Docgen is launched from the current directory +#[cfg(doc)] +const LIB_VERSION: &str = hash_project::version!("../pontemapi"); + +/// Type of function from the library +type FnInterface = unsafe fn(&str, &str, u64, &str) -> Result; + +/// Client for publishing module, bundle, transactions to node +pub struct PontemClient { + lib: Library, + /// url: Node address. ws://127.0.0.1:9944 + url: Url, +} + +impl PontemClient { + /// Creating a temporary library file and initializing the library + /// url: Node address. ws://127.0.0.1:9944 + pub fn new(url: &str) -> Result { + let url = Url::parse(url)?; + let lib = PontemClient::load()?; + + Ok(PontemClient { lib, url }) + } + + /// Publishing the module. + /// package_path: The path to the module file. PATH/TO/MODULE/FILE.mv + /// gas: Gas limit for transaction execution. + /// key_phrase: secret keyphrase + pub fn tx_mvm_publish_module( + &self, + module_path: &str, + gas: u64, + key_phrase: &str, + ) -> Result { + unsafe { + let func: libloading::Symbol = self.lib.get(b"tx_mvm_publish_module")?; + func(module_path, self.url.as_str(), gas, key_phrase) + } + } + + /// (DEV) Publishing the module. + /// package_path: The path to the module file. PATH/TO/MODULE/FILE.mv + /// gas: Gas limit for transaction execution. + /// signer: alias or ss58 address of the test account. //Alice, alice, bob... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + pub fn tx_mvm_publish_module_dev( + &self, + module_path: &str, + gas: u64, + signer: &str, + ) -> Result { + unsafe { + let func: libloading::Symbol = + self.lib.get(b"tx_mvm_publish_module_dev")?; + func(module_path, self.url.as_str(), gas, signer) + } + } + + /// Transaction execution + /// transaction_path: The path to the transaction file. PATH/TO/TRANSACTION/FILE.mv + /// gas: Gas limit for transaction execution. + /// key_phrase: secret keyphrase + pub fn tx_mvm_execute( + &self, + transaction_path: &str, + gas: u64, + key_phrase: &str, + ) -> Result { + unsafe { + let func: libloading::Symbol = self.lib.get(b"tx_mvm_execute")?; + func(transaction_path, self.url.as_str(), gas, key_phrase) + } + } + + /// (DEV) Transaction execution + /// transaction_path: The path to the transaction file. PATH/TO/TRANSACTION/FILE.mv + /// gas: Gas limit for transaction execution. + /// test_account: alias or ss58 address of the test account. //Alice, alice, bob... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + pub fn tx_mvm_execute_dev( + &self, + transaction_path: &str, + gas: u64, + test_account: &str, + ) -> Result { + unsafe { + let func: libloading::Symbol = self.lib.get(b"tx_mvm_execute_dev")?; + func(transaction_path, self.url.as_str(), gas, test_account) + } + } + + /// Publishing the package + /// package_path: The path to the package file. PATH/TO/PACKAGE/FILE.mv + /// gas: Gas limit for transaction execution. + /// key_phrase: secret keyphrase + pub fn tx_mvm_publish_package( + &self, + package_path: &str, + gas: u64, + key_phrase: &str, + ) -> Result { + unsafe { + let func: libloading::Symbol = + self.lib.get(b"tx_mvm_publish_package")?; + func(package_path, self.url.as_str(), gas, key_phrase) + } + } + + /// (DEV) Publishing the package + /// package_path: The path to the package file. PATH/TO/PACKAGE/FILE.mv + /// gas: Gas limit for transaction execution. + /// signer: alias or ss58 address of the test account. //Alice, alice, bob... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + pub fn tx_mvm_publish_package_dev( + &self, + package_path: &str, + gas: u64, + signer: &str, + ) -> Result { + unsafe { + let func: libloading::Symbol = + self.lib.get(b"tx_mvm_publish_package_dev")?; + func(package_path, self.url.as_str(), gas, signer) + } + } + + /// Library Version + pub fn version(&self) -> Result { + let result = unsafe { + let func: libloading::Symbol String> = self.lib.get(b"version")?; + func() + }; + Ok(result) + } + + /// Create a library in a temporary folder + /// /libpontemapi.so + fn load() -> Result { + let name_file = format!("libpontemapi_{}", LIB_VERSION); + let path = std::env::temp_dir().join(name_file); + if !path.exists() { + fs::write(&path, LIB_PONTEMAPI)?; + } + let lib = unsafe { libloading::Library::new(path.as_os_str())? }; + Ok(lib) + } +} + +impl Default for PontemClient { + fn default() -> Self { + PontemClient::new("ws://127.0.0.1:9944").unwrap() + } +} + +#[cfg(test)] +mod tests { + use log::debug; + use crate::PontemClient; + + #[test] + fn test_version() { + let version = PontemClient::default().version().unwrap(); + println!("version: {}", &version); + } + + #[test] + #[ignore] + fn test_tx_mvm_publish_module_dev() { + env_logger::init(); + + let client = PontemClient::default(); + let result = client + .tx_mvm_publish_module_dev("../pontemapi/Alice_Store.mv", 100, "//Alice") + .unwrap(); + debug!("result: {}", result); + } + + #[test] + #[ignore] + fn test_tx_mvm_execute_dev() { + env_logger::init(); + + let client = PontemClient::default(); + let result = client + .tx_mvm_execute_dev("../pontemapi/Alice_Main.mvt", 100, "alice") + .unwrap(); + debug!("result: {}", result); + } + + #[test] + #[ignore] + fn test_tx_mvm_publish_package_dev() { + env_logger::init(); + + let client = PontemClient::default(); + let result = client + .tx_mvm_publish_package_dev( + "../pontemapi/Alice_Store.pac", + 1000, + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + ) + .unwrap(); + debug!("result: {}", result); + } +} diff --git a/pontem/hash_project/Cargo.toml b/pontem/hash_project/Cargo.toml new file mode 100644 index 00000000..994c960b --- /dev/null +++ b/pontem/hash_project/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "hash_project" +version = "0.1.0" +edition = "2021" + +[lib] +proc-macro = true + +[workspace] + +[dependencies] +anyhow = "1.0" +sha256 = "1.0" +log = "0.4" +toml = "0.5" + +[dev-dependencies] +env_logger = "0.9" \ No newline at end of file diff --git a/pontem/hash_project/src/lib.rs b/pontem/hash_project/src/lib.rs new file mode 100644 index 00000000..9589b064 --- /dev/null +++ b/pontem/hash_project/src/lib.rs @@ -0,0 +1,106 @@ +use std::path::{Path, PathBuf}; +use std::str::FromStr; +use std::fs; +use proc_macro::TokenStream; +use anyhow::{Result}; +use log::debug; +use toml::Value; + +/// Get the project version and a short hash +#[proc_macro] +pub fn version(item: TokenStream) -> TokenStream { + let params = item.to_string(); + let path = params.trim_matches('"'); + let full_version = version_with_shorthash(path).unwrap(); + format!(r#""{}""#, &full_version).parse().unwrap() +} + +/// Get the project version and a short hash +fn version_with_shorthash(project_path: &str) -> Result { + debug!("project_path: {}", project_path); + debug!( + "current_path: {}", + PathBuf::from_str(".")?.canonicalize()?.display() + ); + + let path = PathBuf::from_str(project_path)?.canonicalize()?; + debug!("path: {}", path.display()); + + let full_hash = hash_project(&path)?; + debug!("long hash: {}", &full_hash); + + let short_hash = &full_hash[..8]; + debug!("short hash: {}", short_hash); + + let version = version_project(&path)?; + debug!("Version: {}", &version); + + Ok(format!("{}_{}", version, short_hash)) +} + +/// Full project hash +fn hash_project(path: &Path) -> Result { + let files = project_files(&path)?; + + let hash = files + .iter() + .filter_map(|path| sha256::digest_file(&path).ok()) + .collect::>() + .join(""); + Ok(sha256::digest_bytes(hash.as_bytes())) +} + +fn version_project(path: &Path) -> Result { + let file = fs::read_to_string(path.join("Cargo.toml"))?.parse::()?; + + Ok(file + .as_table() + .and_then(|value| value.get("package")) + .and_then(|value| value.get("version")) + .and_then(|value| value.as_str().map(|v| v.to_string())) + .unwrap_or("0.0.0".to_string())) +} + +/// List of project files +fn project_files(path: &Path) -> Result> { + let result: Vec = fs::read_dir(&path)? + .filter_map(|path| path.ok()) + .map(|path| path.path()) + .filter_map(|path| { + if path.is_dir() { + let name = path.file_name()?.to_str()?; + if ["target", "debug", "release", ".idea"].contains(&name) { + None + } else { + project_files(&path).ok() + } + } else if path.is_file() { + let ext = path.extension()?.to_str()?; + if ["rs", "toml", "lock"].contains(&ext) { + Some(vec![path]) + } else { + None + } + } else { + None + } + }) + .flatten() + .collect(); + + Ok(result) +} + +#[cfg(test)] +mod tests { + use log::debug; + use crate::{version_with_shorthash}; + + #[test] + fn test_version_with_shorthash() { + env_logger::init(); + + let version = version_with_shorthash("../pontemapi").unwrap(); + debug!("{:?}", version); + } +} diff --git a/pontem/pontemapi/Cargo.lock b/pontem/pontemapi/Cargo.lock new file mode 100644 index 00000000..6b4ebe83 --- /dev/null +++ b/pontem/pontemapi/Cargo.lock @@ -0,0 +1,3021 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.4", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-trait" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "backtrace" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "beef" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed554bd50246729a1ec158d08aa3235d1b69d94ad120ebe187e28894787e736" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "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 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.5", +] + +[[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 = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + +[[package]] +name = "byte-slice-cast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d30c751592b77c499e7bce34d99d67c2c11bdc0574e9a488ddade14150a4698" + +[[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.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cc" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chameleon" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bd83544cd11113170ce1eee45383928f3f720bc8b305af18c2a3da3547e1ae" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "winapi", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +dependencies = [ + "libc", +] + +[[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.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.5", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.5", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.5", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dyn-clone" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" + +[[package]] +name = "ed25519" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "environmental" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.4", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "frame-metadata" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ed5e5c346de62ca5c184b4325a6600d1eaca210666e4606fe4e449574978d0" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + +[[package]] +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-macro" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" + +[[package]] +name = "h2" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hash_project" +version = "0.1.0" +dependencies = [ + "anyhow", + "log", + "sha256", + "toml", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.5", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.1", +] + +[[package]] +name = "http-body" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7ec3e62bdc98a2f0393a5048e4c30ef659440ea6e0e572965103e72bd836f55" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 0.4.8", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +dependencies = [ + "http", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "webpki-roots", +] + +[[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.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "indexmap" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + +[[package]] +name = "js-sys" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5b02d34b7d70caa454dcf79914d70d9ef6edecef84b9261f499a9f3521b7935" +dependencies = [ + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-types", + "jsonrpsee-utils", + "jsonrpsee-ws-client", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea17b6d6da182fc4b293e0bebea5cc72e194d9392f485fb4051488af3edd1cd" +dependencies = [ + "async-trait", + "fnv", + "hyper", + "hyper-rustls", + "jsonrpsee-types", + "jsonrpsee-utils", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfdf283c6c3403ce9969700177bbcf35a695576fc2d993f38ab32a690631a96" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d822e0fc7be95e5085da5d61508bf5e3d5c1614dd235402086ec5c1cb15bdfa" +dependencies = [ + "anyhow", + "async-trait", + "beef", + "futures-channel", + "futures-util", + "hyper", + "serde", + "serde_json", + "soketto", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-utils" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e722316d556c5228624fb1cc7ea672f6ed163e60183e93f11d3ee979417331cb" +dependencies = [ + "arrayvec 0.7.2", + "beef", + "futures-util", + "hyper", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "664d2c9443cb1171e2414c66e0f0b44040eb2cff073455a0d168984eee178159" +dependencies = [ + "async-trait", + "fnv", + "futures", + "http", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "lock_api" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + +[[package]] +name = "memory-db" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de006e09d04fc301a5f7e817b75aa49801c4479a8af753764416b085337ddcc5" +dependencies = [ + "hash-db", + "hashbrown", + "parity-util-mem", +] + +[[package]] +name = "memory_units" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.2", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-util-mem" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f4cb4e169446179cbc6b8b6320cc9fca49bd2e94e8db25f25f200a8ea774770" +dependencies = [ + "cfg-if", + "hashbrown", + "impl-trait-for-tuples", + "parity-util-mem-derive", + "parking_lot", + "primitive-types", + "winapi", +] + +[[package]] +name = "parity-util-mem-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" +dependencies = [ + "proc-macro2", + "syn", + "synstructure", +] + +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "paste" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pontemapi" +version = "0.15.0" +dependencies = [ + "anyhow", + "hash_project", + "hex", + "log", + "parity-scale-codec", + "sp-core", + "sp-keyring", + "subxt", + "tokio", + "url", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 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_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.4", +] + +[[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_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca9ebdfa27d3fc180e42879037b5338ab1c040c06affd00d8338598e7800943" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64 0.13.0", +] + +[[package]] +name = "ryu" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" + +[[package]] +name = "scale-info" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +dependencies = [ + "lazy_static", + "winapi", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" + +[[package]] +name = "serde" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +dependencies = [ + "itoa 1.0.1", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha256" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e84a7f596c081d359de5e06a83877138bc3c4483591e1af1916e1472e6e146e" +dependencies = [ + "hex", + "sha2 0.9.9", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signature" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" + +[[package]] +name = "slab" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" + +[[package]] +name = "smallvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.0", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.4", + "sha-1", +] + +[[package]] +name = "sp-application-crypto" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-debug-derive", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-core" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "base58", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec", + "parity-util-mem", + "parking_lot", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secrecy", + "serde", + "sha2 0.9.9", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "twox-hash", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-debug-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-externalities" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-io" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "futures", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec", + "parking_lot", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-wasm-interface", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keyring" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "lazy_static", + "sp-core", + "sp-runtime", + "strum", +] + +[[package]] +name = "sp-keystore" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "async-trait", + "derive_more", + "futures", + "merlin", + "parity-scale-codec", + "parking_lot", + "schnorrkel", + "sp-core", + "sp-externalities", +] + +[[package]] +name = "sp-panic-handler" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "backtrace", +] + +[[package]] +name = "sp-runtime" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-runtime-interface" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "Inflector", + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-state-machine" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot", + "rand 0.7.3", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-std" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" + +[[package]] +name = "sp-storage" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-tracing" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-trie" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-std", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-wasm-interface" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate/?branch=polkadot-v0.9.12#d76f39995315ec36980908e4b99709bd14927044" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-std", + "wasmi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "ss58-registry" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8319f44e20b42e5c11b88b1ad4130c35fe2974665a007b08b02322070177136a" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "subxt" +version = "0.15.0" +source = "git+https://github.com/pontem-network/subxt?branch=master#6d736a11779ea55772e3475c394fe5ff69990015" +dependencies = [ + "async-trait", + "bitvec", + "chameleon", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "log", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "serde_json", + "sp-core", + "sp-runtime", + "sp-version", + "subxt-macro", + "thiserror", + "url", +] + +[[package]] +name = "subxt-codegen" +version = "0.2.0" +source = "git+https://github.com/pontem-network/subxt?branch=master#6d736a11779ea55772e3475c394fe5ff69990015" +dependencies = [ + "async-trait", + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-crate 0.1.5", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.1.0" +source = "git+https://github.com/pontem-network/subxt?branch=master#6d736a11779ea55772e3475c394fe5ff69990015" +dependencies = [ + "async-trait", + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-crate 0.1.5", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-codegen", + "syn", +] + +[[package]] +name = "syn" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" +dependencies = [ + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "pin-project-lite", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" + +[[package]] +name = "tracing" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8276d9a4a3a558d7b7ad5303ad50b53d58264641b82914b7ada36bd762e7a716" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" +dependencies = [ + "lazy_static", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "trie-db" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eac131e334e81b6b3be07399482042838adcd7957aa0010231d0813e39e02fa" +dependencies = [ + "hash-db", + "hashbrown", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "652931506d2c1244d7217a70b99f56718a7b4161b37f04e7cd868072a99f68cd" +dependencies = [ + "hash-db", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "twox-hash" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" +dependencies = [ + "cfg-if", + "rand 0.8.4", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uint" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "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 = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" + +[[package]] +name = "wasmi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +dependencies = [ + "downcast-rs", + "libc", + "memory_units", + "num-rational", + "num-traits", + "parity-wasm", + "wasmi-validation", +] + +[[package]] +name = "wasmi-validation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "web-sys" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[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 = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + +[[package]] +name = "zeroize" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] diff --git a/pontem/pontemapi/Cargo.toml b/pontem/pontemapi/Cargo.toml new file mode 100644 index 00000000..97515c22 --- /dev/null +++ b/pontem/pontemapi/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "pontemapi" +version = "0.15.0" +edition = "2021" + +[lib] +crate_type = ["cdylib"] + +[workspace] + +[dependencies] +hex = "0.4" +log = "0.4" +anyhow = "1.0" +url = "2" +tokio = "1" +codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive", "full", "bit-vec"] } +subxt = { git = "https://github.com/pontem-network/subxt", branch = "master" } +sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "polkadot-v0.9.12" } +sp-core = { git = "https://github.com/paritytech/substrate/", branch = "polkadot-v0.9.12" } +# +hash_project = { package="hash_project", path = "../hash_project" } + diff --git a/pontem/pontemapi/metadata/pontem.scale b/pontem/pontemapi/metadata/pontem.scale new file mode 100644 index 00000000..f066412a Binary files /dev/null and b/pontem/pontemapi/metadata/pontem.scale differ diff --git a/pontem/pontemapi/src/lib.rs b/pontem/pontemapi/src/lib.rs new file mode 100644 index 00000000..0073d501 --- /dev/null +++ b/pontem/pontemapi/src/lib.rs @@ -0,0 +1,603 @@ +use std::fs; +use std::str::FromStr; +use std::path::PathBuf; +use anyhow::{Result, anyhow, ensure}; +use log::debug; +use url::{Url, Origin}; +use sp_core::crypto::{AccountId32, Ss58Codec}; +use sp_core::crypto::Pair; +use sp_core::sr25519::Pair as sr25519Pair; +use sp_keyring::AccountKeyring; +use subxt::{ClientBuilder, EventSubscription, Metadata, PairSigner}; + +/// Library version with a short hash +const VERSION: &str = hash_project::version!("."); + +/// metadata for encoding and decoding +#[subxt::subxt( + runtime_metadata_path = "metadata/pontem.scale", + generated_type_derives = "Clone, Debug" +)] +pub mod pontem {} + +/// Implementation of the missing "traits" +const _: () = { + use pontem::runtime_types::polkadot_parachain::primitives::Id; + + impl PartialEq for Id { + fn eq(&self, other: &Self) -> bool { + self.0 == other.0 + } + } + + impl Eq for Id {} + + impl PartialOrd for Id { + fn partial_cmp(&self, other: &Self) -> Option { + self.0.partial_cmp(&other.0) + } + } + + impl Ord for Id { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.0.cmp(&other.0) + } + } +}; + +use crate::pontem::DefaultConfig; +use crate::pontem::runtime_types::sp_runtime::DispatchError; + +/// Public interface for publishing the module +/// module_path: The path to the module file. PATH/TO/MODULE/FILE.mv +/// url: Node address. ws://127.0.0.1:9944 +/// gas: Gas limit for transaction execution. +/// key_phrase: secret keyphrase +#[export_name = "tx_mvm_publish_module"] +pub fn tx_mvm_publish_module( + module_path: &str, + url_str: &str, + gas: u64, + key_phrase: &str, +) -> Result { + let context = Context::from_keyphrase(module_path, url_str, gas, key_phrase)?; + debug!("fn tx_mvm_publish_module:\n{}", context.debug()); + + let result = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(pb_module(context)); + + result +} + +/// (DEV) Public interface for publishing the module +/// module_path: The path to the module file. PATH/TO/MODULE/FILE.mv +/// url: Node address. ws://127.0.0.1:9944 +/// gas: Gas limit for transaction execution. +/// test_signer: alias or ss58 address of the test account. //Alice, alice, bob... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY +#[export_name = "tx_mvm_publish_module_dev"] +pub fn tx_mvm_publish_module_dev( + module_path: &str, + url_str: &str, + gas: u64, + test_signer: &str, +) -> Result { + let context = Context::from_dev(module_path, url_str, gas, test_signer)?; + debug!("fn tx_mvm_publish_module_dev:\n{}", context.debug()); + + let result = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(pb_module(context)); + + result +} + +/// Public interface for transaction execution +/// transaction_path: The path to the transaction file. PATH/TO/TRANSACTION/FILE.mv +/// url: Node address. ws://127.0.0.1:9944 +/// gas: Gas limit for transaction execution. +/// key_phrase: secret keyphrase +#[export_name = "tx_mvm_execute"] +pub fn tx_mvm_execute( + transaction_path: &str, + url_str: &str, + gas: u64, + key_phrase: &str, +) -> Result { + let context = Context::from_keyphrase(transaction_path, url_str, gas, key_phrase)?; + debug!("fn tx_mvm_execute:\n{}", context.debug()); + + let result = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(execute(context)); + + result +} + +/// (DEV) Public interface for transaction execution +/// transaction_path: The path to the transaction file. PATH/TO/TRANSACTION/FILE.mv +/// url: Node address. ws://127.0.0.1:9944 +/// gas: Gas limit for transaction execution. +/// test_signer: alias or ss58 address of the test account. //Alice, alice, bob... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY +#[export_name = "tx_mvm_execute_dev"] +pub fn tx_mvm_execute_dev( + transaction_path: &str, + url_str: &str, + gas: u64, + test_signer: &str, +) -> Result { + let context = Context::from_dev(transaction_path, url_str, gas, test_signer)?; + debug!("fn tx_mvm_execute_dev:\n{}", context.debug()); + + let result = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(execute(context)); + + result +} + +/// Public interface for publishing the package +/// package_path: The path to the package file. PATH/TO/PACKAGE/FILE.mv +/// url: Node address. ws://127.0.0.1:9944 +/// gas: Gas limit for transaction execution. +/// key_phrase: secret keyphrase +#[export_name = "tx_mvm_publish_package"] +pub fn tx_mvm_publish_package( + package_path: &str, + url_str: &str, + gas: u64, + key_phrase: &str, +) -> Result { + let context = Context::from_keyphrase(package_path, url_str, gas, key_phrase)?; + debug!("fn tx_mvm_publish_package:\n{}", context.debug()); + + let result = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(pb_package_dev(context)); + + result +} + +/// (DEV) Public interface for publishing the package +/// package_path: The path to the package file. PATH/TO/PACKAGE/FILE.mv +/// url: Node address. ws://127.0.0.1:9944 +/// gas: Gas limit for transaction execution. +/// test_signer: alias or ss58 address of the test account. //Alice, alice, bob... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY +#[export_name = "tx_mvm_publish_package_dev"] +pub fn tx_mvm_publish_package_dev( + package_path: &str, + url_str: &str, + gas: u64, + test_signer: &str, +) -> Result { + let context = Context::from_dev(package_path, url_str, gas, test_signer)?; + debug!("fn tx_mvm_publish_package_dev:\n{}", context.debug()); + + let result = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(pb_package_dev(context)); + + result +} + +/// Library Version +#[no_mangle] +pub fn version() -> String { + VERSION.to_string() +} + +/// Publish a module +async fn pb_module(context: Context) -> Result { + debug!("Reading a file: {}", context.path_file.display()); + let module = fs::read(&context.path_file)?; + let pair_signer: PairSigner = + PairSigner::new(context.pair.clone()); + + let api = ClientBuilder::new() + .set_url(context.url.clone()) + .build() + .await? + .to_runtime_api::>(); + + let hash = api + .tx() + .mvm() + .publish_module(module, context.gas) + .sign_and_submit(&pair_signer) + .await? + .to_string(); + + // Only for Websocket you can get the result of publishing + if !context.is_connection_ws() { + return Ok(hash); + } + + // It is necessary to decrypt the message + let metadata = api.client.metadata(); + // Subscribe to events + let sub = api.client.rpc().subscribe_events().await?; + let decoder = api.client.events_decoder(); + let mut sub = EventSubscription::::new(sub, decoder); + + let mut last = 0; + loop { + let raw = sub.next().await.ok_or(anyhow!("No response received"))??; + + match raw.variant.as_str() { + // The event is triggered 3 times. If the event was triggered after "ModulePublished", it is final + "ExtrinsicSuccess" => { + if last == 1 { + return Ok(hash); + } + } + // Called when a module publishing error occurs + "ExtrinsicFailed" => { + let answer = ::decode( + &mut &raw.data[..], + )?; + return Err(anyhow!(dispatcherror_to_string(answer.0, metadata))); + } + // The module is published. Not the last event + "ModulePublished" | "Event" => last = 1, + _ => {} + } + } +} + +/// Transaction execution +async fn execute(context: Context) -> Result { + debug!("Reading a file: {}", context.path_file.display()); + let transaction = fs::read(&context.path_file)?; + let signer_pair: PairSigner = + PairSigner::new(context.pair.clone()); + + let api = ClientBuilder::new() + .set_url(context.url.clone()) + .build() + .await? + .to_runtime_api::>(); + + let hash = api + .tx() + .mvm() + .execute(transaction, context.gas) + .sign_and_submit(&signer_pair) + .await? + .to_string(); + + // Only for Websocket you can get the result of publishing + if !context.is_connection_ws() { + return Ok(hash); + } + + // Subscribe to events + let sub = api.client.rpc().subscribe_events().await?; + let decoder = api.client.events_decoder(); + let mut sub = EventSubscription::::new(sub, decoder); + // It is necessary to decrypt the message + let metadata = api.client.metadata(); + + let mut last = 0; + loop { + let raw = sub.next().await.ok_or(anyhow!("No response received"))??; + + debug!("event {}", raw.variant.as_str()); + match raw.variant.as_str() { + // The event is triggered 4 times + "ExtrinsicSuccess" => { + last += 1; + if last == 4 { + return Ok(hash); + } + } + // Called when a module execute error occurs + "ExtrinsicFailed" => { + let answer = ::decode( + &mut &raw.data[..], + )?; + return Err(anyhow!(dispatcherror_to_string(answer.0, metadata))); + } + _ => {} + } + } +} + +/// Publish a package +async fn pb_package_dev(context: Context) -> Result { + debug!("Reading a file: {}", context.path_file.display()); + let package = fs::read(&context.path_file)?; + let signer_pair: PairSigner = + PairSigner::new(context.pair.clone()); + + let api = ClientBuilder::new() + .set_url(context.url.clone()) + .build() + .await? + .to_runtime_api::>(); + + let hash = api + .tx() + .mvm() + .publish_package(package, context.gas) + .sign_and_submit(&signer_pair) + .await? + .to_string(); + + // Only for Websocket you can get the result of publishing + if !context.is_connection_ws() { + return Ok(hash); + } + + // Subscribe to events + let sub = api.client.rpc().subscribe_events().await?; + let decoder = api.client.events_decoder(); + let mut sub = EventSubscription::::new(sub, decoder); + // It is necessary to decrypt the message + let metadata = api.client.metadata(); + + let mut last = 0; + loop { + let raw = sub.next().await.ok_or(anyhow!("No response received"))??; + + debug!("event {}", raw.variant.as_str()); + match raw.variant.as_str() { + // The event is triggered 4 times + "ExtrinsicSuccess" => { + last += 1; + if last == 4 { + return Ok(hash); + } + } + // Called when a module publishing error occurs + "ExtrinsicFailed" => { + let answer = ::decode( + &mut &raw.data[..], + )?; + return Err(anyhow!(dispatcherror_to_string(answer.0, metadata))); + } + _ => {} + } + } +} + +/// Converting a test account alias or ss58 address into a keyring +fn test_keyring_from_str(signer: &str) -> Result { + let signer_lowercase = signer.strip_prefix("//").unwrap_or(signer).to_lowercase(); + + let keyring = match signer_lowercase.as_str() { + "alice" => AccountKeyring::Alice, + "bob" => AccountKeyring::Bob, + "charlie" => AccountKeyring::Charlie, + "dave" => AccountKeyring::Dave, + "eve" => AccountKeyring::Eve, + "ferdie" => AccountKeyring::Ferdie, + "one" => AccountKeyring::One, + "two" => AccountKeyring::Two, + _ => { + let account_id = + AccountId32::from_string(signer).map_err(|err| anyhow!("{:?}", err))?; + AccountKeyring::from_account_id(&account_id) + .ok_or(anyhow!(r#"Failed to get "keyring""#))? + } + }; + Ok(keyring) +} + +/// Converting an error to a string. Error when calling an external function in the node +fn dispatcherror_to_string(error: DispatchError, meta: &Metadata) -> String { + use crate::pontem::runtime_types::sp_runtime::{ArithmeticError, TokenError}; + match error { + DispatchError::Other => "Other".to_string(), + DispatchError::CannotLookup => "CannotLookup".to_string(), + DispatchError::BadOrigin => "BadOrigin".to_string(), + DispatchError::Module { index, error } => match meta.error(index, error) { + Ok(ok) => format!( + "Pallet: {pallet}\n\ + Error: {error}\n\ + Description: {description}", + pallet = ok.pallet(), + error = ok.error(), + description = ok.description().join(" ") + ), + Err(_) => format!("Error not found: {} {}", index, error), + }, + DispatchError::ConsumerRemaining => "ConsumerRemaining".to_string(), + DispatchError::NoProviders => "NoProviders".to_string(), + DispatchError::Token(value) => match value { + TokenError::NoFunds => "Token.NoFunds", + TokenError::WouldDie => "Token.WouldDie", + TokenError::BelowMinimum => "Token.BelowMinimum", + TokenError::CannotCreate => "Token.CannotCreate", + TokenError::UnknownAsset => "Token.UnknownAsset", + TokenError::Frozen => "Token.Frozen", + TokenError::Unsupported => "Token.Unsupported", + } + .to_string(), + DispatchError::Arithmetic(value) => match value { + ArithmeticError::Underflow => "Arithmetic.Underflow", + ArithmeticError::Overflow => "Arithmetic.Overflow", + ArithmeticError::DivisionByZero => "Arithmetic.DivisionByZero", + } + .to_string(), + } +} + +struct Context { + /// The path to the module|package|transaction file. PATH/TO/FILE.mv + pub path_file: PathBuf, + /// Node address. ws://127.0.0.1:9944 + pub url: Url, + /// Gas limit for transaction execution. + pub gas: u64, + /// ss58 address + pub signer: String, + /// Keypair. An Schnorrkel/Ristretto x25519 ("sr25519") key pair. + pub pair: sr25519Pair, +} + +impl Context { + /// Create Context + /// path_str: The path to the module|package|transaction file. PATH/TO/FILE.mv + /// url_str: Node address. ws://127.0.0.1:9944 + /// gas: Gas limit for transaction execution. + /// test_signer: alias or ss58 address of the test account. //Alice, alice, bob... or 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + pub fn from_dev( + path_str: &str, + url_str: &str, + gas: u64, + test_signer: &str, + ) -> Result { + let pair = test_keyring_from_str(test_signer)?.pair(); + Self::from_pair(path_str, url_str, gas, pair) + } + + /// Create Context + /// path_str: The path to the module file. PATH/TO/FILE.mv + /// url_str: Node address. ws://127.0.0.1:9944 + /// gas: Gas limit for transaction execution. + /// key_phrase: secret keyphrase + pub fn from_keyphrase( + path_str: &str, + url_str: &str, + gas: u64, + key_phrase: &str, + ) -> Result { + let pair = + sr25519Pair::from_string(key_phrase, None).map_err(|err| anyhow!("{:?}", err))?; + Self::from_pair(path_str, url_str, gas, pair) + } + + /// Create Context + /// path_str: The path to the module file. PATH/TO/FILE.mv + /// url_str: Node address. ws://127.0.0.1:9944 + /// gas: Gas limit for transaction execution. + /// pair: An Schnorrkel/Ristretto x25519 ("sr25519") key pair. + pub fn from_pair( + path_str: &str, + url_str: &str, + gas: u64, + pair: sr25519Pair, + ) -> Result { + let url = Url::from_str(url_str)?; + let signer = AccountId32::new(pair.public().0).to_ss58check(); + + let mut path_file = PathBuf::from_str(path_str)?; + ensure!( + path_file.exists(), + "File not found for publication. \n\ + Path: {path}", + path = path_file.display(), + ); + path_file = path_file.canonicalize()?; + + Ok(Context { + path_file, + pair, + url, + gas, + signer, + }) + } + + /// Returns an object as a string + pub fn debug(&self) -> String { + format!( + "path: {path}\n\ + Url: {url}\n\ + Gas: {gas}\n\ + Signer:{signer}", + path = self.path_file.display(), + gas = self.gas, + signer = &self.signer, + url = &self.url + ) + } + + /// is the connection via a web socket + pub fn is_connection_ws(&self) -> bool { + match self.url.origin() { + Origin::Tuple(protocol, _, _) => &protocol.to_lowercase() == "ws", + _ => false, + } + } +} + +#[cfg(test)] +mod tests { + use log::debug; + use crate::{ + test_keyring_from_str, tx_mvm_publish_module_dev, tx_mvm_execute_dev, + tx_mvm_publish_package_dev, version, tx_mvm_publish_module, + }; + + #[test] + #[ignore] + fn test_tx_mvm_publish_module_dev_ws() { + tx_mvm_publish_module_dev("./Alice_Store.mv", "ws://127.0.0.1:9944", 100, "alice") + .unwrap(); + } + + #[test] + #[ignore] + fn test_tx_mvm_execute_dev_ws() { + tx_mvm_execute_dev("./Alice_Main.mvt", "ws://127.0.0.1:9944", 100, "//Alice").unwrap(); + } + + #[test] + #[ignore] + fn test_tx_mvm_publish_package_dev_ws() { + tx_mvm_publish_package_dev( + "./Alice_Store.pac", + "ws://127.0.0.1:9944", + 1000, + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + ) + .unwrap(); + } + + #[test] + fn test_to_key_pair() { + assert!(test_keyring_from_str("alice").is_ok()); + assert!(test_keyring_from_str("Alice").is_ok()); + assert!(test_keyring_from_str("//Alice").is_ok()); + assert!( + test_keyring_from_str("5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY").is_ok() + ); + } + + #[test] + fn test_version() { + debug!("{}", version()); + } + + #[test] + #[ignore] + fn test_key_pair() { + // demo account + // 5DeyRkpWxXkdDHKqsqtYZLG6M3fHdqpAb55W5DPNQSaZPeg4 + // net exotic exchange stadium camp mind walk cart infant hospital will address + // net … … stadium … … walk … … hospital … … + // sr25519 + + let result = tx_mvm_publish_module( + "./Demo_Store.mv", + "ws://127.0.0.1:9944", + 100, + "net exotic exchange stadium camp mind walk cart infant hospital will address", + ) + .unwrap(); + println!("{}", result); + } +}