diff --git a/Cargo.lock b/Cargo.lock index 75d9cb54318..dba7c21f1a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,6 +220,38 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "assets-rpc" +version = "0.0.1" +dependencies = [ + "assets-runtime-api", + "composable-traits", + "frame-support", + "frame-system", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "num-traits", + "orml-traits", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "assets-runtime-api" +version = "0.0.1" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + [[package]] name = "async-attributes" version = "1.1.2" @@ -1398,6 +1430,8 @@ dependencies = [ name = "composable-node" version = "1.0.9" dependencies = [ + "assets-rpc", + "assets-runtime-api", "common", "composable-runtime", "cumulus-client-cli", @@ -1468,6 +1502,7 @@ dependencies = [ name = "composable-runtime" version = "0.1.0" dependencies = [ + "assets-runtime-api", "common", "composable-traits", "cumulus-pallet-aura-ext", @@ -2335,6 +2370,7 @@ checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" name = "dali-runtime" version = "0.1.0" dependencies = [ + "assets-runtime-api", "common", "composable-traits", "cumulus-pallet-aura-ext", @@ -6307,20 +6343,11 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", "num-traits", - "orml-tokens", "orml-traits", - "pallet-balances", - "pallet-governance-registry", "parity-scale-codec", "scale-info", - "serde", "sp-api", - "sp-arithmetic", - "sp-blockchain", "sp-core", "sp-io", "sp-runtime", @@ -7971,6 +7998,7 @@ dependencies = [ name = "picasso-runtime" version = "0.1.0" dependencies = [ + "assets-runtime-api", "common", "composable-traits", "cumulus-pallet-aura-ext", diff --git a/Cargo.toml b/Cargo.toml index 55ba0eae1ca..0a271bb443c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,12 +13,11 @@ edition = "2018" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -composable-node = { path = "node", features = [ "composable", "dali" ] } +composable-node = { path = "node", features = ["composable", "dali"] } color-eyre = { version = "0.5.11", default-features = false } [features] -runtime-benchmarks = [ "composable-node/runtime-benchmarks" ] -std = [ "composable-node/std" ] +runtime-benchmarks = ["composable-node/runtime-benchmarks"] [workspace] members = [ @@ -27,6 +26,7 @@ members = [ "utils/faucet-server", "utils/parachain-utils", "frame/*", + "frame/assets/*", "integration-tests", "integration-tests/simnode", "node", @@ -35,8 +35,9 @@ members = [ "runtime/composable", "utils/subxt-clients", "utils/collator-sidecar", - "utils/price-feed" + "utils/price-feed", ] +exclude = ["frame/assets"] [profile.release] # Polkadot runtime requires unwinding. @@ -47,160 +48,160 @@ inherits = "release" lto = true [patch."https://github.com/paritytech/substrate"] -frame-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-support ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-support-procedural ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-support-procedural-tools ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-support-procedural-tools-derive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-arithmetic ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-debug-derive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-std ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-core ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-core-hashing ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-externalities ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-storage ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-runtime-interface ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-runtime-interface-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-tracing ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-wasm-interface ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-io ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-keystore ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-state-machine ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-panic-handler ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-trie ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-runtime ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-application-crypto ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-api-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-version ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-version-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-block-builder ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-client-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -substrate-prometheus-endpoint ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-executor ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-executor-common ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-allocator ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-maybe-compressed-blob ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-serializer ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-executor-wasmi ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-executor-wasmtime ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-tasks ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -substrate-wasm-builder ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-core-hashing-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-tracing ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-rpc-server ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-tracing-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-blockchain ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-consensus ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-inherents ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-database ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-system ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-system-rpc-runtime-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-babe ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-authorship ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-authorship ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-session ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-timestamp ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-timestamp ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-session ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-staking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-consensus-babe ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-consensus-slots ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-consensus-vrf ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-election-provider-support ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-npos-elections ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-npos-elections-solution-type ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-service ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-chain-spec ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-chain-spec-derive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-network ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -fork-tree ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-utils ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-peerset ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-finality-grandpa ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-telemetry ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-client-db ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-state-db ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-informant ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-transaction-pool-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-keystore ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-offchain ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-offchain ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-transaction-pool ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-transaction-pool ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-rpc-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-block-builder ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-transaction-storage-proof ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-balances ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-transaction-payment ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-offences ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-staking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-bags-list ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-staking-reward-curve ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-consensus-aura ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-keyring ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-benchmarking-cli ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-cli ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-executive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-system-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-aura ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-grandpa ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-randomness-collective-flip ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-sudo ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-transaction-payment-rpc-runtime-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-transaction-payment-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-basic-authorship ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-proposer-metrics ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus-aura ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus-slots ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-finality-grandpa ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-network-gossip ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -substrate-frame-rpc-system ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -substrate-build-script-utils ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -frame-try-runtime ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-authority-discovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sp-authority-discovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-bounties ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-treasury ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-collective ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-utility ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-democracy ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-scheduler ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-election-provider-multi-phase ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-gilt ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-identity ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-im-online ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-indices ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-membership ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-mmr ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-mmr-primitives ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-multisig ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-offences-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-proxy ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-recovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-session-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-society ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-tips ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-vesting ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-mmr-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus-babe ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus-epochs ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus-babe-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-finality-grandpa-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-sync-state-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-authority-discovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus-uncles ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -try-runtime-cli ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -remote-externalities ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -beefy-gadget ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -beefy-primitives ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -beefy-gadget-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -sc-consensus-manual-seal ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-beefy ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-beefy-mmr ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -beefy-merkle-tree ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-nicks ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } -pallet-staking-reward-fn ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.13" } +frame-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-support = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-support-procedural = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-support-procedural-tools = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-support-procedural-tools-derive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-arithmetic = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-debug-derive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-std = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-core = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-core-hashing = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-externalities = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-storage = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-runtime-interface = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-runtime-interface-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-tracing = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-wasm-interface = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-io = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-keystore = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-state-machine = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-panic-handler = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-trie = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-runtime = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-application-crypto = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-api-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-version = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-version-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-block-builder = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-client-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +substrate-prometheus-endpoint = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-executor = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-executor-common = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-allocator = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-maybe-compressed-blob = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-serializer = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-executor-wasmi = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-executor-wasmtime = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-tasks = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +substrate-wasm-builder = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-core-hashing-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-tracing = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-rpc-server = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-tracing-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-blockchain = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-consensus = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-inherents = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-database = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-system = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-system-rpc-runtime-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-babe = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-authorship = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-authorship = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-session = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-timestamp = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-timestamp = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-session = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-staking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-consensus-babe = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-consensus-slots = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-consensus-vrf = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-election-provider-support = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-npos-elections = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-npos-elections-solution-type = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-service = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-chain-spec = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-chain-spec-derive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-network = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +fork-tree = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-utils = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-peerset = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-finality-grandpa = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-telemetry = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-client-db = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-state-db = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-informant = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-transaction-pool-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-keystore = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-offchain = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-offchain = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-transaction-pool = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-transaction-pool = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-rpc-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-block-builder = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-transaction-storage-proof = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-balances = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-transaction-payment = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-offences = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-staking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-bags-list = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-staking-reward-curve = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-consensus-aura = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-keyring = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-benchmarking-cli = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-cli = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-executive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-system-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-aura = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-grandpa = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-randomness-collective-flip = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-sudo = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-transaction-payment-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-basic-authorship = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-proposer-metrics = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus-aura = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus-slots = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-finality-grandpa = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-network-gossip = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +substrate-frame-rpc-system = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +substrate-build-script-utils = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +frame-try-runtime = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-authority-discovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sp-authority-discovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-bounties = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-treasury = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-collective = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-utility = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-democracy = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-scheduler = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-election-provider-multi-phase = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-gilt = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-identity = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-im-online = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-indices = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-membership = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-mmr = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-mmr-primitives = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-multisig = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-offences-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-proxy = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-recovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-session-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-society = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-tips = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-vesting = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-mmr-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus-babe = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus-epochs = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus-babe-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-finality-grandpa-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-sync-state-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-authority-discovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus-uncles = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +try-runtime-cli = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +remote-externalities = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +beefy-gadget = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +beefy-primitives = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +beefy-gadget-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +sc-consensus-manual-seal = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-beefy = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-beefy-mmr = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +beefy-merkle-tree = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-nicks = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } +pallet-staking-reward-fn = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.13" } diff --git a/frame/assets/Cargo.toml b/frame/assets/pallet/Cargo.toml similarity index 80% rename from frame/assets/Cargo.toml rename to frame/assets/pallet/Cargo.toml index 6bce76ed0d6..c736a2b6293 100644 --- a/frame/assets/Cargo.toml +++ b/frame/assets/pallet/Cargo.toml @@ -17,15 +17,14 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ # substrate primitives sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } -sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +# sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } # local -composable-traits = { path = "../composable-traits", default-features = false } +composable-traits = { path = "../../composable-traits", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301", default-features = false } num-traits = { version = "0.2.14", default-features = false } @@ -33,22 +32,19 @@ scale-info = { version = "1.0", default-features = false, features = [ "derive", ] } -# rpc -jsonrpc-core = "18.0.0" -jsonrpc-core-client = "18.0.0" -jsonrpc-derive = "18.0.0" - # misc -serde = { version = "1.0.133", features = ["derive"], optional = true } +serde = { version = "1.0.133", default-features = false, features = [ + "derive", +], optional = true } codec = { default-features = false, features = [ "derive", ], package = "parity-scale-codec", version = "2.0.0" } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301" } -governance-registry = { package = "pallet-governance-registry", path = "../governance-registry", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301", default-features = false } +governance-registry = { package = "pallet-governance-registry", path = "../../governance-registry", default-features = false } [package.metadata.cargo-udeps.ignore] development = ["governance-registry"] @@ -56,10 +52,13 @@ development = ["governance-registry"] [features] default = ["std"] std = [ + "pallet-balances/std", + "orml-tokens/std", "composable-traits/std", "codec/std", "frame-support/std", "sp-runtime/std", + "sp-api/std", "orml-traits/std", "num-traits/std", ] diff --git a/frame/assets/src/benchmarking.rs b/frame/assets/pallet/src/benchmarking.rs similarity index 100% rename from frame/assets/src/benchmarking.rs rename to frame/assets/pallet/src/benchmarking.rs diff --git a/frame/assets/src/lib.rs b/frame/assets/pallet/src/lib.rs similarity index 99% rename from frame/assets/src/lib.rs rename to frame/assets/pallet/src/lib.rs index 4d391dfee5b..0b339ef8ca6 100644 --- a/frame/assets/src/lib.rs +++ b/frame/assets/pallet/src/lib.rs @@ -66,8 +66,6 @@ pub use pallet::*; mod orml; -pub mod rpc; -pub mod runtime_api; #[cfg(test)] mod mocks; diff --git a/frame/assets/src/mocks.rs b/frame/assets/pallet/src/mocks.rs similarity index 100% rename from frame/assets/src/mocks.rs rename to frame/assets/pallet/src/mocks.rs diff --git a/frame/assets/src/orml.rs b/frame/assets/pallet/src/orml.rs similarity index 100% rename from frame/assets/src/orml.rs rename to frame/assets/pallet/src/orml.rs diff --git a/frame/assets/src/tests.rs b/frame/assets/pallet/src/tests.rs similarity index 100% rename from frame/assets/src/tests.rs rename to frame/assets/pallet/src/tests.rs diff --git a/frame/assets/src/weights.rs b/frame/assets/pallet/src/weights.rs similarity index 100% rename from frame/assets/src/weights.rs rename to frame/assets/pallet/src/weights.rs diff --git a/frame/assets/rpc/Cargo.toml b/frame/assets/rpc/Cargo.toml new file mode 100644 index 00000000000..b3492b5a86c --- /dev/null +++ b/frame/assets/rpc/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "assets-rpc" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# FRAME +frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } + +# substrate primitives +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } + +# local +composable-traits = { path = "../../composable-traits", default-features = false } + +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301", default-features = false } +num-traits = { version = "0.2.14", default-features = false } +scale-info = { version = "1.0", default-features = false, features = [ + "derive", +] } + +assets-runtime-api = {path="../runtime-api"} + +# rpc +jsonrpc-core = "18.0.0" +jsonrpc-core-client = "18.0.0" +jsonrpc-derive = "18.0.0" + +# misc +serde = { version = "1.0.133", default-features = false, features = ["derive"], optional = true } +codec = { default-features = false, features = [ + "derive", +], package = "parity-scale-codec", version = "2.0.0" } + +[features] +default = ["std"] +std = [ + "composable-traits/std", + "codec/std", + "frame-support/std", + "sp-runtime/std", + "sp-api/std", + "orml-traits/std", + "num-traits/std", +] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", +] diff --git a/frame/assets/src/rpc.rs b/frame/assets/rpc/src/lib.rs similarity index 98% rename from frame/assets/src/rpc.rs rename to frame/assets/rpc/src/lib.rs index f6b521cc099..50640e84006 100644 --- a/frame/assets/src/rpc.rs +++ b/frame/assets/rpc/src/lib.rs @@ -1,4 +1,4 @@ -use crate::runtime_api::AssetsRuntimeApi; +use assets_runtime_api::AssetsRuntimeApi; use codec::Codec; use jsonrpc_core::{Error as RpcError, ErrorCode, Result as RpcResult}; use jsonrpc_derive::rpc; diff --git a/frame/assets/runtime-api/Cargo.toml b/frame/assets/runtime-api/Cargo.toml new file mode 100644 index 00000000000..3b399f2f025 --- /dev/null +++ b/frame/assets/runtime-api/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "assets-runtime-api" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +codec = { default-features = false, features = [ + "derive", +], package = "parity-scale-codec", version = "2.0.0" } + +[features] +default = ["std"] +std = [ + "sp-api/std", +] \ No newline at end of file diff --git a/frame/assets/src/runtime_api.rs b/frame/assets/runtime-api/src/lib.rs similarity index 100% rename from frame/assets/src/runtime_api.rs rename to frame/assets/runtime-api/src/lib.rs diff --git a/frame/dutch-auction/Cargo.toml b/frame/dutch-auction/Cargo.toml index f98a549fb44..695c8331ce1 100644 --- a/frame/dutch-auction/Cargo.toml +++ b/frame/dutch-auction/Cargo.toml @@ -22,7 +22,7 @@ sp-io = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } smallvec = "1.7.0" -serde = { version = "1.0.130", optional = true } +serde = { version = "1.0.130", optional = true } scale-info = { version = "1.0", default-features = false, features = ["derive"] } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301", default-features = false } num-traits = { version = "0.2.14", default-features = false } @@ -36,7 +36,7 @@ proptest = "1.0" pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } pallet-currency-factory = { path = "../currency-factory" } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } -pallet-assets = { path = '../assets', default-features = false} +pallet-assets = { path = '../assets/pallet', default-features = false} orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301" } hex-literal = {version = "0.3.3", default-features = false } composable-tests-helpers = { path = "../composable-tests-helpers" } diff --git a/frame/lending/Cargo.toml b/frame/lending/Cargo.toml index 56d6c75a725..44f019e7f3d 100644 --- a/frame/lending/Cargo.toml +++ b/frame/lending/Cargo.toml @@ -53,7 +53,7 @@ pallet-currency-factory = { path = "../currency-factory" } pallet-liquidations = { path = "../liquidations" } pallet-dutch-auction = { path = "../dutch-auction", default-features = false } composable-tests-helpers = { path = "../composable-tests-helpers", default-features = false } -pallet-assets = { path = '../assets', default-features = false} +pallet-assets = { path = '../assets/pallet', default-features = false} [features] diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 58cd6a274a9..e6d954cffe6 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -65,7 +65,7 @@ composable-traits = { path = "../frame/composable-traits" , default-features = f call-filter = { package = "pallet-call-filter", path = "../frame/call-filter", default-features = false } assets-registry = { package = "pallet-assets-registry", path = "../frame/assets-registry", default-features = false, optional = true} governance-registry = { package = "pallet-governance-registry", path = "../frame/governance-registry", default-features = false, optional = true} -assets = { package = "pallet-assets", path = "../frame/assets", default-features = false, optional = true} +assets = { package = "pallet-assets", path = "../frame/assets/pallet", default-features = false, optional = true} # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index 9407e4fad2f..1d51efb7730 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -22,7 +22,9 @@ composable-runtime = { path = "../runtime/composable", optional = true } dali-runtime = { path = "../runtime/dali", optional = true } common = { path = "../runtime/common" } primitives = { path = "../runtime/primitives" } -pallet-assets = { path = "../frame/assets" } +pallet-assets = { path = "../frame/assets/pallet" } +assets-rpc = { path = "../frame/assets/rpc" } +assets-runtime-api = { path = "../frame/assets/runtime-api" } # FRAME Dependencies frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } diff --git a/node/src/rpc.rs b/node/src/rpc.rs index a982b1855a0..7786ff486dc 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -8,8 +8,8 @@ use primitives::currency::CurrencyId; use std::sync::Arc; +use assets_rpc::{Assets, AssetsApi}; use common::{AccountId, AccountIndex, Balance}; -use pallet_assets::rpc::{Assets, AssetsApi}; pub use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; @@ -36,7 +36,7 @@ where C: Send + Sync + 'static, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, - C::Api: pallet_assets::runtime_api::AssetsRuntimeApi, + C::Api: assets_runtime_api::AssetsRuntimeApi, C::Api: BlockBuilder, P: TransactionPool + 'static, { diff --git a/node/src/runtime.rs b/node/src/runtime.rs index 61d34cb246b..ec5c0487fcf 100644 --- a/node/src/runtime.rs +++ b/node/src/runtime.rs @@ -9,7 +9,7 @@ pub trait HostRuntimeApis: + sp_block_builder::BlockBuilder + substrate_frame_rpc_system::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi - + pallet_assets::runtime_api::AssetsRuntimeApi + + assets_runtime_api::AssetsRuntimeApi + sp_api::Metadata + sp_consensus_aura::AuraApi + sp_offchain::OffchainWorkerApi @@ -28,7 +28,7 @@ where + sp_block_builder::BlockBuilder + substrate_frame_rpc_system::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi - + pallet_assets::runtime_api::AssetsRuntimeApi + + assets_runtime_api::AssetsRuntimeApi + sp_api::Metadata + sp_consensus_aura::AuraApi + sp_offchain::OffchainWorkerApi diff --git a/runtime/composable/Cargo.toml b/runtime/composable/Cargo.toml index b8bc771270c..85b77ca3d52 100644 --- a/runtime/composable/Cargo.toml +++ b/runtime/composable/Cargo.toml @@ -64,7 +64,7 @@ smallvec = "1.6.1" # local modules assets-registry = { package = "pallet-assets-registry", path = '../../frame/assets-registry', default-features = false, optional = true } -assets = { package = "pallet-assets", path = '../../frame/assets', default-features = false, optional = true } +assets = { package = "pallet-assets", path = '../../frame/assets/pallet', default-features = false } common = { path = "../common", default-features = false } primitives = { path = "../primitives", default-features = false } @@ -78,6 +78,7 @@ call-filter = { package = "pallet-call-filter", path = "../../frame/call-filter" # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } +assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } # Used for runtime benchmarking benchmarking = { package = "frame-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false, optional = true } @@ -176,7 +177,6 @@ std = [ "orml-xcm-support/std", "orml-unknown-tokens/std", "assets-registry/std", - "assets/std", "governance-registry/std", ] runtime-benchmarks = [ diff --git a/runtime/composable/src/lib.rs b/runtime/composable/src/lib.rs index 2c50685c64e..f7cebb0b3b7 100644 --- a/runtime/composable/src/lib.rs +++ b/runtime/composable/src/lib.rs @@ -748,7 +748,7 @@ pub type Executive = executive::Executive, Runtime, AllPallets>; impl_runtime_apis! { - impl assets::runtime_api::AssetsRuntimeApi for Runtime { + impl assets_runtime_api::AssetsRuntimeApi for Runtime { fn balance_of(asset_id: CurrencyId, account_id: AccountId) -> Balance { >::balance(asset_id, &account_id) } diff --git a/runtime/dali/Cargo.toml b/runtime/dali/Cargo.toml index 9c376c1c750..438504bad07 100644 --- a/runtime/dali/Cargo.toml +++ b/runtime/dali/Cargo.toml @@ -66,7 +66,7 @@ smallvec = "1.6.1" # local modules assets-registry = { package = "pallet-assets-registry", path = '../../frame/assets-registry', default-features = false } -assets = { package = "pallet-assets", path = '../../frame/assets', default-features = false } +assets = { package = "pallet-assets", path = '../../frame/assets/pallet', default-features = false } crowdloan-rewards = { package = "pallet-crowdloan-rewards", path = '../../frame/crowdloan-rewards', default-features = false } bonded-finance = { package = "pallet-bonded-finance", path = "../../frame/bonded-finance", default-features = false } vesting = { package = "pallet-vesting", path = "../../frame/vesting", default-features = false } @@ -83,6 +83,7 @@ call-filter = { package = "pallet-call-filter", path = "../../frame/call-filter" # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } +assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } # Used for runtime benchmarking benchmarking = { package = "frame-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false, optional = true } diff --git a/runtime/dali/src/lib.rs b/runtime/dali/src/lib.rs index 89053e232b5..b5dc3d00fac 100644 --- a/runtime/dali/src/lib.rs +++ b/runtime/dali/src/lib.rs @@ -941,7 +941,7 @@ pub type Executive = executive::Executive, Runtime, AllPallets>; impl_runtime_apis! { - impl assets::runtime_api::AssetsRuntimeApi for Runtime { + impl assets_runtime_api::AssetsRuntimeApi for Runtime { fn balance_of(asset_id: CurrencyId, account_id: AccountId) -> Balance { >::balance(asset_id, &account_id) } diff --git a/runtime/picasso/Cargo.toml b/runtime/picasso/Cargo.toml index 649b1002a9b..33f3e5b8898 100644 --- a/runtime/picasso/Cargo.toml +++ b/runtime/picasso/Cargo.toml @@ -73,7 +73,7 @@ composable-traits = { path = "../../frame/composable-traits", default-features = call-filter = { package = "pallet-call-filter", path = "../../frame/call-filter", default-features = false } currency-factory = { package = "pallet-currency-factory", path = "../../frame/currency-factory", default-features = false } governance-registry = { package = "pallet-governance-registry", path = "../../frame/governance-registry", default-features = false } -assets = { package = "pallet-assets", path = '../../frame/assets', default-features = false } +assets = { package = "pallet-assets", path = '../../frame/assets/pallet', default-features = false } crowdloan-rewards = { package = "pallet-crowdloan-rewards", path = '../../frame/crowdloan-rewards', default-features = false } vesting = { package = "pallet-vesting", path = "../../frame/vesting", default-features = false } bonded-finance = { package = "pallet-bonded-finance", path = "../../frame/bonded-finance", default-features = false } @@ -81,6 +81,7 @@ bonded-finance = { package = "pallet-bonded-finance", path = "../../frame/bonded # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } +assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } # Used for runtime benchmarking benchmarking = { package = "frame-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false, optional = true } diff --git a/runtime/picasso/src/lib.rs b/runtime/picasso/src/lib.rs index 00f3a694280..c1c0aeef33b 100644 --- a/runtime/picasso/src/lib.rs +++ b/runtime/picasso/src/lib.rs @@ -211,7 +211,7 @@ parameter_types! { pub NativeAssetId: CurrencyId = CurrencyId::PICA; } -impl pallet_assets::Config for Runtime { +impl assets::Config for Runtime { type NativeAssetId = NativeAssetId; type GenerateCurrencyId = Factory; type AssetId = CurrencyId; @@ -705,38 +705,6 @@ impl democracy::Config for Runtime { type WeightInfo = weights::democracy::WeightInfo; } -parameter_types! { - pub const DynamicCurrencyIdInitial: CurrencyId = CurrencyId::LOCAL_LP_TOKEN_START; -} - -impl currency_factory::Config for Runtime { - type Event = Event; - type DynamicCurrencyId = CurrencyId; - type DynamicCurrencyIdInitial = DynamicCurrencyIdInitial; -} - -impl governance_registry::Config for Runtime { - type Event = Event; - type AssetId = CurrencyId; - type WeightInfo = (); -} - -parameter_types! { - pub NativeAssetId: CurrencyId = CurrencyId::PICA; -} - -impl assets::Config for Runtime { - type NativeAssetId = NativeAssetId; - type GenerateCurrencyId = Factory; - type AssetId = CurrencyId; - type Balance = Balance; - type NativeCurrency = Balances; - type MultiCurrency = Tokens; - type WeightInfo = (); - type AdminOrigin = EnsureRootOrHalfCouncil; - type GovernanceRegistry = GovernanceRegistry; -} - parameter_types! { pub const InitialPayment: Perbill = Perbill::from_percent(25); pub const VestingStep: BlockNumber = 7 * DAYS; @@ -836,8 +804,6 @@ construct_runtime!( Democracy: democracy::{Pallet, Call, Storage, Config, Event} = 33, Scheduler: scheduler::{Pallet, Call, Storage, Event} = 34, Utility: utility::{Pallet, Call, Event} = 35, - GovernanceRegistry: governance_registry::{Pallet, Call, Storage, Event} = 36, - Factory: currency_factory::{Pallet, Storage, Event} = 37, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 40, @@ -878,7 +844,7 @@ pub type Executive = executive::Executive, Runtime, AllPallets>; impl_runtime_apis! { - impl pallet_assets::runtime_api::AssetsRuntimeApi for Runtime { + impl assets_runtime_api::AssetsRuntimeApi for Runtime { fn balance_of(asset_id: CurrencyId, account_id: AccountId) -> Balance { >::balance(asset_id, &account_id) }