diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad091639dd..0f0846a92e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,33 +1,53 @@ -name: Unit/RPC/Runtime tests +name: Checks on: push: branches: - main - master + paths: + - "**.rs" + - "**.toml" + - "**.lock" + - "**.json" + - "**.yml" pull_request: types: [opened, synchronize, ready_for_review] branches: - main - master + paths: + - "**.rs" + - "**.toml" + - "**.lock" + - "**.json" + - "**.yml" # issue_comment: # types: [created, edited] env: - OS: ubuntu-latest RUST_TOOLCHAIN: nightly RUST_BACKTRACE: full - RUSTC_WRAPPER: sccache - SCCACHE_LINK: https://github.com/mozilla/sccache/releases/download - SCCACHE_VERSION: v0.2.15 - SCCACHE_DIR: /home/runner/.cache/sccache NODE_VERSION: 10 - GITHUB_CACHE_VERSION: 0 + GITHUB_CACHE_VERSION: 1 jobs: - build-subalfred: - name: Build subalfred + basic-checks: + name: Task ${{ matrix.action }} ${{ matrix.task.target }} if: github.event_name == 'push' || !github.event.pull_request.draft runs-on: ubuntu-latest + strategy: + matrix: + action: [build, test] + task: + - target: drml + repository: darwinia-network/darwinia-common + - target: subalfred + repository: l2ust/subalfred + exclude: + - action: test + task: + target: subalfred + steps: - name: Install Rust ${{ env.RUST_TOOLCHAIN }} toolchain uses: actions-rs/toolchain@v1 @@ -35,183 +55,46 @@ jobs: toolchain: ${{ env.RUST_TOOLCHAIN }} default: true - - name: Install sccache ${{ env.SCCACHE_VERSION }} - run: | - export SCCACHE_FILE=sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl - curl -L ${{ env.SCCACHE_LINK }}/${{ env.SCCACHE_VERSION }}/$SCCACHE_FILE.tar.gz | tar xz - sudo mv -f $SCCACHE_FILE/sccache /usr/bin - sudo chmod +x /usr/bin/sccache - - name: Fetch latest code uses: actions/checkout@v2 with: - repository: l2ust/subalfred - ref: main + repository: ${{ matrix.task.repository }} - - name: Cache cargo registry + - name: Cache uses: actions/cache@v2 - continue-on-error: false with: path: | ~/.cargo/registry ~/.cargo/git - key: ${{ env.OS }}-cargo-build-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ env.OS }}-cargo-build-${{ env.GITHUB_CACHE_VERSION }}- - - - name: Save sccache - uses: actions/cache@v2 - continue-on-error: false - with: - path: ${{ env.SCCACHE_DIR }} - key: ${{ env.OS }}-sccache-build-${{ env.GITHUB_CACHE_VERSION }}--${{ hashFiles('**/Cargo.lock') }} + target + key: ${{ matrix.action }}-${{ matrix.task.target }}-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ env.OS }}-sccache-build-${{ env.GITHUB_CACHE_VERSION }}- - - - name: Start sccache server - run: sccache --start-server - - - name: Build - run: cargo b --locked - - - name: Print sccache stats - run: sccache --show-stats + ${{ matrix.action }}-${{ matrix.task.target }}-${{ env.GITHUB_CACHE_VERSION }}- - - name: Stop sccache server - run: sccache --stop-server || true + - name: Action ${{ matrix.action }} + run: cargo ${{ matrix.action }} --locked - - name: Compress subalfred + - name: Compress ${{ matrix.task.target }} + if: matrix.action != 'test' run: | - cp target/debug/subalfred . - tar cf subalfred.tar.zst subalfred -I pzstd + mv target/debug/${{ matrix.task.target }} . + tar cf ${{ matrix.task.target }}.tar.zst ${{ matrix.task.target }} -I pzstd - - name: Upload subalfred + - name: Upload ${{ matrix.task.target }} + if: matrix.action != 'test' uses: actions/upload-artifact@v2 with: - name: subalfred - path: subalfred.tar.zst - - build-drml: - name: Build drml - if: github.event_name == 'push' || !github.event.pull_request.draft - runs-on: ubuntu-latest - steps: - - name: Install Rust ${{ env.RUST_TOOLCHAIN }} toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - default: true - - - name: Install sccache ${{ env.SCCACHE_VERSION }} - run: | - export SCCACHE_FILE=sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl - curl -L ${{ env.SCCACHE_LINK }}/${{ env.SCCACHE_VERSION }}/$SCCACHE_FILE.tar.gz | tar xz - sudo mv -f $SCCACHE_FILE/sccache /usr/bin - sudo chmod +x /usr/bin/sccache - - - name: Fetch latest code - uses: actions/checkout@v2 - - - name: Cache cargo registry - uses: actions/cache@v2 - continue-on-error: false - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ env.OS }}-cargo-build-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ env.OS }}-cargo-build-${{ env.GITHUB_CACHE_VERSION }}- - - - name: Save sccache - uses: actions/cache@v2 - continue-on-error: false - with: - path: ${{ env.SCCACHE_DIR }} - key: ${{ env.OS }}-sccache-build-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ env.OS }}-sccache-build-${{ env.GITHUB_CACHE_VERSION }}- - - - name: Start sccache server - run: sccache --start-server - - - name: Build - run: cargo b --locked - - - name: Print sccache stats - run: sccache --show-stats - - - name: Stop sccache server - run: sccache --stop-server || true - - - name: Compress drml - run: | - cp target/debug/drml . - tar cf drml.tar.zst drml -I pzstd - - - name: Upload drml - uses: actions/upload-artifact@v2 - with: - name: drml - path: drml.tar.zst - - unit-tests: - name: Unit tests - if: github.event_name == 'push' || !github.event.pull_request.draft - runs-on: ubuntu-latest - steps: - - name: Install Rust ${{ env.RUST_TOOLCHAIN }} toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - default: true - - - name: Install sccache ${{ env.SCCACHE_VERSION }} - run: | - export SCCACHE_FILE=sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl - curl -L ${{ env.SCCACHE_LINK }}/${{ env.SCCACHE_VERSION }}/$SCCACHE_FILE.tar.gz | tar xz - sudo mv -f $SCCACHE_FILE/sccache /usr/bin - sudo chmod +x /usr/bin/sccache - - - name: Fetch latest code - uses: actions/checkout@v2 - - - name: Cache cargo registry - uses: actions/cache@v2 - continue-on-error: false - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ env.OS }}-cargo-test-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ env.OS }}-cargo-test-${{ env.GITHUB_CACHE_VERSION }}- - - - name: Save sccache - uses: actions/cache@v2 - continue-on-error: false - with: - path: ${{ env.SCCACHE_DIR }} - key: ${{ env.OS }}-sccache-test-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ env.OS }}-sccache-test-${{ env.GITHUB_CACHE_VERSION }}- - - - name: Start sccache server - run: sccache --start-server - - - name: Test - run: cargo t --locked - - - name: Print sccache stats - run: sccache --show-stats + name: ${{ matrix.task.target }} + path: ${{ matrix.task.target }}.tar.zst - - name: Stop sccache server - run: sccache --stop-server || true + - name: Purge large cache + if: matrix.task.target == 'drml' && matrix.action == 'build' + run: .maintain/purge-large-cache.sh - rpc-tests: - name: RPC tests + rpc-checks: + name: Task test RPC if: github.event_name == 'push' || !github.event.pull_request.draft - needs: [build-drml] + needs: [basic-checks] runs-on: ubuntu-latest steps: - name: Download drml @@ -246,10 +129,10 @@ jobs: npm test code-checks: - name: Code checks + name: Task check code if: github.event_name == 'push' || !github.event.pull_request.draft # if: github.event.issue.pull_request && contains(github.event.comment.body, '/bot check') && contains(github.event.comment.body, 'code') - needs: [build-subalfred] + needs: [basic-checks] runs-on: ubuntu-latest steps: - name: Download subalfred @@ -269,10 +152,10 @@ jobs: run: subalfred ci default-features -p ../darwinia-common runtime-checks: - name: Runtime checks + name: Task check runtime if: github.event_name == 'push' || !github.event.pull_request.draft # if: github.event.issue.pull_request && contains(github.event.comment.body, '/bot check') && contains(github.event.comment.body, 'runtime') - needs: [build-drml, build-subalfred] + needs: [basic-checks] runs-on: ubuntu-latest steps: - name: Download drml @@ -357,12 +240,13 @@ jobs: ``` - clean-artifacts: - name: Clean artifacts + housekeeping-checks: + name: Task check housekeeping if: always() - needs: [code-checks, runtime-checks] + needs: [rpc-checks, code-checks, runtime-checks] steps: - - uses: geekyeggo/delete-artifact@v1 + - name: Clean artifacts + uses: geekyeggo/delete-artifact@v1 with: name: | drml diff --git a/.maintain/purge-large-cache.sh b/.maintain/purge-large-cache.sh new file mode 100755 index 0000000000..fa3fd64ec9 --- /dev/null +++ b/.maintain/purge-large-cache.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +cargo clean -p drml 2> /dev/null || true +cargo clean -p drml-service 2> /dev/null || true +cargo clean -p pangoro-runtime 2> /dev/null || true +cargo clean -p pangolin-runtime 2> /dev/null || true +rm -rf target/debug/wbuild 2> /dev/null || true diff --git a/Cargo.lock b/Cargo.lock index 7bbd21b8f6..bd316ceedd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -672,23 +672,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "bridge-primitives" -version = "2.7.0" -dependencies = [ - "bp-messages", - "bp-runtime", - "bridge-runtime-common", - "common-primitives", - "darwinia-fee-market", - "frame-support", - "pallet-bridge-dispatch", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "bridge-runtime-common" version = "0.1.0" @@ -991,21 +974,13 @@ dependencies = [ "bitflags", ] -[[package]] -name = "common-primitives" -version = "2.7.0" -dependencies = [ - "sp-core", - "sp-runtime", -] - [[package]] name = "common-runtime" version = "2.7.0" dependencies = [ - "common-primitives", "darwinia-balances", "darwinia-support", + "drml-common-primitives", "frame-support", "frame-system", "max-encoded-len", @@ -2330,11 +2305,35 @@ dependencies = [ "try-runtime-cli", ] +[[package]] +name = "drml-bridge-primitives" +version = "2.7.0" +dependencies = [ + "bp-messages", + "bp-runtime", + "bridge-runtime-common", + "darwinia-fee-market", + "drml-common-primitives", + "frame-support", + "pallet-bridge-dispatch", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "drml-common-primitives" +version = "2.7.0" +dependencies = [ + "sp-core", + "sp-runtime", +] + [[package]] name = "drml-rpc" version = "2.7.0" dependencies = [ - "common-primitives", "darwinia-balances-rpc", "darwinia-fee-market-rpc", "darwinia-header-mmr-rpc", @@ -2342,6 +2341,7 @@ dependencies = [ "dc-db", "dc-rpc", "dp-rpc", + "drml-common-primitives", "dvm-ethereum", "dvm-rpc-runtime-api", "jsonrpc-core", @@ -2373,7 +2373,6 @@ name = "drml-service" version = "2.7.0" dependencies = [ "array-bytes", - "common-primitives", "darwinia-balances-rpc-runtime-api", "darwinia-bridge-ethereum", "darwinia-claims", @@ -2386,6 +2385,7 @@ dependencies = [ "dc-mapping-sync", "dc-rpc", "dp-rpc", + "drml-common-primitives", "drml-rpc", "dvm-rpc-runtime-api", "frame-benchmarking", @@ -6151,9 +6151,7 @@ dependencies = [ "bp-message-dispatch", "bp-messages", "bp-runtime", - "bridge-primitives", "bridge-runtime-common", - "common-primitives", "common-runtime", "darwinia-balances", "darwinia-balances-rpc-runtime-api", @@ -6184,6 +6182,8 @@ dependencies = [ "dp-evm", "dp-fee", "dp-s2s", + "drml-bridge-primitives", + "drml-common-primitives", "dvm-ethereum", "dvm-rpc-runtime-api", "ethereum-primitives", @@ -6262,9 +6262,7 @@ dependencies = [ "bp-message-dispatch", "bp-messages", "bp-runtime", - "bridge-primitives", "bridge-runtime-common", - "common-primitives", "common-runtime", "darwinia-balances", "darwinia-balances-rpc-runtime-api", @@ -6276,6 +6274,8 @@ dependencies = [ "dp-asset", "dp-fee", "dp-s2s", + "drml-bridge-primitives", + "drml-common-primitives", "frame-benchmarking", "frame-election-provider-support", "frame-executive", diff --git a/node/primitives/bridge/Cargo.toml b/node/primitives/bridge/Cargo.toml index 16a2f0b4e2..71f08daeb5 100644 --- a/node/primitives/bridge/Cargo.toml +++ b/node/primitives/bridge/Cargo.toml @@ -4,15 +4,15 @@ description = "Pangolin node bridge primitives" edition = "2021" homepage = "https://darwinia.network/" license = "GPL-3.0" -name = "bridge-primitives" +name = "drml-bridge-primitives" readme = "README.md" repository = "https://github.com/darwinia-network/darwinia-common/" version = "2.7.0" [dependencies] # darwinia-network -common-primitives = { default-features = false, path = "../common" } -darwinia-fee-market = { default-features = false, path = "../../../frame/fee-market" } +darwinia-fee-market = { default-features = false, path = "../../../frame/fee-market" } +drml-common-primitives = { default-features = false, path = "../common" } # paritytech bp-messages = { default-features = false, git = "https://github.com/darwinia-network/parity-bridges-common", tag = "darwinia-v0.11.6-4" } bp-runtime = { default-features = false, git = "https://github.com/darwinia-network/parity-bridges-common", tag = "darwinia-v0.11.6-4" } @@ -29,8 +29,8 @@ default = ["std"] std = [ # darwinia-network - "common-primitives/std", "darwinia-fee-market/std", + "drml-common-primitives/std", # paritytech "bp-messages/std", "bp-runtime/std", diff --git a/node/primitives/bridge/src/lib.rs b/node/primitives/bridge/src/lib.rs index 4d54f8f54b..77bdc77a2e 100644 --- a/node/primitives/bridge/src/lib.rs +++ b/node/primitives/bridge/src/lib.rs @@ -38,8 +38,8 @@ use sp_core::H256; use sp_runtime::{traits::Convert, RuntimeDebug}; use sp_std::prelude::*; // --- darwinia-network --- -use common_primitives::*; use darwinia_fee_market::RingBalance; +use drml_common_primitives::*; /// Maximal size (in bytes) of encoded (using `Encode::encode()`) account id. pub const MAXIMAL_ENCODED_ACCOUNT_ID_SIZE: u32 = 32; diff --git a/node/primitives/common/Cargo.toml b/node/primitives/common/Cargo.toml index 2731786ebe..b9419f53de 100644 --- a/node/primitives/common/Cargo.toml +++ b/node/primitives/common/Cargo.toml @@ -4,7 +4,7 @@ description = "DRML node runtime primitives" edition = "2021" homepage = "https://darwinia.network/" license = "GPL-3.0" -name = "common-primitives" +name = "drml-common-primitives" readme = "README.md" repository = "https://github.com/darwinia-network/darwinia-common/" version = "2.7.0" diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 29017784d8..0b02b5da57 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -14,7 +14,6 @@ version = "2.7.0" jsonrpc-core = { version = "15.1" } jsonrpc-pubsub = { version = "15.1" } # darwinia-network -common-primitives = { path = "../primitives/common" } darwinia-balances-rpc = { path = "../../frame/balances/rpc" } darwinia-fee-market-rpc = { path = "../../frame/fee-market/rpc" } darwinia-header-mmr-rpc = { path = "../../frame/header-mmr/rpc" } @@ -22,6 +21,7 @@ darwinia-staking-rpc = { path = "../../frame/staking/rpc" } dc-db = { path = "../../client/dvm/db" } dc-rpc = { path = "../../client/dvm/rpc", features = ["rpc_binary_search_estimate"] } dp-rpc = { path = "../../primitives/rpc" } +drml-common-primitives = { path = "../primitives/common" } dvm-ethereum = { path = "../../frame/dvm" } dvm-rpc-runtime-api = { path = "../../frame/dvm/rpc/runtime-api" } pangolin-runtime = { path = "../runtime/pangolin" } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 50e678c4b0..f4d94f8fef 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -25,7 +25,7 @@ pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor}; // --- std --- use std::sync::Arc; // --- darwinia-network --- -use common_primitives::{BlockNumber, Hash, OpaqueBlock as Block}; +use drml_common_primitives::{BlockNumber, Hash, OpaqueBlock as Block}; /// A type representing all RPC extensions. pub type RpcExtension = jsonrpc_core::IoHandler; diff --git a/node/rpc/src/pangolin.rs b/node/rpc/src/pangolin.rs index c205628f2a..686dd69c14 100644 --- a/node/rpc/src/pangolin.rs +++ b/node/rpc/src/pangolin.rs @@ -24,8 +24,8 @@ use std::{collections::BTreeMap, sync::Arc}; // --- darwinia-network --- use crate::*; -use common_primitives::{AccountId, Balance, Nonce, Power}; use dp_rpc::{FilterPool, PendingTransactions}; +use drml_common_primitives::{AccountId, Balance, Nonce, Power}; use dvm_ethereum::EthereumStorageSchema; /// Full client dependencies. diff --git a/node/rpc/src/pangoro.rs b/node/rpc/src/pangoro.rs index 04e7305372..aff60db299 100644 --- a/node/rpc/src/pangoro.rs +++ b/node/rpc/src/pangoro.rs @@ -28,7 +28,7 @@ use std::sync::Arc; use sp_api::ProvideRuntimeApi; // --- darwinia-network --- use crate::*; -use common_primitives::{AccountId, Balance, Nonce}; +use drml_common_primitives::{AccountId, Balance, Nonce}; /// Full client dependencies pub struct FullDeps { diff --git a/node/runtime/common/Cargo.toml b/node/runtime/common/Cargo.toml index 357272bffe..0a77360830 100644 --- a/node/runtime/common/Cargo.toml +++ b/node/runtime/common/Cargo.toml @@ -13,9 +13,9 @@ version = "2.7.0" codec = { package = "parity-scale-codec", version = "2.1", default-features = false } static_assertions = { version = "1.1" } # darwinia-network -common-primitives = { default-features = false, path = "../../primitives/common" } -darwinia-balances = { default-features = false, path = "../../../frame/balances" } -darwinia-support = { default-features = false, path = "../../../frame/support" } +darwinia-balances = { default-features = false, path = "../../../frame/balances" } +darwinia-support = { default-features = false, path = "../../../frame/support" } +drml-common-primitives = { default-features = false, path = "../../primitives/common" } # paritytech frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate", tag = "darwinia-v0.11.6-1" } frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate", tag = "darwinia-v0.11.6-1" } @@ -36,9 +36,9 @@ std = [ # crates.io "codec/std", # darwinia-network - "common-primitives/std", "darwinia-balances/std", "darwinia-support/std", + "drml-common-primitives/std", # paritytech "frame-support/std", "frame-system/std", diff --git a/node/runtime/common/src/impls.rs b/node/runtime/common/src/impls.rs index 13a32a42b8..07501b9b56 100644 --- a/node/runtime/common/src/impls.rs +++ b/node/runtime/common/src/impls.rs @@ -32,7 +32,7 @@ darwinia_support::impl_account_data! { RingInstance, KtonInstance where - Balance = common_primitives::Balance + Balance = drml_common_primitives::Balance { // other data } @@ -43,8 +43,8 @@ pub struct ToAuthor(sp_std::marker::PhantomData); impl OnUnbalanced> for ToAuthor where R: darwinia_balances::Config + pallet_authorship::Config, - ::AccountId: From, - ::AccountId: Into, + ::AccountId: From, + ::AccountId: Into, ::Event: From>, { fn on_nonzero_unbalanced(amount: NegativeImbalance) { @@ -68,8 +68,8 @@ where + pallet_treasury::Config + pallet_authorship::Config, pallet_treasury::Pallet: OnUnbalanced>, - ::AccountId: From, - ::AccountId: Into, + ::AccountId: From, + ::AccountId: Into, ::Event: From>, { fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { diff --git a/node/runtime/common/src/lib.rs b/node/runtime/common/src/lib.rs index 6567199b11..c6aab446fc 100644 --- a/node/runtime/common/src/lib.rs +++ b/node/runtime/common/src/lib.rs @@ -26,8 +26,7 @@ pub use impls::*; pub use frame_support::weights::constants::{ExtrinsicBaseWeight, RocksDbWeight}; -pub use darwinia_balances::Instance1 as RingInstance; -pub use darwinia_balances::Instance2 as KtonInstance; +pub use darwinia_balances::{Instance1 as RingInstance, Instance2 as KtonInstance}; // --- crates.io --- use static_assertions::const_assert; @@ -43,7 +42,7 @@ use frame_system::limits::{BlockLength, BlockWeights}; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use sp_runtime::{FixedPointNumber, Perbill, Perquintill}; // --- darwinia-network --- -use common_primitives::BlockNumber; +use drml_common_primitives::BlockNumber; pub type NegativeImbalance = as Currency< ::AccountId, diff --git a/node/runtime/pangolin/Cargo.toml b/node/runtime/pangolin/Cargo.toml index dd86e6301c..8e0b6c64c3 100644 --- a/node/runtime/pangolin/Cargo.toml +++ b/node/runtime/pangolin/Cargo.toml @@ -18,8 +18,6 @@ serde = { version = "1.0", optional = true } smallvec = { version = "1.6" } static_assertions = { version = "1.1" } # darwinia-network -bridge-primitives = { default-features = false, path = "../../primitives/bridge" } -common-primitives = { default-features = false, path = "../../primitives/common" } common-runtime = { default-features = false, path = "../common" } darwinia-balances = { default-features = false, path = "../../../frame/balances" } darwinia-balances-rpc-runtime-api = { default-features = false, path = "../../../frame/balances/rpc/runtime-api" } @@ -50,6 +48,8 @@ dp-contract = { default-features = false, path = ".. dp-evm = { default-features = false, path = "../../../primitives/evm" } dp-fee = { default-features = false, path = "../../../primitives/fee-market" } dp-s2s = { default-features = false, path = "../../../primitives/s2s" } +drml-bridge-primitives = { default-features = false, path = "../../primitives/bridge" } +drml-common-primitives = { default-features = false, path = "../../primitives/common" } dvm-ethereum = { default-features = false, path = "../../../frame/dvm" } dvm-rpc-runtime-api = { default-features = false, path = "../../../frame/dvm/rpc/runtime-api" } ethereum-primitives = { default-features = false, path = "../../../primitives/ethereum" } @@ -130,8 +130,6 @@ std = [ "evm/std", "serde", # darwinia-network - "bridge-primitives/std", - "common-primitives/std", "common-runtime/std", "darwinia-balances/std", "darwinia-balances-rpc-runtime-api/std", @@ -162,6 +160,8 @@ std = [ "dp-evm/std", "dp-fee/std", "dp-s2s/std", + "drml-bridge-primitives/std", + "drml-common-primitives/std", "dvm-ethereum/std", "dvm-rpc-runtime-api/std", "ethereum-primitives/std", diff --git a/node/runtime/pangolin/src/bridges/substrate/pangoro_messages.rs b/node/runtime/pangolin/src/bridges/substrate/pangoro_messages.rs index ea788f1d8e..a3b248f8f6 100644 --- a/node/runtime/pangolin/src/bridges/substrate/pangoro_messages.rs +++ b/node/runtime/pangolin/src/bridges/substrate/pangoro_messages.rs @@ -26,7 +26,7 @@ use sp_runtime::{traits::Zero, FixedPointNumber, FixedU128}; use sp_std::{convert::TryFrom, ops::RangeInclusive}; // --- darwinia-network --- use crate::*; -use bridge_primitives::{ +use drml_bridge_primitives::{ FromThisChainMessageVerifier, PANGOLIN_CHAIN_ID, PANGORO_CHAIN_ID, PANGORO_PANGOLIN_LANE, WITH_PANGOLIN_MESSAGES_PALLET_NAME, }; @@ -144,17 +144,17 @@ impl messages::ThisChainWithMessages for Pangolin { fn estimate_delivery_confirmation_transaction() -> MessageTransaction { let inbound_data_size = InboundLaneData::::encoded_size_hint( - bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE, + drml_bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE, 1, 1, ) .unwrap_or(u32::MAX); MessageTransaction { - dispatch_weight: bridge_primitives::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT, + dispatch_weight: drml_bridge_primitives::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT, size: inbound_data_size - .saturating_add(bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) - .saturating_add(bridge_primitives::TX_EXTRA_BYTES), + .saturating_add(drml_bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) + .saturating_add(drml_bridge_primitives::TX_EXTRA_BYTES), } } @@ -213,17 +213,17 @@ impl messages::BridgedChainWithMessages for Pangoro { MessageTransaction { dispatch_weight: extra_bytes_in_payload - .saturating_mul(bridge_primitives::ADDITIONAL_MESSAGE_BYTE_DELIVERY_WEIGHT) - .saturating_add(bridge_primitives::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT) + .saturating_mul(drml_bridge_primitives::ADDITIONAL_MESSAGE_BYTE_DELIVERY_WEIGHT) + .saturating_add(drml_bridge_primitives::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT) .saturating_add(message_dispatch_weight) .saturating_sub(if include_pay_dispatch_fee_cost { 0 } else { - bridge_primitives::PAY_INBOUND_DISPATCH_FEE_WEIGHT + drml_bridge_primitives::PAY_INBOUND_DISPATCH_FEE_WEIGHT }), size: message_payload_len - .saturating_add(bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) - .saturating_add(bridge_primitives::TX_EXTRA_BYTES), + .saturating_add(drml_bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) + .saturating_add(drml_bridge_primitives::TX_EXTRA_BYTES), } } diff --git a/node/runtime/pangolin/src/lib.rs b/node/runtime/pangolin/src/lib.rs index a9757f8ca0..186bf7316e 100644 --- a/node/runtime/pangolin/src/lib.rs +++ b/node/runtime/pangolin/src/lib.rs @@ -69,8 +69,8 @@ pub mod wasm { } pub use wasm::*; -pub use common_primitives as pangoro_primitives; -pub use common_primitives as pangolin_primitives; +pub use drml_common_primitives as pangoro_primitives; +pub use drml_common_primitives as pangolin_primitives; pub use common_runtime as pangolin_runtime_system_params; pub use common_runtime as pangoro_runtime_system_params; @@ -117,9 +117,8 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; // --- darwinia-network --- -use bridge_primitives::{PANGOLIN_CHAIN_ID, PANGORO_CHAIN_ID}; +use drml_bridge_primitives::{PANGOLIN_CHAIN_ID, PANGORO_CHAIN_ID}; use bridges::substrate::pangoro_messages::{ToPangoroMessagePayload, WithPangoroMessageBridge}; -use common_primitives::*; use common_runtime::*; use darwinia_balances_rpc_runtime_api::RuntimeDispatchInfo as BalancesRuntimeDispatchInfo; use darwinia_bridge_ethereum::CheckEthereumRelayHeaderParcel; @@ -127,6 +126,7 @@ use darwinia_evm::{Account as EVMAccount, FeeCalculator, Runner}; use darwinia_fee_market_rpc_runtime_api::{Fee, InProcessOrders}; use darwinia_header_mmr_rpc_runtime_api::RuntimeDispatchInfo as HeaderMMRRuntimeDispatchInfo; use darwinia_staking_rpc_runtime_api::RuntimeDispatchInfo as StakingRuntimeDispatchInfo; +use drml_common_primitives::*; use dvm_ethereum::{Call::transact, Transaction as EthereumTransaction}; use dvm_rpc_runtime_api::TransactionStatus; @@ -686,7 +686,7 @@ sp_api::impl_runtime_apis! { } } - impl bridge_primitives::PangoroFinalityApi for Runtime { + impl drml_bridge_primitives::PangoroFinalityApi for Runtime { fn best_finalized() -> (pangoro_primitives::BlockNumber, pangoro_primitives::Hash) { let header = BridgePangoroGrandpa::best_finalized(); (header.number, header.hash()) @@ -697,7 +697,7 @@ sp_api::impl_runtime_apis! { } } - impl bridge_primitives::ToPangoroOutboundLaneApi for Runtime { + impl drml_bridge_primitives::ToPangoroOutboundLaneApi for Runtime { // fn estimate_message_delivery_and_dispatch_fee( // _lane_id: bp_messages::LaneId, // payload: ToPangoroMessagePayload, @@ -729,7 +729,7 @@ sp_api::impl_runtime_apis! { } } - impl bridge_primitives::FromPangoroInboundLaneApi for Runtime { + impl drml_bridge_primitives::FromPangoroInboundLaneApi for Runtime { fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce { BridgePangoroMessages::inbound_latest_received_nonce(lane) } diff --git a/node/runtime/pangolin/src/pallets/bridge_dispatch.rs b/node/runtime/pangolin/src/pallets/bridge_dispatch.rs index f604331889..1d75ca07c4 100644 --- a/node/runtime/pangolin/src/pallets/bridge_dispatch.rs +++ b/node/runtime/pangolin/src/pallets/bridge_dispatch.rs @@ -7,7 +7,7 @@ use pallet_bridge_dispatch::Config; use pangoro_primitives::AccountId; // --- darwinia-network --- use crate::{pangoro_messages::FromPangoroEncodedCall, *}; -use bridge_primitives::AccountIdConverter; +use drml_bridge_primitives::AccountIdConverter; pub struct Sub2SubFilter; impl Contains for Sub2SubFilter { diff --git a/node/runtime/pangolin/src/pallets/bridge_grandpa.rs b/node/runtime/pangolin/src/pallets/bridge_grandpa.rs index 4dded31f43..b60a0c25d0 100644 --- a/node/runtime/pangolin/src/pallets/bridge_grandpa.rs +++ b/node/runtime/pangolin/src/pallets/bridge_grandpa.rs @@ -1,7 +1,7 @@ pub use pallet_bridge_grandpa::Instance1 as WithPangoroGrandpa; // --- paritytech --- -use bridge_primitives::Pangoro; +use drml_bridge_primitives::Pangoro; use pallet_bridge_grandpa::Config; // --- darwinia-network --- use crate::*; diff --git a/node/runtime/pangolin/src/pallets/bridge_messages.rs b/node/runtime/pangolin/src/pallets/bridge_messages.rs index 5c7c7c3b13..5243185fb0 100644 --- a/node/runtime/pangolin/src/pallets/bridge_messages.rs +++ b/node/runtime/pangolin/src/pallets/bridge_messages.rs @@ -11,7 +11,7 @@ use crate::{ }, *, }; -use bridge_primitives::{ +use drml_bridge_primitives::{ AccountIdConverter, MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT, MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE, MAX_UNREWARDED_RELAYER_ENTRIES_AT_INBOUND_LANE, PANGORO_CHAIN_ID, diff --git a/node/runtime/pangolin/src/pallets/from_substrate_issuing_.rs b/node/runtime/pangolin/src/pallets/from_substrate_issuing_.rs index 11b2637bdf..572bfb398d 100644 --- a/node/runtime/pangolin/src/pallets/from_substrate_issuing_.rs +++ b/node/runtime/pangolin/src/pallets/from_substrate_issuing_.rs @@ -5,7 +5,7 @@ use frame_support::PalletId; use sp_runtime::AccountId32; // --- darwinia-network --- use crate::{pangoro_messages::ToPangoroOutboundPayLoad, *}; -use bridge_primitives::{AccountIdConverter, PANGORO_CHAIN_ID, PANGORO_PANGOLIN_LANE}; +use drml_bridge_primitives::{AccountIdConverter, PANGORO_CHAIN_ID, PANGORO_PANGOLIN_LANE}; use darwinia_support::{s2s::ToEthAddress, ChainName}; use from_substrate_issuing::Config; // Convert from AccountId32 to H160 diff --git a/node/runtime/pangoro/Cargo.toml b/node/runtime/pangoro/Cargo.toml index ae4df73354..4d9b7a6c34 100644 --- a/node/runtime/pangoro/Cargo.toml +++ b/node/runtime/pangoro/Cargo.toml @@ -16,8 +16,6 @@ codec = { package = "parity-scale-codec", version = "2.1", default-feature serde = { version = "1.0", features = ["derive"], optional = true } smallvec = { version = "1.6" } # darwinia-network -bridge-primitives = { default-features = false, path = "../../primitives/bridge" } -common-primitives = { default-features = false, path = "../../primitives/common" } common-runtime = { default-features = false, path = "../common" } darwinia-balances = { default-features = false, path = "../../../frame/balances" } darwinia-balances-rpc-runtime-api = { default-features = false, path = "../../../frame/balances/rpc/runtime-api" } @@ -29,6 +27,8 @@ darwinia-support = { default-features = false, path = "../../ dp-asset = { default-features = false, path = "../../../primitives/asset" } dp-fee = { default-features = false, path = "../../../primitives/fee-market" } dp-s2s = { default-features = false, path = "../../../primitives/s2s" } +drml-bridge-primitives = { default-features = false, path = "../../primitives/bridge" } +drml-common-primitives = { default-features = false, path = "../../primitives/common" } module-transaction-pause = { default-features = false, path = "../../../frame/transaction-pause" } to-substrate-backing = { default-features = false, path = "../../../frame/wormhole/backing/s2s" } # paritytech @@ -92,8 +92,6 @@ std = [ "codec/std", "serde", # darwinia-network - "bridge-primitives/std", - "common-primitives/std", "common-runtime/std", "darwinia-balances/std", "darwinia-balances-rpc-runtime-api/std", @@ -105,6 +103,8 @@ std = [ "dp-asset/std", "dp-fee/std", "dp-s2s/std", + "drml-bridge-primitives/std", + "drml-common-primitives/std", "module-transaction-pause/std", "to-substrate-backing/std", # paritytech diff --git a/node/runtime/pangoro/src/lib.rs b/node/runtime/pangoro/src/lib.rs index f28a9c0cd2..e6e3f31266 100644 --- a/node/runtime/pangoro/src/lib.rs +++ b/node/runtime/pangoro/src/lib.rs @@ -53,8 +53,8 @@ pub use wasm::*; pub mod pangolin_messages; use pangolin_messages::{ToPangolinMessagePayload, WithPangolinMessageBridge}; -pub use common_primitives as pangoro_primitives; -pub use common_primitives as pangolin_primitives; +pub use drml_common_primitives as pangoro_primitives; +pub use drml_common_primitives as pangolin_primitives; pub use common_runtime as pangoro_runtime_system_params; pub use common_runtime as pangolin_runtime_system_params; @@ -98,11 +98,11 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; // --- darwinia-network --- -use bridge_primitives::{PANGOLIN_CHAIN_ID, PANGORO_CHAIN_ID}; -use common_primitives::*; use common_runtime::*; use darwinia_balances_rpc_runtime_api::RuntimeDispatchInfo as BalancesRuntimeDispatchInfo; use darwinia_fee_market_rpc_runtime_api::{Fee, InProcessOrders}; +use drml_bridge_primitives::{PANGOLIN_CHAIN_ID, PANGORO_CHAIN_ID}; +use drml_common_primitives::*; pub type Address = MultiAddress; pub type Block = generic::Block; @@ -455,7 +455,7 @@ sp_api::impl_runtime_apis! { } } - impl bridge_primitives::PangolinFinalityApi for Runtime { + impl drml_bridge_primitives::PangolinFinalityApi for Runtime { fn best_finalized() -> (pangolin_primitives::BlockNumber, pangolin_primitives::Hash) { let header = BridgePangolinGrandpa::best_finalized(); (header.number, header.hash()) @@ -466,7 +466,7 @@ sp_api::impl_runtime_apis! { } } - impl bridge_primitives::ToPangolinOutboundLaneApi for Runtime { + impl drml_bridge_primitives::ToPangolinOutboundLaneApi for Runtime { // fn estimate_message_delivery_and_dispatch_fee( // _lane_id: bp_messages::LaneId, // payload: ToPangolinMessagePayload, @@ -498,7 +498,7 @@ sp_api::impl_runtime_apis! { } } - impl bridge_primitives::FromPangolinInboundLaneApi for Runtime { + impl drml_bridge_primitives::FromPangolinInboundLaneApi for Runtime { fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce { BridgePangolinMessages::inbound_latest_received_nonce(lane) } diff --git a/node/runtime/pangoro/src/pallets/bridge_dispatch.rs b/node/runtime/pangoro/src/pallets/bridge_dispatch.rs index 2e580fc156..84753018d3 100644 --- a/node/runtime/pangoro/src/pallets/bridge_dispatch.rs +++ b/node/runtime/pangoro/src/pallets/bridge_dispatch.rs @@ -6,7 +6,7 @@ use frame_support::traits::Contains; use pallet_bridge_dispatch::Config; // --- darwinia-network --- use crate::*; -use bridge_primitives::AccountIdConverter; +use drml_bridge_primitives::AccountIdConverter; use pangolin_messages::FromPangolinEncodedCall; pub struct Sub2SubFilter; diff --git a/node/runtime/pangoro/src/pallets/bridge_grandpa.rs b/node/runtime/pangoro/src/pallets/bridge_grandpa.rs index 26064d9496..bc266d0a9e 100644 --- a/node/runtime/pangoro/src/pallets/bridge_grandpa.rs +++ b/node/runtime/pangoro/src/pallets/bridge_grandpa.rs @@ -4,7 +4,7 @@ pub use pallet_bridge_grandpa::Instance1 as WithPangolinGrandpa; use pallet_bridge_grandpa::Config; // --- darwinia-network --- use crate::*; -use bridge_primitives::Pangolin; +use drml_bridge_primitives::Pangolin; frame_support::parameter_types! { // This is a pretty unscientific cap. diff --git a/node/runtime/pangoro/src/pallets/bridge_messages.rs b/node/runtime/pangoro/src/pallets/bridge_messages.rs index 16a58be5ca..60a5d035f1 100644 --- a/node/runtime/pangoro/src/pallets/bridge_messages.rs +++ b/node/runtime/pangoro/src/pallets/bridge_messages.rs @@ -6,15 +6,15 @@ use bp_runtime::ChainId; use pallet_bridge_messages::Config; // --- darwinia-network --- use crate::*; -use bridge_primitives::{ - AccountIdConverter, MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT, - MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE, MAX_UNREWARDED_RELAYER_ENTRIES_AT_INBOUND_LANE, - PANGOLIN_CHAIN_ID, -}; use darwinia_fee_market::s2s::{ FeeMarketMessageAcceptedHandler, FeeMarketMessageConfirmedHandler, FeeMarketPayment, }; use darwinia_support::evm::{ConcatConverter, IntoAccountId, IntoH160}; +use drml_bridge_primitives::{ + AccountIdConverter, MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT, + MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE, MAX_UNREWARDED_RELAYER_ENTRIES_AT_INBOUND_LANE, + PANGOLIN_CHAIN_ID, +}; use pangolin_messages::{ FromPangolinMessageDispatch, FromPangolinMessagePayload, Pangolin, PangoroToPangolinMessagesParameter, ToPangolinMessagePayload, ToPangolinMessageVerifier, diff --git a/node/runtime/pangoro/src/pallets/to_substrate_backing_.rs b/node/runtime/pangoro/src/pallets/to_substrate_backing_.rs index 41f923770a..1e988f93c4 100644 --- a/node/runtime/pangoro/src/pallets/to_substrate_backing_.rs +++ b/node/runtime/pangoro/src/pallets/to_substrate_backing_.rs @@ -6,9 +6,9 @@ use bp_runtime::ChainId; use frame_support::PalletId; // --- darwinia-network --- use crate::{pangolin_messages::ToPangolinOutboundPayload, *}; -use bridge_primitives::{AccountIdConverter, PANGORO_PANGOLIN_LANE}; use darwinia_support::{evm::IntoH160, s2s::LatestMessageNoncer}; use dp_asset::{TokenMetadata, NATIVE_TOKEN_TYPE}; +use drml_bridge_primitives::{AccountIdConverter, PANGORO_PANGOLIN_LANE}; use to_substrate_backing::Config; pub struct PangolinMessageNoncer; impl LatestMessageNoncer for PangolinMessageNoncer { diff --git a/node/runtime/pangoro/src/pangolin_messages.rs b/node/runtime/pangoro/src/pangolin_messages.rs index 938377232b..be4d6ec4fb 100644 --- a/node/runtime/pangoro/src/pangolin_messages.rs +++ b/node/runtime/pangoro/src/pangolin_messages.rs @@ -28,12 +28,12 @@ use sp_runtime::{traits::Zero, FixedPointNumber, FixedU128}; use sp_std::{convert::TryFrom, ops::RangeInclusive}; // --- darwinia-network --- use crate::*; -use bridge_primitives::{ +pub use darwinia_balances::{Instance1 as RingInstance, Instance2 as KtonInstance}; +use dp_s2s::{CallParams, CreatePayload}; +use drml_bridge_primitives::{ FromThisChainMessageVerifier, PANGOLIN_CHAIN_ID, PANGORO_CHAIN_ID, PANGORO_PANGOLIN_LANE, WITH_PANGORO_MESSAGES_PALLET_NAME, }; -pub use darwinia_balances::{Instance1 as RingInstance, Instance2 as KtonInstance}; -use dp_s2s::{CallParams, CreatePayload}; /// Message payload for Pangoro -> Pangolin messages. pub type ToPangolinMessagePayload = FromThisChainMessagePayload; @@ -150,17 +150,18 @@ impl messages::ThisChainWithMessages for Pangoro { fn estimate_delivery_confirmation_transaction() -> MessageTransaction { let inbound_data_size = InboundLaneData::::encoded_size_hint( - bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE, + drml_bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE, 1, 1, ) .unwrap_or(u32::MAX); MessageTransaction { - dispatch_weight: bridge_primitives::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT, + dispatch_weight: + drml_bridge_primitives::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT, size: inbound_data_size - .saturating_add(bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) - .saturating_add(bridge_primitives::TX_EXTRA_BYTES), + .saturating_add(drml_bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) + .saturating_add(drml_bridge_primitives::TX_EXTRA_BYTES), } } @@ -219,17 +220,17 @@ impl messages::BridgedChainWithMessages for Pangolin { MessageTransaction { dispatch_weight: extra_bytes_in_payload - .saturating_mul(bridge_primitives::ADDITIONAL_MESSAGE_BYTE_DELIVERY_WEIGHT) - .saturating_add(bridge_primitives::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT) + .saturating_mul(drml_bridge_primitives::ADDITIONAL_MESSAGE_BYTE_DELIVERY_WEIGHT) + .saturating_add(drml_bridge_primitives::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT) .saturating_add(message_dispatch_weight) .saturating_sub(if include_pay_dispatch_fee_cost { 0 } else { - bridge_primitives::PAY_INBOUND_DISPATCH_FEE_WEIGHT + drml_bridge_primitives::PAY_INBOUND_DISPATCH_FEE_WEIGHT }), size: message_payload_len - .saturating_add(bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) - .saturating_add(bridge_primitives::TX_EXTRA_BYTES), + .saturating_add(drml_bridge_primitives::EXTRA_STORAGE_PROOF_SIZE) + .saturating_add(drml_bridge_primitives::TX_EXTRA_BYTES), } } diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 17edacdcc0..bc555ec0b7 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -17,7 +17,6 @@ futures = { version = "0.3" } rand = { version = "0.8" } serde_json = { version = "1.0" } # darwinia-network -common-primitives = { path = "../primitives/common" } darwinia-balances-rpc-runtime-api = { path = "../../frame/balances/rpc/runtime-api" } darwinia-bridge-ethereum = { path = "../../frame/bridge/ethereum" } darwinia-claims = { path = "../../frame/claims" } @@ -30,6 +29,7 @@ dc-db = { path = "../../client/dvm/db" } dc-mapping-sync = { path = "../../client/dvm/mapping-sync" } dc-rpc = { path = "../../client/dvm/rpc", features = ["rpc_binary_search_estimate"] } dp-rpc = { path = "../../primitives/rpc" } +drml-common-primitives = { path = "../primitives/common" } drml-rpc = { path = "../rpc" } dvm-rpc-runtime-api = { path = "../../frame/dvm/rpc/runtime-api" } pangolin-runtime = { path = "../runtime/pangolin" } diff --git a/node/service/src/chain_spec/mod.rs b/node/service/src/chain_spec/mod.rs index cd33780266..bcc18451f2 100644 --- a/node/service/src/chain_spec/mod.rs +++ b/node/service/src/chain_spec/mod.rs @@ -30,7 +30,7 @@ use sp_consensus_babe::AuthorityId as BabeId; use sp_core::{sr25519, Pair, Public}; use sp_runtime::traits::IdentifyAccount; // --- darwinia-network --- -use common_primitives::{AccountId, AccountPublic}; +use drml_common_primitives::{AccountId, AccountPublic}; const DEFAULT_PROTOCOL_ID: &str = "drml"; diff --git a/node/service/src/chain_spec/pangolin.rs b/node/service/src/chain_spec/pangolin.rs index d3cd345f55..26bcab5ff3 100644 --- a/node/service/src/chain_spec/pangolin.rs +++ b/node/service/src/chain_spec/pangolin.rs @@ -31,7 +31,7 @@ use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_runtime::Perbill; // --- darwinia-network --- use super::*; -use common_primitives::*; +use drml_common_primitives::*; use darwinia_bridge_ethereum::DagsMerkleRootsLoader as DagsMerkleRootsLoaderR; use darwinia_claims::ClaimsList; use darwinia_evm::GenesisAccount; diff --git a/node/service/src/chain_spec/pangoro.rs b/node/service/src/chain_spec/pangoro.rs index dd13193189..e623c1cd4e 100644 --- a/node/service/src/chain_spec/pangoro.rs +++ b/node/service/src/chain_spec/pangoro.rs @@ -31,7 +31,7 @@ use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_runtime::Perbill; // --- darwinia-network --- use super::*; -use common_primitives::*; +use drml_common_primitives::*; use darwinia_staking::StakerStatus; use pangoro_runtime::*; diff --git a/node/service/src/service/mod.rs b/node/service/src/service/mod.rs index 49e399648e..3206fa7ff9 100644 --- a/node/service/src/service/mod.rs +++ b/node/service/src/service/mod.rs @@ -61,7 +61,7 @@ use sc_service::{ use sp_runtime::traits::BlakeTwo256; use substrate_prometheus_endpoint::Registry; // --- darwinia-network --- -use common_primitives::OpaqueBlock as Block; +use drml_common_primitives::OpaqueBlock as Block; type FullBackend = TFullBackend; type FullSelectChain = LongestChain; diff --git a/node/service/src/service/pangolin.rs b/node/service/src/service/pangolin.rs index 2a28441d3a..e9618b0f80 100644 --- a/node/service/src/service/pangolin.rs +++ b/node/service/src/service/pangolin.rs @@ -64,7 +64,7 @@ use crate::{ LightClient, }, }; -use common_primitives::{AccountId, Balance, Hash, Nonce, OpaqueBlock as Block, Power}; +use drml_common_primitives::{AccountId, Balance, Hash, Nonce, OpaqueBlock as Block, Power}; use dc_db::{Backend, DatabaseSettings, DatabaseSettingsSrc}; use dc_mapping_sync::{MappingSyncWorker, SyncStrategy}; use dc_rpc::EthTask; diff --git a/node/service/src/service/pangoro.rs b/node/service/src/service/pangoro.rs index 8b59a18d34..a695ba7ab4 100644 --- a/node/service/src/service/pangoro.rs +++ b/node/service/src/service/pangoro.rs @@ -59,7 +59,7 @@ use crate::{ LightClient, }, }; -use common_primitives::{AccountId, Balance, Nonce, OpaqueBlock as Block}; +use drml_common_primitives::{AccountId, Balance, Nonce, OpaqueBlock as Block}; use drml_rpc::{ pangoro::{FullDeps, LightDeps}, BabeDeps, DenyUnsafe, GrandpaDeps, RpcExtension, SubscriptionTaskExecutor,