diff --git a/Cargo.lock b/Cargo.lock index 8aa25dec56c13..f484e8528289a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -471,6 +471,13 @@ dependencies = [ [[package]] name = "chainx" version = "2.0.0" +dependencies = [ + "chainx-cli", +] + +[[package]] +name = "chainx-cli" +version = "2.0.0" dependencies = [ "chainx-primitives", "chainx-rpc", @@ -539,7 +546,7 @@ dependencies = [ "sp-transaction-pool", "substrate-frame-rpc-system", "xrml-assets-rpc", - "xrml-assets-runtime-api", + "xrml-assets-rpc-runtime-api", "xrml-contracts-rpc", "xrml-contracts-rpc-runtime-api", "xrml-transaction-payment-rpc", @@ -575,7 +582,7 @@ dependencies = [ "sp-version", "substrate-wasm-builder-runner", "xrml-assets", - "xrml-assets-runtime-api", + "xrml-assets-rpc-runtime-api", "xrml-bridge-bitcoin", "xrml-contracts", "xrml-contracts-primitives", @@ -6618,11 +6625,11 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-runtime", - "xrml-assets-runtime-api", + "xrml-assets-rpc-runtime-api", ] [[package]] -name = "xrml-assets-runtime-api" +name = "xrml-assets-rpc-runtime-api" version = "0.1.0" dependencies = [ "chainx-primitives", diff --git a/Cargo.toml b/Cargo.toml index 5a75b43aa94c1..509ea51f67f5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,41 +6,29 @@ edition = "2018" description = "Fully Decentralized Interchain Crypto Asset Management on Polkadot" [dependencies] -futures = "0.3.4" -log = "0.4.8" -structopt = "0.3.8" -parking_lot = "0.10.0" -jsonrpc-core = "14.0.3" - -sc-cli = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-rpc = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-executor = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-service = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-network = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } - -chainx-primitives = { path = "./primitives" } -chainx-runtime = { path = "./runtime" } -chainx-rpc = { path = "./rpc" } - -xrml-protocol = { path = "./xrml/protocol" } - -[build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +cli = { package = "chainx-cli", path = "cli" } [workspace] members = [ + "cli", "runtime", + "primitives", + "rpc", + + "xrml/assets", + "xrml/assets/rpc", + "xrml/assets/rpc/runtime-api", + "xrml/bridge/bitcoin", + "xrml/contracts", + "xrml/contracts/common", + "xrml/contracts/rpc", + "xrml/contracts/rpc/runtime-api", + "xrml/protocol", + "xrml/support", + "xrml/transaction-payment", + "xrml/transaction-payment/rpc", + "xrml/transaction-payment/rpc/runtime-api", ] + +[profile.release] +panic = "unwind" diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000000000..79298b2c71fb2 --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "chainx-cli" +version = "2.0.0" +authors = ["ChainX community "] +edition = "2018" + +[dependencies] +futures = "0.3.4" +jsonrpc-core = "14.0.3" +log = "0.4.8" +parking_lot = "0.10.0" +structopt = "0.3.8" + +# Substrate client +sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-cli = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-client-api = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-executor = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-network = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-rpc = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-service = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } + +# Substrate primitives +sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-inherents = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } + +chainx-primitives = { path = "../primitives" } +chainx-runtime = { path = "../runtime" } +chainx-rpc = { path = "../rpc" } + +xrml-protocol = { path = "../xrml/protocol" } + +[build-dependencies] +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } diff --git a/build.rs b/cli/build.rs similarity index 100% rename from build.rs rename to cli/build.rs diff --git a/src/chain_spec.rs b/cli/src/chain_spec.rs similarity index 100% rename from src/chain_spec.rs rename to cli/src/chain_spec.rs diff --git a/src/cli.rs b/cli/src/cli.rs similarity index 100% rename from src/cli.rs rename to cli/src/cli.rs diff --git a/src/command.rs b/cli/src/command.rs similarity index 100% rename from src/command.rs rename to cli/src/command.rs diff --git a/cli/src/lib.rs b/cli/src/lib.rs new file mode 100644 index 0000000000000..1ead2538ac4a0 --- /dev/null +++ b/cli/src/lib.rs @@ -0,0 +1,13 @@ +//! ChainX CLI library. + +#![warn(missing_docs)] +#![warn(unused_extern_crates)] + +mod chain_spec; +#[macro_use] +mod service; +mod cli; +mod command; + +pub use command::*; +pub use sc_cli::Result; diff --git a/src/service.rs b/cli/src/service.rs similarity index 100% rename from src/service.rs rename to cli/src/service.rs diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 432fc8b2be023..091ae02cb4d8e 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chainx-primitives" version = "2.0.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index d345953c6bdac..c2576786fa2b5 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,31 +1,31 @@ [package] name = "chainx-rpc" version = "2.0.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] } +hex = "0.4" jsonrpc-core = "14.0.3" jsonrpc-core-client = "14.0.5" jsonrpc-derive = "14.0.3" serde_json = "1.0" -hex = "0.4" # Substrate client -sc-service = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", features = ["test-helpers"] } sc-client-api = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sc-service = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", features = ["test-helpers"] } # Substrate utils substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } # Substrate primitives -sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } sp-api = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } sp-blockchain = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } sp-state-machine = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } # Substrate pallets frame-support = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } @@ -37,7 +37,7 @@ chainx-primitives = { path = "../primitives" } # ChainX pallets xrml-assets-rpc = { path = "../xrml/assets/rpc" } -xrml-assets-runtime-api = { path = "../xrml/assets/runtime-api" } +xrml-assets-rpc-runtime-api = { path = "../xrml/assets/rpc/runtime-api" } xrml-contracts-rpc = { path = "../xrml/contracts/rpc" } xrml-contracts-rpc-runtime-api = { path = "../xrml/contracts/rpc/runtime-api" } xrml-transaction-payment-rpc = { path = "../xrml/transaction-payment/rpc" } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 9535c1f9a5e08..66b90e7b31b60 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -66,7 +66,7 @@ where UncheckedExtrinsic, >, as ProvideRuntimeApi>::Api: - xrml_assets_runtime_api::AssetsApi, + xrml_assets_rpc_runtime_api::AssetsApi, as ProvideRuntimeApi>::Api: xrml_contracts_rpc::ContractsRuntimeApi, < as ProvideRuntimeApi>::Api as sp_api::ApiErrorExt>::Error: diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c622148cbe991..19a4093717a71 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chainx-runtime" version = "2.0.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [package.metadata.docs.rs] @@ -12,36 +12,36 @@ codec = { package = "parity-scale-codec", version = "1.3.0", default-features = serde = { version = "1.0.101", optional = true, features = ["derive"] } # Substrate primitives -sp-io = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } sp-block-builder = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-session = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } # Substrate pallets +frame-executive = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -frame-executive = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } pallet-aura = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } # ChainX primitives chainx-primitives = { path = "../primitives", default-features = false } # ChainX pallets xrml-assets = { path = "../xrml/assets", default-features = false } -xrml-assets-runtime-api = { path = "../xrml/assets/runtime-api", default-features = false } +xrml-assets-rpc-runtime-api = { path = "../xrml/assets/rpc/runtime-api", default-features = false } xrml-bridge-bitcoin = { path = "../xrml/bridge/bitcoin", default-features = false } xrml-contracts = { path = "../xrml/contracts", default-features = false } xrml-contracts-primitives = { path = "../xrml/contracts/common", default-features = false } @@ -58,34 +58,34 @@ std = [ "codec/std", "serde", - "sp-io/std", - "sp-std/std", - "sp-core/std", - "sp-runtime/std", - "sp-session/std", - "sp-version/std", "sp-api/std", - "sp-inherents/std", - "sp-offchain/std", "sp-block-builder/std", "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", "sp-transaction-pool/std", + "sp-version/std", + "frame-executive/std", "frame-support/std", "frame-system/std", "frame-system-rpc-runtime-api/std", - "frame-executive/std", "pallet-aura/std", "pallet-grandpa/std", - "pallet-timestamp/std", - "pallet-sudo/std", "pallet-randomness-collective-flip/std", + "pallet-sudo/std", + "pallet-timestamp/std", "chainx-primitives/std", "xrml-assets/std", - "xrml-assets-runtime-api/std", + "xrml-assets-rpc-runtime-api/std", "xrml-bridge-bitcoin/std", "xrml-contracts/std", "xrml-contracts-primitives/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index e28d5a3719f6d..6b936227d6e80 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -415,7 +415,7 @@ impl_runtime_apis! { } } - impl xrml_assets_runtime_api::AssetsApi for Runtime { + impl xrml_assets_rpc_runtime_api::AssetsApi for Runtime { fn assets_for_account(who: AccountId) -> BTreeMap> { XAssets::valid_assets_of(&who) } diff --git a/src/main.rs b/src/main.rs index 0e4e82f5b9c0d..313febd6a0215 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,5 @@ -//! Substrate Node Template CLI library. -#![warn(missing_docs)] +//! ChainX CLI -mod chain_spec; -#[macro_use] -mod service; -mod cli; -mod command; - -fn main() -> sc_cli::Result<()> { - command::run() +fn main() -> cli::Result<()> { + cli::run() } diff --git a/xrml/assets/Cargo.toml b/xrml/assets/Cargo.toml index 025cc1f2e1a23..177af7d0804c5 100644 --- a/xrml/assets/Cargo.toml +++ b/xrml/assets/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "xrml-assets" version = "0.1.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] -serde = { version = "1.0", optional = true } -codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"], default-features = false } bitmask = { version = "0.5.0", default-features = false } +codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"], default-features = false } +serde = { version = "1.0", optional = true } # Substrate primitives sp-std = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } @@ -28,9 +28,9 @@ xrml-support = { path = "../support", default-features = false } [features] default = ["std"] std = [ - "serde", - "codec/std", "bitmask/std", + "codec/std", + "serde", "sp-std/std", "sp-core/std", @@ -40,6 +40,7 @@ std = [ "frame-system/std", "chainx-primitives/std", + "xrml-protocol/std", "xrml-support/std", ] diff --git a/xrml/assets/rpc/Cargo.toml b/xrml/assets/rpc/Cargo.toml index 53312e4777f50..4f63f02181a5b 100644 --- a/xrml/assets/rpc/Cargo.toml +++ b/xrml/assets/rpc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "xrml-assets-rpc" version = "0.1.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] @@ -16,4 +16,4 @@ sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0. sp-blockchain = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3" } chainx-primitives = { path = "../../../primitives" } -xrml-assets-runtime-api = { path = "../runtime-api" } \ No newline at end of file +xrml-assets-rpc-runtime-api = { path = "./runtime-api" } diff --git a/xrml/assets/runtime-api/Cargo.toml b/xrml/assets/rpc/runtime-api/Cargo.toml similarity index 73% rename from xrml/assets/runtime-api/Cargo.toml rename to xrml/assets/rpc/runtime-api/Cargo.toml index b4705b15949aa..d040b2cc73bf3 100644 --- a/xrml/assets/runtime-api/Cargo.toml +++ b/xrml/assets/rpc/runtime-api/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "xrml-assets-runtime-api" +name = "xrml-assets-rpc-runtime-api" version = "0.1.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] @@ -11,8 +11,8 @@ sp-api = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc sp-std = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } -chainx-primitives = { path = "../../../primitives", default-features = false } -xrml-assets = { path = "../", default-features = false } +chainx-primitives = { path = "../../../../primitives", default-features = false } +xrml-assets = { path = "../../", default-features = false } [features] default = ["std"] @@ -23,4 +23,4 @@ std = [ "chainx-primitives/std", "xrml-assets/std", -] \ No newline at end of file +] diff --git a/xrml/assets/runtime-api/src/lib.rs b/xrml/assets/rpc/runtime-api/src/lib.rs similarity index 100% rename from xrml/assets/runtime-api/src/lib.rs rename to xrml/assets/rpc/runtime-api/src/lib.rs diff --git a/xrml/assets/rpc/src/lib.rs b/xrml/assets/rpc/src/lib.rs index 071b9a3924cd7..e1bfd4ff0819d 100644 --- a/xrml/assets/rpc/src/lib.rs +++ b/xrml/assets/rpc/src/lib.rs @@ -10,7 +10,7 @@ use sp_blockchain::HeaderBackend; use sp_runtime::{generic::BlockId, traits::Block as BlockT}; use chainx_primitives::AssetId; -use xrml_assets_runtime_api::{ +use xrml_assets_rpc_runtime_api::{ AssetRestrictions, AssetType, AssetsApi as AssetsRuntimeApi, Chain, Precision, }; @@ -107,8 +107,8 @@ pub struct AssetInfo { desc: String, } -impl From for AssetInfo { - fn from(info: xrml_assets_runtime_api::AssetInfo) -> Self { +impl From for AssetInfo { + fn from(info: xrml_assets_rpc_runtime_api::AssetInfo) -> Self { AssetInfo { token: String::from_utf8_lossy(&info.token()).into_owned(), token_name: String::from_utf8_lossy(&info.token_name()).into_owned(), @@ -128,8 +128,10 @@ pub struct TotalAssetInfo { pub restrictions: AssetRestrictions, } -impl From> for TotalAssetInfo { - fn from(info: xrml_assets_runtime_api::TotalAssetInfo) -> Self { +impl From> + for TotalAssetInfo +{ + fn from(info: xrml_assets_rpc_runtime_api::TotalAssetInfo) -> Self { let mut r = BTreeMap::new(); AssetType::iterator().for_each(|type_| { let balance = if let Some(b) = info.balance.get(type_) { diff --git a/xrml/bridge/bitcoin/Cargo.toml b/xrml/bridge/bitcoin/Cargo.toml index a52b5d8dc9b13..2aac42c124c30 100644 --- a/xrml/bridge/bitcoin/Cargo.toml +++ b/xrml/bridge/bitcoin/Cargo.toml @@ -1,17 +1,17 @@ [package] name = "xrml-bridge-bitcoin" version = "0.1.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] -serde = { version = "1.0", optional = true } codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"], default-features = false } +serde = { version = "1.0", optional = true } # Substrate primitives -sp-std = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } # Substrate pallets frame-support = { git = "https://github.com/paritytech/substrate.git", tag = "v2.0.0-rc3", default-features = false } @@ -22,44 +22,45 @@ pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", tag = chainx-primitives = { path = "../../../primitives", default-features = false } # ChainX pallets +xrml-assets = { path = "../../assets", default-features = false } xrml-protocol = { path = "../../protocol", default-features = false } xrml-support = { path = "../../support", default-features = false } -xrml-assets = { path = "../../assets", default-features = false } # light-bitcoin -btc-primitives = { package = "primitives", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } -btc-ser = { package = "serialization", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } -btc-crypto = { package = "crypto", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } btc-chain = { package = "chain", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } +btc-crypto = { package = "crypto", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } btc-keys = { package = "keys", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } +btc-primitives = { package = "primitives", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } btc-script = { package = "script", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } +btc-ser = { package = "serialization", git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } merkle = { git = "https://github.com/chainx-org/light-bitcoin", branch = "v2", default-features = false } [features] default = ["std"] std = [ - "serde", "codec/std", + "serde", - "sp-std/std", "sp-core/std", "sp-runtime/std", + "sp-std/std", "frame-support/std", "frame-system/std", "pallet-timestamp/std", "chainx-primitives/std", + + "xrml-assets/std", "xrml-protocol/std", "xrml-support/std", - "xrml-assets/std", # light-bitcoin - "btc-primitives/std", - "btc-ser/std", - "btc-crypto/std", "btc-chain/std", + "btc-crypto/std", "btc-keys/std", + "btc-primitives/std", "btc-script/std", + "btc-ser/std", "merkle/std", ] diff --git a/xrml/protocol/Cargo.toml b/xrml/protocol/Cargo.toml index 3b09f8bc949f5..e5f3db21da7bb 100644 --- a/xrml/protocol/Cargo.toml +++ b/xrml/protocol/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "xrml-protocol" version = "0.1.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] diff --git a/xrml/support/Cargo.toml b/xrml/support/Cargo.toml index 3bf57495d1af8..6bd047ce13c93 100644 --- a/xrml/support/Cargo.toml +++ b/xrml/support/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "xrml-support" version = "0.1.0" -authors = ["ChainX community "] +authors = ["ChainX community "] edition = "2018" [dependencies] @@ -19,5 +19,6 @@ std = [ "rustc-hex", "sp-std/std", + "frame-support/std", ]