From 04125d697ce25b4cfde921e52985fc27bebc93c5 Mon Sep 17 00:00:00 2001 From: Kai <7630809+Kailai-Wang@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:08:07 +0200 Subject: [PATCH] Move pallet-parentchain to worker directory (#3105) * Move pallet-parentchain to worker directory * update toml --- parachain/Cargo.toml | 4 +- .../worker-pallets/parentchain/Cargo.toml | 38 ------------------- tee-worker/Cargo.lock | 3 ++ tee-worker/Cargo.toml | 3 +- .../bitacross/app-libs/sgx-runtime/Cargo.toml | 3 +- tee-worker/bitacross/app-libs/stf/Cargo.toml | 9 +---- .../litentry/pallets/parentchain/Cargo.toml | 36 ++++++++++++++++++ .../litentry/pallets}/parentchain/src/lib.rs | 0 .../litentry/pallets}/parentchain/src/mock.rs | 0 .../pallets}/parentchain/src/tests.rs | 0 .../pallets}/parentchain/src/weights.rs | 0 .../identity/app-libs/sgx-runtime/Cargo.toml | 3 +- tee-worker/identity/app-libs/stf/Cargo.toml | 4 +- 13 files changed, 48 insertions(+), 55 deletions(-) delete mode 100644 parachain/worker-pallets/parentchain/Cargo.toml create mode 100644 tee-worker/common/litentry/pallets/parentchain/Cargo.toml rename {parachain/worker-pallets => tee-worker/common/litentry/pallets}/parentchain/src/lib.rs (100%) rename {parachain/worker-pallets => tee-worker/common/litentry/pallets}/parentchain/src/mock.rs (100%) rename {parachain/worker-pallets => tee-worker/common/litentry/pallets}/parentchain/src/tests.rs (100%) rename {parachain/worker-pallets => tee-worker/common/litentry/pallets}/parentchain/src/weights.rs (100%) diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 46d2adfc75..d229cfd2eb 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -24,9 +24,7 @@ members = [ 'runtime/paseo', 'runtime/common', ] -exclude = [ - 'worker-pallets', -] +exclude = [] [profile.release] opt-level = 3 diff --git a/parachain/worker-pallets/parentchain/Cargo.toml b/parachain/worker-pallets/parentchain/Cargo.toml deleted file mode 100644 index d8ac2d1c79..0000000000 --- a/parachain/worker-pallets/parentchain/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "pallet-parentchain" -description = "The remote attestation registry and verification pallet for litentry blockchains and parachains" -version = "0.1.0" -authors = ['Trust Computing GmbH ', 'Integritee AG '] -homepage = 'https://litentry.com/' -repository = 'https://github.com/litentry/litentry-parachain' -license = "Apache-2.0" -edition = "2021" - -[dependencies] -parity-scale-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } - -[dev-dependencies] -env_logger = "0.9.0" -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } - -[features] -default = ["std"] -std = [ - "parity-scale-codec/std", - "scale-info/std", - "frame-support/std", - "frame-system/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", -] - -try-runtime = ["frame-support/try-runtime"] diff --git a/tee-worker/Cargo.lock b/tee-worker/Cargo.lock index 10c958bc63..3598a69365 100644 --- a/tee-worker/Cargo.lock +++ b/tee-worker/Cargo.lock @@ -6679,12 +6679,15 @@ dependencies = [ name = "pallet-parentchain" version = "0.1.0" dependencies = [ + "env_logger 0.10.2", "frame-support", "frame-system", + "pallet-balances", "parity-scale-codec", "scale-info", "sp-core", "sp-io 7.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42)", + "sp-keyring", "sp-runtime", ] diff --git a/tee-worker/Cargo.toml b/tee-worker/Cargo.toml index fd82b102bb..07f58471b0 100644 --- a/tee-worker/Cargo.toml +++ b/tee-worker/Cargo.toml @@ -20,7 +20,7 @@ members = [ "common/litentry/core/parachain-extrinsic-task/receiver", "common/litentry/core/teebag-storage", "common/litentry/macros", - "common/litentry/pallets/identity-management", + "common/litentry/pallets/*", "common/litentry/primitives", "common/core/parentchain/light-client", @@ -272,6 +272,7 @@ itp-test = { path = "common/core-primitives/test", default-features = false } # litentry litentry-primitives = { path = "common/litentry/primitives", default-features = false } litentry-worker-macros = { path = "common/litentry/macros" } +pallet-parentchain = { path = "common/litentry/pallets/parentchain", default-features = false } pallet-identity-management-tee = { path = "common/litentry/pallets/identity-management", default-features = false } lc-teebag-storage = { path = "common/litentry/core/teebag-storage", default-features = false } lc-parachain-extrinsic-task-sender = { path = "common/litentry/core/parachain-extrinsic-task/sender", default-features = false } diff --git a/tee-worker/bitacross/app-libs/sgx-runtime/Cargo.toml b/tee-worker/bitacross/app-libs/sgx-runtime/Cargo.toml index 4c543ff2f1..f49678f57e 100644 --- a/tee-worker/bitacross/app-libs/sgx-runtime/Cargo.toml +++ b/tee-worker/bitacross/app-libs/sgx-runtime/Cargo.toml @@ -26,8 +26,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-version = { workspace = true } -# TODO - move to tee-worker pallets -pallet-parentchain = { path = "../../../../parachain/worker-pallets/parentchain", default-features = false } +pallet-parentchain = { workspace = true } [features] default = ["std"] diff --git a/tee-worker/bitacross/app-libs/stf/Cargo.toml b/tee-worker/bitacross/app-libs/stf/Cargo.toml index 1111f64f0c..d3016c539c 100644 --- a/tee-worker/bitacross/app-libs/stf/Cargo.toml +++ b/tee-worker/bitacross/app-libs/stf/Cargo.toml @@ -32,9 +32,9 @@ sp-core = { workspace = true, features = ["full_crypto"] } sp-runtime = { workspace = true } sp-std = { workspace = true } -litentry-macros = { path = "../../../../common/primitives/core/macros", default-features = false } +litentry-macros = { workspace = true } litentry-primitives = { workspace = true } -pallet-parentchain = { path = "../../../../parachain/worker-pallets/parentchain", default-features = false } +pallet-parentchain = { workspace = true } [dev-dependencies] sp-keyring = { workspace = true } @@ -46,14 +46,12 @@ sgx = [ "itp-sgx-externalities/sgx", "sp-io/sgx", "itp-node-api/sgx", - # litentry "litentry-primitives/sgx", ] std = [ # crates.io "codec/std", "log/std", - # local "ita-sgx-runtime/std", "itp-hashing/std", "itp-sgx-externalities/std", @@ -61,17 +59,14 @@ std = [ "itp-storage/std", "itp-types/std", "itp-node-api/std", - # substrate "sp-core/std", "pallet-balances/std", "pallet-sudo/std", "frame-system/std", "frame-support/std", "sp-runtime/std", - # scs/integritee "pallet-parentchain/std", "sp-io/std", - # litentry "litentry-primitives/std", ] test = [] diff --git a/tee-worker/common/litentry/pallets/parentchain/Cargo.toml b/tee-worker/common/litentry/pallets/parentchain/Cargo.toml new file mode 100644 index 0000000000..e6e85e0641 --- /dev/null +++ b/tee-worker/common/litentry/pallets/parentchain/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "pallet-parentchain" +description = "The pallet to sync and store some parentchain state" +version = "0.1.0" +authors = ['Trust Computing GmbH ', 'Integritee AG '] +homepage = 'https://litentry.com/' +repository = 'https://github.com/litentry/litentry-parachain' +license = "Apache-2.0" +edition = "2021" + +[dependencies] +codec = { package = "parity-scale-codec", workspace = true } +scale-info = { workspace = true } + +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } + +[dev-dependencies] +env_logger = { workspace = true } +sp-keyring = { workspace = true } +pallet-balances = { workspace = true, features = ["std"] } + +[features] +default = ["std"] +std = [ + "codec/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", +] diff --git a/parachain/worker-pallets/parentchain/src/lib.rs b/tee-worker/common/litentry/pallets/parentchain/src/lib.rs similarity index 100% rename from parachain/worker-pallets/parentchain/src/lib.rs rename to tee-worker/common/litentry/pallets/parentchain/src/lib.rs diff --git a/parachain/worker-pallets/parentchain/src/mock.rs b/tee-worker/common/litentry/pallets/parentchain/src/mock.rs similarity index 100% rename from parachain/worker-pallets/parentchain/src/mock.rs rename to tee-worker/common/litentry/pallets/parentchain/src/mock.rs diff --git a/parachain/worker-pallets/parentchain/src/tests.rs b/tee-worker/common/litentry/pallets/parentchain/src/tests.rs similarity index 100% rename from parachain/worker-pallets/parentchain/src/tests.rs rename to tee-worker/common/litentry/pallets/parentchain/src/tests.rs diff --git a/parachain/worker-pallets/parentchain/src/weights.rs b/tee-worker/common/litentry/pallets/parentchain/src/weights.rs similarity index 100% rename from parachain/worker-pallets/parentchain/src/weights.rs rename to tee-worker/common/litentry/pallets/parentchain/src/weights.rs diff --git a/tee-worker/identity/app-libs/sgx-runtime/Cargo.toml b/tee-worker/identity/app-libs/sgx-runtime/Cargo.toml index 4ab2da5325..fef1a94e42 100644 --- a/tee-worker/identity/app-libs/sgx-runtime/Cargo.toml +++ b/tee-worker/identity/app-libs/sgx-runtime/Cargo.toml @@ -26,10 +26,9 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-version = { workspace = true } -# TODO - move to tee-worker pallets pallet-evm = { git = "https://github.com/integritee-network/frontier", branch = "bar/polkadot-v0.9.42", default-features = false, optional = true } pallet-identity-management-tee = { workspace = true } -pallet-parentchain = { package = "pallet-parentchain", path = "../../../../parachain/worker-pallets/parentchain", default-features = false } +pallet-parentchain = { workspace = true } [features] default = ["std"] diff --git a/tee-worker/identity/app-libs/stf/Cargo.toml b/tee-worker/identity/app-libs/stf/Cargo.toml index 20f5d40d85..02b7067a1b 100644 --- a/tee-worker/identity/app-libs/stf/Cargo.toml +++ b/tee-worker/identity/app-libs/stf/Cargo.toml @@ -39,9 +39,9 @@ sp-std = { workspace = true } itp-node-api-metadata-provider = { workspace = true } lc-stf-task-sender = { path = "../../litentry/core/stf-task/sender", default-features = false } litentry-hex-utils = { workspace = true } -litentry-macros = { path = "../../../../common/primitives/core/macros", default-features = false } +litentry-macros = { workspace = true } litentry-primitives = { workspace = true } -pallet-parentchain = { path = "../../../../parachain/worker-pallets/parentchain", default-features = false } +pallet-parentchain = { workspace = true } [dev-dependencies] sp-keyring = { workspace = true }