diff --git a/Cargo.lock b/Cargo.lock index a4c8a307b..a47264471 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2280,7 +2280,7 @@ dependencies = [ ] [[package]] -name = "dip-receiver-node-template" +name = "dip-consumer-node-template" version = "1.11.0-dev" dependencies = [ "clap", @@ -2291,7 +2291,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", - "dip-receiver-runtime-template", + "dip-consumer-runtime-template", "frame-benchmarking", "frame-benchmarking-cli", "jsonrpsee", @@ -2329,7 +2329,7 @@ dependencies = [ ] [[package]] -name = "dip-receiver-runtime-template" +name = "dip-consumer-runtime-template" version = "1.11.0-dev" dependencies = [ "cumulus-pallet-aura-ext", @@ -2345,13 +2345,12 @@ dependencies = [ "frame-support", "frame-system", "frame-system-rpc-runtime-api", - "kilt-runtime-api-dip-sender", "pallet-aura", "pallet-authorship", "pallet-balances", "pallet-collator-selection", "pallet-did-lookup", - "pallet-dip-receiver", + "pallet-dip-consumer", "pallet-session", "pallet-sudo", "pallet-timestamp", @@ -2382,7 +2381,7 @@ dependencies = [ ] [[package]] -name = "dip-sender-node-template" +name = "dip-provider-node-template" version = "1.11.0-dev" dependencies = [ "clap", @@ -2393,7 +2392,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", - "dip-sender-runtime-template", + "dip-provider-runtime-template", "frame-benchmarking", "frame-benchmarking-cli", "jsonrpsee", @@ -2431,7 +2430,7 @@ dependencies = [ ] [[package]] -name = "dip-sender-runtime-template" +name = "dip-provider-runtime-template" version = "1.11.0-dev" dependencies = [ "cumulus-pallet-aura-ext", @@ -2448,11 +2447,12 @@ dependencies = [ "frame-support", "frame-system", "frame-system-rpc-runtime-api", + "kilt-runtime-api-dip-provider", "pallet-aura", "pallet-authorship", "pallet-balances", "pallet-collator-selection", - "pallet-dip-sender", + "pallet-dip-provider", "pallet-session", "pallet-sudo", "pallet-timestamp", @@ -2496,8 +2496,8 @@ version = "1.11.0-dev" dependencies = [ "cumulus-pallet-xcmp-queue", "did", - "dip-receiver-runtime-template", - "dip-sender-runtime-template", + "dip-consumer-runtime-template", + "dip-provider-runtime-template", "dip-support", "frame-support", "frame-system", @@ -4286,7 +4286,7 @@ dependencies = [ ] [[package]] -name = "kilt-runtime-api-dip-sender" +name = "kilt-runtime-api-dip-provider" version = "1.11.0-dev" dependencies = [ "parity-scale-codec", @@ -6242,7 +6242,7 @@ dependencies = [ ] [[package]] -name = "pallet-dip-receiver" +name = "pallet-dip-consumer" version = "1.11.0-dev" dependencies = [ "cumulus-pallet-xcm", @@ -6256,7 +6256,7 @@ dependencies = [ ] [[package]] -name = "pallet-dip-sender" +name = "pallet-dip-provider" version = "1.11.0-dev" dependencies = [ "dip-support", @@ -9409,8 +9409,8 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-did-lookup", - "pallet-dip-receiver", - "pallet-dip-sender", + "pallet-dip-consumer", + "pallet-dip-provider", "pallet-inflation", "pallet-membership", "pallet-transaction-payment", diff --git a/Cargo.toml b/Cargo.toml index 292ea62c9..221c4cac8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,8 +51,8 @@ attestation = {path = "pallets/attestation", default-features = false} ctype = {path = "pallets/ctype", default-features = false} delegation = {path = "pallets/delegation", default-features = false} did = {path = "pallets/did", default-features = false} -pallet-dip-receiver = {path = "pallets/pallet-dip-receiver", default-features = false} -pallet-dip-sender = {path = "pallets/pallet-dip-sender", default-features = false} +pallet-dip-consumer = {path = "pallets/pallet-dip-consumer", default-features = false} +pallet-dip-provider = {path = "pallets/pallet-dip-provider", default-features = false} pallet-did-lookup = {path = "pallets/pallet-did-lookup", default-features = false} pallet-inflation = {path = "pallets/pallet-inflation", default-features = false} pallet-web3-names = {path = "pallets/pallet-web3-names", default-features = false} @@ -66,12 +66,12 @@ kilt-support = {path = "support", default-features = false} runtime-common = {path = "runtimes/common", default-features = false} # Templates -dip-receiver-runtime-template = {path = "dip-template/runtimes/dip-receiver", default-features = false} -dip-sender-runtime-template = {path = "dip-template/runtimes/dip-sender", default-features = false} +dip-consumer-runtime-template = {path = "dip-template/runtimes/dip-consumer", default-features = false} +dip-provider-runtime-template = {path = "dip-template/runtimes/dip-provider", default-features = false} # Internal runtime API (with default disabled) kilt-runtime-api-did = {path = "runtime-api/did", default-features = false} -kilt-runtime-api-dip-sender = {path = "runtime-api/dip-sender", default-features = false} +kilt-runtime-api-dip-provider = {path = "runtime-api/dip-provider", default-features = false} kilt-runtime-api-public-credentials = {path = "runtime-api/public-credentials", default-features = false} kilt-runtime-api-staking = {path = "runtime-api/staking", default-features = false} diff --git a/dip-template/nodes/dip-receiver/Cargo.toml b/dip-template/nodes/dip-consumer/Cargo.toml similarity index 94% rename from dip-template/nodes/dip-receiver/Cargo.toml rename to dip-template/nodes/dip-consumer/Cargo.toml index 1f217b7d0..ed4ecf7dd 100644 --- a/dip-template/nodes/dip-receiver/Cargo.toml +++ b/dip-template/nodes/dip-consumer/Cargo.toml @@ -7,8 +7,8 @@ license-file.workspace = true readme.workspace = true repository.workspace = true version.workspace = true -name = "dip-receiver-node-template" -description = "Node template for the KILT Decentralized Identity Provider (DIP) receiver." +name = "dip-consumer-node-template" +description = "Node template for the KILT Decentralized Identity Provider (DIP) consumer." build = "build.rs" [dependencies] @@ -19,7 +19,7 @@ serde = {workspace = true, features = ["std", "derive"]} jsonrpsee = {workspace = true, features = ["server"]} # Internal dependencies -dip-receiver-runtime-template = { workspace = true, features = ["std"] } +dip-consumer-runtime-template = { workspace = true, features = ["std"] } # Substrate frame-benchmarking.workspace = true diff --git a/dip-template/nodes/dip-receiver/build.rs b/dip-template/nodes/dip-consumer/build.rs similarity index 100% rename from dip-template/nodes/dip-receiver/build.rs rename to dip-template/nodes/dip-consumer/build.rs diff --git a/dip-template/nodes/dip-receiver/src/chain_spec.rs b/dip-template/nodes/dip-consumer/src/chain_spec.rs similarity index 97% rename from dip-template/nodes/dip-receiver/src/chain_spec.rs rename to dip-template/nodes/dip-consumer/src/chain_spec.rs index 50daa7a56..4330bf5c6 100644 --- a/dip-template/nodes/dip-receiver/src/chain_spec.rs +++ b/dip-template/nodes/dip-consumer/src/chain_spec.rs @@ -17,7 +17,7 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org use cumulus_primitives_core::ParaId; -use dip_receiver_runtime_template::{ +use dip_consumer_runtime_template::{ AccountId, AuraId, BalancesConfig, CollatorSelectionConfig, GenesisConfig, ParachainInfoConfig, SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig, EXISTENTIAL_DEPOSIT, SS58_PREFIX, WASM_BINARY, }; @@ -111,8 +111,8 @@ pub fn development_config() -> ChainSpec { properties.insert("ss58Format".into(), SS58_PREFIX.into()); ChainSpec::from_genesis( - "DIP receiver dev", - "dip-receiver-dev", + "DIP consumer dev", + "dip-consumer-dev", ChainType::Development, move || { testnet_genesis( @@ -133,7 +133,7 @@ pub fn development_config() -> ChainSpec { }, Vec::new(), None, - "dip-receiver-dev".into(), + "dip-consumer-dev".into(), None, None, Extensions { diff --git a/dip-template/nodes/dip-receiver/src/cli.rs b/dip-template/nodes/dip-consumer/src/cli.rs similarity index 100% rename from dip-template/nodes/dip-receiver/src/cli.rs rename to dip-template/nodes/dip-consumer/src/cli.rs diff --git a/dip-template/nodes/dip-receiver/src/command.rs b/dip-template/nodes/dip-consumer/src/command.rs similarity index 97% rename from dip-template/nodes/dip-receiver/src/command.rs rename to dip-template/nodes/dip-consumer/src/command.rs index 0e9db24e4..697b6f936 100644 --- a/dip-template/nodes/dip-receiver/src/command.rs +++ b/dip-template/nodes/dip-consumer/src/command.rs @@ -20,7 +20,7 @@ use std::{fs::create_dir_all, net::SocketAddr}; use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; -use dip_receiver_runtime_template::Block; +use dip_consumer_runtime_template::Block; use log::{info, warn}; use parity_scale_codec::Encode; use sc_cli::{ @@ -51,7 +51,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { impl SubstrateCli for Cli { fn impl_name() -> String { - "DIP Receiver Node Template".into() + "DIP Consumer Node Template".into() } fn impl_version() -> String { @@ -60,7 +60,7 @@ impl SubstrateCli for Cli { fn description() -> String { format!( - "DIP Receiver Node Template\n\nThe command-line arguments provided first will be \ + "DIP Consumer Node Template\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ {} -- ", @@ -85,13 +85,13 @@ impl SubstrateCli for Cli { } fn native_runtime_version(_spec: &Box) -> &'static RuntimeVersion { - &dip_receiver_runtime_template::VERSION + &dip_consumer_runtime_template::VERSION } } impl SubstrateCli for RelayChainCli { fn impl_name() -> String { - "DIP Receiver Node Template".into() + "DIP Consumer Node Template".into() } fn impl_version() -> String { @@ -100,7 +100,7 @@ impl SubstrateCli for RelayChainCli { fn description() -> String { format!( - "DIP Receiver Node Template\n\nThe command-line arguments provided first will be \ + "DIP Consumer Node Template\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ {} -- ", diff --git a/dip-template/nodes/dip-sender/src/main.rs b/dip-template/nodes/dip-consumer/src/main.rs similarity index 94% rename from dip-template/nodes/dip-sender/src/main.rs rename to dip-template/nodes/dip-consumer/src/main.rs index a3e57e48c..21ec9b13e 100644 --- a/dip-template/nodes/dip-sender/src/main.rs +++ b/dip-template/nodes/dip-consumer/src/main.rs @@ -16,7 +16,7 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org -//! KILT Decentralized Identity Provider (DIP) sender CLI. +//! KILT Decentralized Identity Provider (DIP) consumer CLI. #![warn(missing_docs)] diff --git a/dip-template/nodes/dip-receiver/src/rpc.rs b/dip-template/nodes/dip-consumer/src/rpc.rs similarity index 97% rename from dip-template/nodes/dip-receiver/src/rpc.rs rename to dip-template/nodes/dip-consumer/src/rpc.rs index 30a8bd3b0..2437c0e63 100644 --- a/dip-template/nodes/dip-receiver/src/rpc.rs +++ b/dip-template/nodes/dip-consumer/src/rpc.rs @@ -23,7 +23,7 @@ use substrate_frame_rpc_system::AccountNonceApi; use std::{error::Error, sync::Arc}; -use dip_receiver_runtime_template::{AccountId, Balance, Index as Nonce, NodeBlock as Block}; +use dip_consumer_runtime_template::{AccountId, Balance, Index as Nonce, NodeBlock as Block}; use jsonrpsee::RpcModule; use pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi; use sc_client_api::AuxStore; diff --git a/dip-template/nodes/dip-receiver/src/service.rs b/dip-template/nodes/dip-consumer/src/service.rs similarity index 99% rename from dip-template/nodes/dip-receiver/src/service.rs rename to dip-template/nodes/dip-consumer/src/service.rs index 82c07368a..86a0ee102 100644 --- a/dip-template/nodes/dip-receiver/src/service.rs +++ b/dip-template/nodes/dip-consumer/src/service.rs @@ -30,7 +30,7 @@ use cumulus_client_service::{ use cumulus_primitives_core::ParaId; use cumulus_primitives_parachain_inherent::ParachainInherentData; use cumulus_relay_chain_interface::RelayChainInterface; -use dip_receiver_runtime_template::{api, native_version, Hash, NodeBlock as Block, RuntimeApi}; +use dip_consumer_runtime_template::{api, native_version, Hash, NodeBlock as Block, RuntimeApi}; use frame_benchmarking::benchmarking::HostFunctions; use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE; use sc_basic_authorship::ProposerFactory; diff --git a/dip-template/nodes/dip-sender/Cargo.toml b/dip-template/nodes/dip-provider/Cargo.toml similarity index 94% rename from dip-template/nodes/dip-sender/Cargo.toml rename to dip-template/nodes/dip-provider/Cargo.toml index c77a4b72e..3edfbb6a7 100644 --- a/dip-template/nodes/dip-sender/Cargo.toml +++ b/dip-template/nodes/dip-provider/Cargo.toml @@ -7,8 +7,8 @@ license-file.workspace = true readme.workspace = true repository.workspace = true version.workspace = true -name = "dip-sender-node-template" -description = "Node template for the KILT Decentralized Identity Provider (DIP) sender." +name = "dip-provider-node-template" +description = "Node template for the KILT Decentralized Identity Provider (DIP) provider." build = "build.rs" [dependencies] @@ -19,7 +19,7 @@ serde = {workspace = true, features = ["std", "derive"]} jsonrpsee = {workspace = true, features = ["server"]} # Internal dependencies -dip-sender-runtime-template = { workspace = true, features = ["std"] } +dip-provider-runtime-template = { workspace = true, features = ["std"] } # Substrate frame-benchmarking.workspace = true diff --git a/dip-template/nodes/dip-sender/build.rs b/dip-template/nodes/dip-provider/build.rs similarity index 100% rename from dip-template/nodes/dip-sender/build.rs rename to dip-template/nodes/dip-provider/build.rs diff --git a/dip-template/nodes/dip-sender/src/chain_spec.rs b/dip-template/nodes/dip-provider/src/chain_spec.rs similarity index 97% rename from dip-template/nodes/dip-sender/src/chain_spec.rs rename to dip-template/nodes/dip-provider/src/chain_spec.rs index 8fe5269ad..7c323d7be 100644 --- a/dip-template/nodes/dip-sender/src/chain_spec.rs +++ b/dip-template/nodes/dip-provider/src/chain_spec.rs @@ -17,7 +17,7 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org use cumulus_primitives_core::ParaId; -use dip_sender_runtime_template::{ +use dip_provider_runtime_template::{ AccountId, AuraId, BalancesConfig, CollatorSelectionConfig, GenesisConfig, ParachainInfoConfig, SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig, EXISTENTIAL_DEPOSIT, SS58_PREFIX, WASM_BINARY, }; @@ -110,8 +110,8 @@ pub fn development_config() -> ChainSpec { properties.insert("ss58Format".into(), SS58_PREFIX.into()); ChainSpec::from_genesis( - "DIP sender dev", - "dip-sender-dev", + "DIP provider dev", + "dip-provider-dev", ChainType::Development, move || { testnet_genesis( @@ -132,7 +132,7 @@ pub fn development_config() -> ChainSpec { }, Vec::new(), None, - "dip-sender-dev".into(), + "dip-provider-dev".into(), None, None, Extensions { diff --git a/dip-template/nodes/dip-sender/src/cli.rs b/dip-template/nodes/dip-provider/src/cli.rs similarity index 100% rename from dip-template/nodes/dip-sender/src/cli.rs rename to dip-template/nodes/dip-provider/src/cli.rs diff --git a/dip-template/nodes/dip-sender/src/command.rs b/dip-template/nodes/dip-provider/src/command.rs similarity index 97% rename from dip-template/nodes/dip-sender/src/command.rs rename to dip-template/nodes/dip-provider/src/command.rs index da2116679..8ec7f22c7 100644 --- a/dip-template/nodes/dip-sender/src/command.rs +++ b/dip-template/nodes/dip-provider/src/command.rs @@ -20,7 +20,7 @@ use std::{fs::create_dir_all, net::SocketAddr}; use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; -use dip_sender_runtime_template::Block; +use dip_provider_runtime_template::Block; use log::{info, warn}; use parity_scale_codec::Encode; use sc_cli::{ @@ -51,7 +51,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { impl SubstrateCli for Cli { fn impl_name() -> String { - "DIP Sender Node Template".into() + "DIP Provider Node Template".into() } fn impl_version() -> String { @@ -60,7 +60,7 @@ impl SubstrateCli for Cli { fn description() -> String { format!( - "DIP Sender Node Template\n\nThe command-line arguments provided first will be \ + "DIP Provider Node Template\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ {} -- ", @@ -85,13 +85,13 @@ impl SubstrateCli for Cli { } fn native_runtime_version(_spec: &Box) -> &'static RuntimeVersion { - &dip_sender_runtime_template::VERSION + &dip_provider_runtime_template::VERSION } } impl SubstrateCli for RelayChainCli { fn impl_name() -> String { - "DIP Sender Node Template".into() + "DIP Provider Node Template".into() } fn impl_version() -> String { @@ -100,7 +100,7 @@ impl SubstrateCli for RelayChainCli { fn description() -> String { format!( - "DIP Sender Node Template\n\nThe command-line arguments provided first will be \ + "DIP Provider Node Template\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ {} -- ", diff --git a/dip-template/nodes/dip-receiver/src/main.rs b/dip-template/nodes/dip-provider/src/main.rs similarity index 94% rename from dip-template/nodes/dip-receiver/src/main.rs rename to dip-template/nodes/dip-provider/src/main.rs index e0250cebc..272c3dd49 100644 --- a/dip-template/nodes/dip-receiver/src/main.rs +++ b/dip-template/nodes/dip-provider/src/main.rs @@ -16,7 +16,7 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org -//! KILT Decentralized Identity Provider (DIP) receiver CLI. +//! KILT Decentralized Identity Provider (DIP) Provider CLI. #![warn(missing_docs)] diff --git a/dip-template/nodes/dip-sender/src/rpc.rs b/dip-template/nodes/dip-provider/src/rpc.rs similarity index 96% rename from dip-template/nodes/dip-sender/src/rpc.rs rename to dip-template/nodes/dip-provider/src/rpc.rs index 79365ebb0..eb86db0d5 100644 --- a/dip-template/nodes/dip-sender/src/rpc.rs +++ b/dip-template/nodes/dip-provider/src/rpc.rs @@ -23,7 +23,7 @@ use substrate_frame_rpc_system::AccountNonceApi; use std::{error::Error, sync::Arc}; -use dip_sender_runtime_template::{AccountId, Balance, Index as Nonce, NodeBlock as Block}; +use dip_provider_runtime_template::{AccountId, Balance, Index as Nonce, NodeBlock as Block}; use jsonrpsee::RpcModule; use pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi; use sc_client_api::AuxStore; diff --git a/dip-template/nodes/dip-sender/src/service.rs b/dip-template/nodes/dip-provider/src/service.rs similarity index 99% rename from dip-template/nodes/dip-sender/src/service.rs rename to dip-template/nodes/dip-provider/src/service.rs index 942140324..fe0c485bc 100644 --- a/dip-template/nodes/dip-sender/src/service.rs +++ b/dip-template/nodes/dip-provider/src/service.rs @@ -30,7 +30,7 @@ use cumulus_client_service::{ use cumulus_primitives_core::ParaId; use cumulus_primitives_parachain_inherent::ParachainInherentData; use cumulus_relay_chain_interface::RelayChainInterface; -use dip_sender_runtime_template::{api, native_version, Hash, NodeBlock as Block, RuntimeApi}; +use dip_provider_runtime_template::{api, native_version, Hash, NodeBlock as Block, RuntimeApi}; use frame_benchmarking::benchmarking::HostFunctions; use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE; use sc_basic_authorship::ProposerFactory; diff --git a/dip-template/runtimes/dip-receiver/Cargo.toml b/dip-template/runtimes/dip-consumer/Cargo.toml similarity index 94% rename from dip-template/runtimes/dip-receiver/Cargo.toml rename to dip-template/runtimes/dip-consumer/Cargo.toml index 07f7c5e50..2073d9d27 100644 --- a/dip-template/runtimes/dip-receiver/Cargo.toml +++ b/dip-template/runtimes/dip-consumer/Cargo.toml @@ -1,11 +1,11 @@ [package] authors.workspace = true -description = "Parachain runtime template for the KILT Decentralized Identity Provider (DIP) receiver." +description = "Parachain runtime template for the KILT Decentralized Identity Provider (DIP) consumer." documentation.workspace = true edition.workspace = true homepage.workspace = true license-file.workspace = true -name = "dip-receiver-runtime-template" +name = "dip-consumer-runtime-template" readme.workspace = true repository.workspace = true version.workspace = true @@ -20,7 +20,7 @@ scale-info = {workspace = true, features = ["derive"]} # DIP did.workspace = true pallet-did-lookup.workspace = true -pallet-dip-receiver.workspace = true +pallet-dip-consumer.workspace = true runtime-common.workspace = true # Substrate @@ -77,7 +77,7 @@ std = [ "scale-info/std", "did/std", "pallet-did-lookup/std", - "pallet-dip-receiver/std", + "pallet-dip-consumer/std", "runtime-common/std", "frame-executive/std", "frame-support/std", @@ -121,7 +121,7 @@ std = [ ] runtime-benchmarks = [ - "pallet-dip-receiver/runtime-benchmarks", + "pallet-dip-consumer/runtime-benchmarks", "runtime-common/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", diff --git a/dip-template/runtimes/dip-receiver/build.rs b/dip-template/runtimes/dip-consumer/build.rs similarity index 100% rename from dip-template/runtimes/dip-receiver/build.rs rename to dip-template/runtimes/dip-consumer/build.rs diff --git a/dip-template/runtimes/dip-receiver/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs similarity index 96% rename from dip-template/runtimes/dip-receiver/src/dip.rs rename to dip-template/runtimes/dip-consumer/src/dip.rs index b17020934..77fc5e79c 100644 --- a/dip-template/runtimes/dip-receiver/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -17,16 +17,16 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org use did::DidVerificationKeyRelationship; -use pallet_dip_receiver::traits::DipCallOriginFilter; +use pallet_dip_consumer::traits::DipCallOriginFilter; use runtime_common::dip::{ - receiver::{DidMerkleProofVerifier, VerificationResult}, + consumer::{DidMerkleProofVerifier, VerificationResult}, ProofLeaf, }; use sp_std::vec::Vec; use crate::{BlockNumber, DidIdentifier, Hash, Hasher, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin}; -impl pallet_dip_receiver::Config for Runtime { +impl pallet_dip_consumer::Config for Runtime { type BlindedValue = Vec>; type DipCallOriginFilter = DipCallFilter; type Identifier = DidIdentifier; diff --git a/dip-template/runtimes/dip-receiver/src/lib.rs b/dip-template/runtimes/dip-consumer/src/lib.rs similarity index 98% rename from dip-template/runtimes/dip-receiver/src/lib.rs rename to dip-template/runtimes/dip-consumer/src/lib.rs index 1037d471b..955a43885 100644 --- a/dip-template/runtimes/dip-receiver/src/lib.rs +++ b/dip-template/runtimes/dip-consumer/src/lib.rs @@ -47,7 +47,7 @@ use frame_system::{ }; use pallet_balances::AccountData; use pallet_collator_selection::IdentityCollator; -use pallet_dip_receiver::{DipOrigin, EnsureDipOrigin}; +use pallet_dip_consumer::{DipOrigin, EnsureDipOrigin}; use pallet_session::{FindAccountFromAuthorIndex, PeriodicSessions}; use pallet_transaction_payment::{CurrencyAdapter, FeeDetails, RuntimeDispatchInfo}; use sp_api::impl_runtime_apis; @@ -142,14 +142,14 @@ construct_runtime!( DidLookup: pallet_did_lookup = 40, // DIP - DipReceiver: pallet_dip_receiver = 50, + DipConsumer: pallet_dip_consumer = 50, } ); #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("dip-receiver-runtime-template"), - impl_name: create_runtime_str!("dip-receiver-runtime-template"), + spec_name: create_runtime_str!("dip-consumer-runtime-template"), + impl_name: create_runtime_str!("dip-consumer-runtime-template"), authoring_version: 1, spec_version: 11100, impl_version: 0, diff --git a/dip-template/runtimes/dip-receiver/src/xcm_config.rs b/dip-template/runtimes/dip-consumer/src/xcm_config.rs similarity index 98% rename from dip-template/runtimes/dip-receiver/src/xcm_config.rs rename to dip-template/runtimes/dip-consumer/src/xcm_config.rs index cc0ee09fc..bb7775be4 100644 --- a/dip-template/runtimes/dip-receiver/src/xcm_config.rs +++ b/dip-template/runtimes/dip-consumer/src/xcm_config.rs @@ -55,7 +55,7 @@ impl Contains for DipTransactSafeCalls { fn contains(t: &RuntimeCall) -> bool { matches!( t, - RuntimeCall::DipReceiver(pallet_dip_receiver::Call::process_identity_action { .. }) + RuntimeCall::DipConsumer(pallet_dip_consumer::Call::process_identity_action { .. }) ) } } diff --git a/dip-template/runtimes/dip-sender/Cargo.toml b/dip-template/runtimes/dip-provider/Cargo.toml similarity index 92% rename from dip-template/runtimes/dip-sender/Cargo.toml rename to dip-template/runtimes/dip-provider/Cargo.toml index 3d638bb4d..77647b7d8 100644 --- a/dip-template/runtimes/dip-sender/Cargo.toml +++ b/dip-template/runtimes/dip-provider/Cargo.toml @@ -1,11 +1,11 @@ [package] authors.workspace = true -description = "Parachain runtime template for the KILT Decentralized Identity Provider (DIP) sender." +description = "Parachain runtime template for the KILT Decentralized Identity Provider (DIP) provider." documentation.workspace = true edition.workspace = true homepage.workspace = true license-file.workspace = true -name = "dip-sender-runtime-template" +name = "dip-provider-runtime-template" readme.workspace = true repository.workspace = true version.workspace = true @@ -20,8 +20,8 @@ scale-info = {workspace = true, features = ["derive"]} # DIP did.workspace = true dip-support.workspace = true -kilt-runtime-api-dip-sender.workspace = true -pallet-dip-sender.workspace = true +kilt-runtime-api-dip-provider.workspace = true +pallet-dip-provider.workspace = true runtime-common.workspace = true # Substrate @@ -76,8 +76,8 @@ std = [ "scale-info/std", "did/std", "dip-support/std", - "kilt-runtime-api-dip-sender/std", - "pallet-dip-sender/std", + "kilt-runtime-api-dip-provider/std", + "pallet-dip-provider/std", "runtime-common/std", "frame-executive/std", "frame-support/std", @@ -119,7 +119,7 @@ std = [ ] runtime-benchmarks = [ "did/runtime-benchmarks", - "pallet-dip-sender/runtime-benchmarks", + "pallet-dip-provider/runtime-benchmarks", "runtime-common/runtime-benchmarks", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", diff --git a/dip-template/runtimes/dip-sender/build.rs b/dip-template/runtimes/dip-provider/build.rs similarity index 100% rename from dip-template/runtimes/dip-sender/build.rs rename to dip-template/runtimes/dip-provider/build.rs diff --git a/dip-template/runtimes/dip-sender/src/dip.rs b/dip-template/runtimes/dip-provider/src/dip.rs similarity index 76% rename from dip-template/runtimes/dip-sender/src/dip.rs rename to dip-template/runtimes/dip-provider/src/dip.rs index a8afc90ac..6fa0d577b 100644 --- a/dip-template/runtimes/dip-sender/src/dip.rs +++ b/dip-template/runtimes/dip-provider/src/dip.rs @@ -18,27 +18,27 @@ use did::did_details::DidDetails; use dip_support::VersionedIdentityProofAction; -use pallet_dip_sender::traits::{TxBuilder, XcmRouterDispatcher}; +use pallet_dip_provider::traits::{TxBuilder, XcmRouterDispatcher}; use parity_scale_codec::{Decode, Encode}; -use runtime_common::dip::sender::{DidIdentityProvider, DidMerkleRootGenerator}; +use runtime_common::dip::provider::{DidIdentityProvider, DidMerkleRootGenerator}; use xcm::{latest::MultiLocation, DoubleEncoded}; use crate::{DidIdentifier, Hash, Runtime, RuntimeEvent, XcmRouter}; #[derive(Encode, Decode)] -enum ReceiverParachainCalls { +enum ConsumerParachainCalls { #[codec(index = 50)] - DipReceiver(ReceiverParachainDipReceiverCalls), + DipConsumer(ConsumerParachainDipConsumerCalls), } #[derive(Encode, Decode)] -enum ReceiverParachainDipReceiverCalls { +enum ConsumerParachainDipConsumerCalls { #[codec(index = 0)] ProcessIdentityAction(VersionedIdentityProofAction), } -pub struct ReceiverParachainTxBuilder; -impl TxBuilder for ReceiverParachainTxBuilder { +pub struct ConsumerParachainTxBuilder; +impl TxBuilder for ConsumerParachainTxBuilder { type Error = (); fn build( @@ -46,14 +46,14 @@ impl TxBuilder for ReceiverParachainTxBuilder { action: VersionedIdentityProofAction, ) -> Result, Self::Error> { let double_encoded: DoubleEncoded<()> = - ReceiverParachainCalls::DipReceiver(ReceiverParachainDipReceiverCalls::ProcessIdentityAction(action)) + ConsumerParachainCalls::DipConsumer(ConsumerParachainDipConsumerCalls::ProcessIdentityAction(action)) .encode() .into(); Ok(double_encoded) } } -impl pallet_dip_sender::Config for Runtime { +impl pallet_dip_provider::Config for Runtime { type Identifier = DidIdentifier; type Identity = DidDetails; type IdentityProofDispatcher = XcmRouterDispatcher; @@ -61,5 +61,5 @@ impl pallet_dip_sender::Config for Runtime { type IdentityProvider = DidIdentityProvider; type ProofOutput = Hash; type RuntimeEvent = RuntimeEvent; - type TxBuilder = ReceiverParachainTxBuilder; + type TxBuilder = ConsumerParachainTxBuilder; } diff --git a/dip-template/runtimes/dip-sender/src/lib.rs b/dip-template/runtimes/dip-provider/src/lib.rs similarity index 96% rename from dip-template/runtimes/dip-sender/src/lib.rs rename to dip-template/runtimes/dip-provider/src/lib.rs index d13871665..d1db46563 100644 --- a/dip-template/runtimes/dip-sender/src/lib.rs +++ b/dip-template/runtimes/dip-provider/src/lib.rs @@ -48,10 +48,10 @@ use frame_system::{ }; use pallet_balances::AccountData; use pallet_collator_selection::IdentityCollator; -use pallet_dip_sender::traits::IdentityProvider; +use pallet_dip_provider::traits::IdentityProvider; use pallet_session::{FindAccountFromAuthorIndex, PeriodicSessions}; use pallet_transaction_payment::{CurrencyAdapter, FeeDetails, RuntimeDispatchInfo}; -use runtime_common::dip::sender::{CompleteMerkleProof, DidMerkleProof, DidMerkleRootGenerator}; +use runtime_common::dip::provider::{CompleteMerkleProof, DidMerkleProof, DidMerkleRootGenerator}; use sp_api::impl_runtime_apis; use sp_consensus_aura::SlotDuration; use sp_core::{crypto::KeyTypeId, ConstU128, ConstU16, OpaqueMetadata}; @@ -142,14 +142,14 @@ construct_runtime!( Did: did = 40, // DIP - DipSender: pallet_dip_sender = 50, + DipProvider: pallet_dip_provider = 50, } ); #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("dip-sender-runtime-template"), - impl_name: create_runtime_str!("dip-sender-runtime-template"), + spec_name: create_runtime_str!("dip-provider-runtime-template"), + impl_name: create_runtime_str!("dip-provider-runtime-template"), authoring_version: 1, spec_version: 11100, impl_version: 0, @@ -530,9 +530,9 @@ impl_runtime_apis! { // TODO: `keys` could and should be a BTreeSet, but it makes it more complicated for clients to build the type. So we use a Vec, since the keys are deduplicated anyway at proof creation time. // TODO: Support generating different versions of the proof, based on the provided parameter - impl kilt_runtime_api_dip_sender::DipSender, Vec>, CompleteMerkleProof>, ()> for Runtime { + impl kilt_runtime_api_dip_provider::DipProvider, Vec>, CompleteMerkleProof>, ()> for Runtime { fn generate_proof(identifier: DidIdentifier, keys: Vec>) -> Result>, ()> { - if let Ok(Some((did_details, _))) = ::IdentityProvider::retrieve(&identifier) { + if let Ok(Some((did_details, _))) = ::IdentityProvider::retrieve(&identifier) { DidMerkleRootGenerator::::generate_proof(&did_details, keys.iter()) } else { Err(()) diff --git a/dip-template/runtimes/dip-sender/src/xcm_config.rs b/dip-template/runtimes/dip-provider/src/xcm_config.rs similarity index 100% rename from dip-template/runtimes/dip-sender/src/xcm_config.rs rename to dip-template/runtimes/dip-provider/src/xcm_config.rs diff --git a/dip-template/runtimes/xcm-tests/Cargo.toml b/dip-template/runtimes/xcm-tests/Cargo.toml index 4c032a3e9..91e6ae3fb 100644 --- a/dip-template/runtimes/xcm-tests/Cargo.toml +++ b/dip-template/runtimes/xcm-tests/Cargo.toml @@ -8,13 +8,13 @@ readme.workspace = true repository.workspace = true version.workspace = true name = "dip-templates-xcm-tests" -description = "XCM integration tests for the KILT Decentralized Identity Provider (DIP) sender and receiver templates." +description = "XCM integration tests for the KILT Decentralized Identity Provider (DIP) provider and consumer templates." [dependencies] cumulus-pallet-xcmp-queue = { workspace = true, features = ["std"] } did = { workspace = true, features = ["std"] } -dip-receiver-runtime-template = { workspace = true, features = ["std"] } -dip-sender-runtime-template = { workspace = true, features = ["std"] } +dip-consumer-runtime-template = { workspace = true, features = ["std"] } +dip-provider-runtime-template = { workspace = true, features = ["std"] } dip-support = { workspace = true, features = ["std"] } frame-support = { workspace = true, features = ["std"] } frame-system = { workspace = true, features = ["std"] } diff --git a/dip-template/runtimes/xcm-tests/src/lib.rs b/dip-template/runtimes/xcm-tests/src/lib.rs index 9eb8ed5de..fa1dd5c00 100644 --- a/dip-template/runtimes/xcm-tests/src/lib.rs +++ b/dip-template/runtimes/xcm-tests/src/lib.rs @@ -27,22 +27,22 @@ mod relay; mod tests; decl_test_parachain! { - pub struct SenderParachain { - Runtime = para::sender::Runtime, - RuntimeOrigin = para::sender::RuntimeOrigin, - XcmpMessageHandler = para::sender::XcmpQueue, - DmpMessageHandler = para::sender::DmpQueue, - new_ext = para::sender::para_ext(), + pub struct ProviderParachain { + Runtime = para::provider::Runtime, + RuntimeOrigin = para::provider::RuntimeOrigin, + XcmpMessageHandler = para::provider::XcmpQueue, + DmpMessageHandler = para::provider::DmpQueue, + new_ext = para::provider::para_ext(), } } decl_test_parachain! { - pub struct ReceiverParachain { - Runtime = para::receiver::Runtime, - RuntimeOrigin = para::receiver::RuntimeOrigin, - XcmpMessageHandler = para::receiver::XcmpQueue, - DmpMessageHandler = para::receiver::DmpQueue, - new_ext = para::receiver::para_ext(), + pub struct ConsumerParachain { + Runtime = para::consumer::Runtime, + RuntimeOrigin = para::consumer::RuntimeOrigin, + XcmpMessageHandler = para::consumer::XcmpQueue, + DmpMessageHandler = para::consumer::DmpQueue, + new_ext = para::consumer::para_ext(), } } @@ -52,8 +52,8 @@ decl_test_network! { parachains = vec![ // TODO: Change when and if the macro will allow arbitrary expressions. // Until then, these have to match the PARA_ID consts in the para submodules. - (2_000, SenderParachain), - (2_001, ReceiverParachain), + (2_000, ProviderParachain), + (2_001, ConsumerParachain), ], } } diff --git a/dip-template/runtimes/xcm-tests/src/para.rs b/dip-template/runtimes/xcm-tests/src/para.rs index 15fc36c46..77e5f3907 100644 --- a/dip-template/runtimes/xcm-tests/src/para.rs +++ b/dip-template/runtimes/xcm-tests/src/para.rs @@ -21,11 +21,11 @@ use frame_support::traits::GenesisBuild; use sp_io::TestExternalities; use xcm_emulator::decl_test_parachain; -pub(super) mod sender { - pub(crate) use dip_sender_runtime_template::{DidIdentifier, DmpQueue, Runtime, RuntimeOrigin, XcmpQueue}; +pub(super) mod provider { + pub(crate) use dip_provider_runtime_template::{DidIdentifier, DmpQueue, Runtime, RuntimeOrigin, XcmpQueue}; use did::did_details::{DidDetails, DidEncryptionKey, DidVerificationKey}; - use dip_sender_runtime_template::{AccountId, System}; + use dip_provider_runtime_template::{AccountId, System}; use kilt_support::deposit::Deposit; use sp_core::{ecdsa, ed25519, sr25519, Pair}; @@ -82,7 +82,7 @@ pub(super) mod sender { } decl_test_parachain! { - pub struct SenderParachain { + pub struct ProviderParachain { Runtime = Runtime, RuntimeOrigin = RuntimeOrigin, XcmpMessageHandler = XcmpQueue, @@ -92,12 +92,12 @@ pub(super) mod sender { } } -pub(super) mod receiver { - pub(crate) use dip_receiver_runtime_template::{ +pub(super) mod consumer { + pub(crate) use dip_consumer_runtime_template::{ AccountId, AssetTransactorLocationConverter, Balance, DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, UNIT, }; - use dip_receiver_runtime_template::System; + use dip_consumer_runtime_template::System; use xcm::latest::{Junction::Parachain, Junctions::X1, ParentThen}; use xcm_executor::traits::Convert; @@ -107,9 +107,9 @@ pub(super) mod receiver { pub const DISPATCHER_ACCOUNT: AccountId = AccountId::new([90u8; 32]); const INITIAL_BALANCE: Balance = 100_000 * UNIT; - pub(crate) fn sender_parachain_account() -> AccountId { - AssetTransactorLocationConverter::convert(ParentThen(X1(Parachain(sender::PARA_ID))).into()) - .expect("Conversion of account from sender parachain to receiver parachain should not fail.") + pub(crate) fn provider_parachain_account() -> AccountId { + AssetTransactorLocationConverter::convert(ParentThen(X1(Parachain(provider::PARA_ID))).into()) + .expect("Conversion of account from provider parachain to consumer parachain should not fail.") } pub(crate) fn para_ext() -> TestExternalities { @@ -126,7 +126,7 @@ pub(super) mod receiver { pallet_balances::GenesisConfig:: { balances: vec![ - (sender_parachain_account(), INITIAL_BALANCE), + (provider_parachain_account(), INITIAL_BALANCE), (DISPATCHER_ACCOUNT, INITIAL_BALANCE), ], } diff --git a/dip-template/runtimes/xcm-tests/src/tests.rs b/dip-template/runtimes/xcm-tests/src/tests.rs index e8cabc399..9c04ad8ab 100644 --- a/dip-template/runtimes/xcm-tests/src/tests.rs +++ b/dip-template/runtimes/xcm-tests/src/tests.rs @@ -23,7 +23,7 @@ use dip_support::latest::Proof; use frame_support::{assert_ok, weights::Weight}; use frame_system::RawOrigin; use pallet_did_lookup::linkable_account::LinkableAccountId; -use runtime_common::dip::sender::{CompleteMerkleProof, DidMerkleRootGenerator}; +use runtime_common::dip::provider::{CompleteMerkleProof, DidMerkleRootGenerator}; use sp_core::Pair; use xcm::latest::{ Junction::Parachain, @@ -33,30 +33,30 @@ use xcm::latest::{ use xcm_emulator::TestExt; use cumulus_pallet_xcmp_queue::Event as XcmpEvent; -use dip_receiver_runtime_template::{ - DidIdentifier, DidLookup, DipReceiver, Runtime as ReceiverRuntime, RuntimeCall as ReceiverRuntimeCall, +use dip_consumer_runtime_template::{ + DidIdentifier, DidLookup, DipConsumer, Runtime as ConsumerRuntime, RuntimeCall as ConsumerRuntimeCall, RuntimeEvent, System, }; -use dip_sender_runtime_template::{AccountId as SenderAccountId, DipSender, Runtime as SenderRuntime}; +use dip_provider_runtime_template::{AccountId as ProviderAccountId, DipProvider, Runtime as ProviderRuntime}; #[test] fn commit_identity() { Network::reset(); - let did: DidIdentifier = para::sender::did_auth_key().public().into(); + let did: DidIdentifier = para::provider::did_auth_key().public().into(); - // 1. Send identity proof from DIP sender to DIP receiver. - SenderParachain::execute_with(|| { - assert_ok!(DipSender::commit_identity( - RawOrigin::Signed(SenderAccountId::from([0u8; 32])).into(), + // 1. Send identity proof from DIP provider to DIP consumer. + ProviderParachain::execute_with(|| { + assert_ok!(DipProvider::commit_identity( + RawOrigin::Signed(ProviderAccountId::from([0u8; 32])).into(), did.clone(), - Box::new(ParentThen(X1(Parachain(para::receiver::PARA_ID))).into()), + Box::new(ParentThen(X1(Parachain(para::consumer::PARA_ID))).into()), Box::new((Here, 1_000_000_000).into()), Weight::from_ref_time(4_000), )); }); - // 2. Verify that the proof has made it to the DIP receiver. - ReceiverParachain::execute_with(|| { + // 2. Verify that the proof has made it to the DIP consumer. + ConsumerParachain::execute_with(|| { // 2.1 Verify that there was no XCM error. assert!(!System::events().iter().any(|r| matches!( r.event, @@ -67,32 +67,35 @@ fn commit_identity() { }) ))); // 2.2 Verify the proof digest was stored correctly. - assert!(DipReceiver::identity_proofs(&did).is_some()); + assert!(DipConsumer::identity_proofs(&did).is_some()); + }); + // 3. Call an extrinsic on the consumer chain with a valid proof + let did_details = ProviderParachain::execute_with(|| { + Did::get(&did).expect("DID details should be stored on the provider chain.") }); - // 3. Call an extrinsic on the receiver chain with a valid proof - let did_details = - SenderParachain::execute_with(|| Did::get(&did).expect("DID details should be stored on the sender chain.")); // 3.1 Generate a proof - let CompleteMerkleProof { proof, .. } = - DidMerkleRootGenerator::::generate_proof(&did_details, [did_details.authentication_key].iter()) - .expect("Proof generation should not fail"); - // 3.2 Call the `dispatch_as` extrinsic on the receiver chain with the generated + let CompleteMerkleProof { proof, .. } = DidMerkleRootGenerator::::generate_proof( + &did_details, + [did_details.authentication_key].iter(), + ) + .expect("Proof generation should not fail"); + // 3.2 Call the `dispatch_as` extrinsic on the consumer chain with the generated // proof - ReceiverParachain::execute_with(|| { - assert_ok!(DipReceiver::dispatch_as( - RawOrigin::Signed(para::receiver::DISPATCHER_ACCOUNT).into(), + ConsumerParachain::execute_with(|| { + assert_ok!(DipConsumer::dispatch_as( + RawOrigin::Signed(para::consumer::DISPATCHER_ACCOUNT).into(), did.clone(), Proof { blinded: proof.blinded, revealed: proof.revealed, } .into(), - Box::new(ReceiverRuntimeCall::DidLookup(pallet_did_lookup::Call::< - ReceiverRuntime, + Box::new(ConsumerRuntimeCall::DidLookup(pallet_did_lookup::Call::< + ConsumerRuntime, >::associate_sender {})), )); // Verify the account -> DID link exists and contains the right information - let linked_did = DidLookup::connected_dids::(para::receiver::DISPATCHER_ACCOUNT.into()) + let linked_did = DidLookup::connected_dids::(para::consumer::DISPATCHER_ACCOUNT.into()) .map(|link| link.did); assert_eq!(linked_did, Some(did)); }); diff --git a/pallets/pallet-dip-receiver/Cargo.toml b/pallets/pallet-dip-consumer/Cargo.toml similarity index 97% rename from pallets/pallet-dip-receiver/Cargo.toml rename to pallets/pallet-dip-consumer/Cargo.toml index 6a6d6f98d..a59f1e8f9 100644 --- a/pallets/pallet-dip-receiver/Cargo.toml +++ b/pallets/pallet-dip-consumer/Cargo.toml @@ -5,7 +5,7 @@ documentation.workspace = true edition.workspace = true homepage.workspace = true license-file.workspace = true -name = "pallet-dip-receiver" +name = "pallet-dip-consumer" readme.workspace = true repository.workspace = true version.workspace = true diff --git a/pallets/pallet-dip-receiver/src/lib.rs b/pallets/pallet-dip-consumer/src/lib.rs similarity index 100% rename from pallets/pallet-dip-receiver/src/lib.rs rename to pallets/pallet-dip-consumer/src/lib.rs diff --git a/pallets/pallet-dip-receiver/src/origin.rs b/pallets/pallet-dip-consumer/src/origin.rs similarity index 100% rename from pallets/pallet-dip-receiver/src/origin.rs rename to pallets/pallet-dip-consumer/src/origin.rs diff --git a/pallets/pallet-dip-receiver/src/traits.rs b/pallets/pallet-dip-consumer/src/traits.rs similarity index 100% rename from pallets/pallet-dip-receiver/src/traits.rs rename to pallets/pallet-dip-consumer/src/traits.rs diff --git a/pallets/pallet-dip-sender/Cargo.toml b/pallets/pallet-dip-provider/Cargo.toml similarity index 97% rename from pallets/pallet-dip-sender/Cargo.toml rename to pallets/pallet-dip-provider/Cargo.toml index a5d54cf13..6283ad284 100644 --- a/pallets/pallet-dip-sender/Cargo.toml +++ b/pallets/pallet-dip-provider/Cargo.toml @@ -5,7 +5,7 @@ documentation.workspace = true edition.workspace = true homepage.workspace = true license-file.workspace = true -name = "pallet-dip-sender" +name = "pallet-dip-provider" readme.workspace = true repository.workspace = true version.workspace = true diff --git a/pallets/pallet-dip-sender/src/lib.rs b/pallets/pallet-dip-provider/src/lib.rs similarity index 100% rename from pallets/pallet-dip-sender/src/lib.rs rename to pallets/pallet-dip-provider/src/lib.rs diff --git a/pallets/pallet-dip-sender/src/traits.rs b/pallets/pallet-dip-provider/src/traits.rs similarity index 99% rename from pallets/pallet-dip-sender/src/traits.rs rename to pallets/pallet-dip-provider/src/traits.rs index 6667699cc..a589fa3b1 100644 --- a/pallets/pallet-dip-sender/src/traits.rs +++ b/pallets/pallet-dip-provider/src/traits.rs @@ -122,7 +122,7 @@ pub mod identity_dispatch { .expect("Failed to build call"); // TODO: Set an error handler and an appendix to refund any leftover funds to - // the sender parachain sovereign account. + // the provider parachain sovereign account. let operation = [vec![ WithdrawAsset(asset.clone().into()), BuyExecution { diff --git a/runtime-api/dip-sender/Cargo.toml b/runtime-api/dip-provider/Cargo.toml similarity index 80% rename from runtime-api/dip-sender/Cargo.toml rename to runtime-api/dip-provider/Cargo.toml index 12b20140f..3ba00df69 100644 --- a/runtime-api/dip-sender/Cargo.toml +++ b/runtime-api/dip-provider/Cargo.toml @@ -7,8 +7,8 @@ license-file.workspace = true readme.workspace = true repository.workspace = true version.workspace = true -name = "kilt-runtime-api-dip-sender" -description = "Runtime APIs for integrating the DIP sender component." +name = "kilt-runtime-api-dip-provider" +description = "Runtime APIs for integrating the DIP provider component." [dependencies] # External dependencies diff --git a/runtime-api/dip-sender/src/lib.rs b/runtime-api/dip-provider/src/lib.rs similarity index 93% rename from runtime-api/dip-sender/src/lib.rs rename to runtime-api/dip-provider/src/lib.rs index ce420714e..2cdcb534c 100644 --- a/runtime-api/dip-sender/src/lib.rs +++ b/runtime-api/dip-provider/src/lib.rs @@ -21,7 +21,7 @@ use parity_scale_codec::Codec; sp_api::decl_runtime_apis! { - pub trait DipSender where + pub trait DipProvider where DidIdentifier: Codec, KeyId: Codec, KeyIds: Codec + IntoIterator, diff --git a/runtimes/common/Cargo.toml b/runtimes/common/Cargo.toml index c9467dd67..6d6284722 100644 --- a/runtimes/common/Cargo.toml +++ b/runtimes/common/Cargo.toml @@ -28,8 +28,8 @@ delegation = {workspace = true, optional = true} did.workspace = true dip-support.workspace = true pallet-did-lookup = {workspace = true, optional = true} -pallet-dip-receiver.workspace = true -pallet-dip-sender.workspace = true +pallet-dip-consumer.workspace = true +pallet-dip-provider.workspace = true pallet-inflation = {workspace = true, optional = true} kilt-support.workspace = true parachain-staking.workspace = true @@ -66,7 +66,7 @@ runtime-benchmarks = [ "attestation/runtime-benchmarks", "ctype/runtime-benchmarks", "did/runtime-benchmarks", - "pallet-dip-receiver/runtime-benchmarks", + "pallet-dip-consumer/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "kilt-support/runtime-benchmarks", @@ -92,8 +92,8 @@ std = [ "log/std", "pallet-authorship/std", "pallet-balances/std", - "pallet-dip-receiver/std", - "pallet-dip-sender/std", + "pallet-dip-consumer/std", + "pallet-dip-provider/std", "pallet-membership/std", "pallet-transaction-payment/std", "parachain-staking/std", diff --git a/runtimes/common/src/dip/receiver.rs b/runtimes/common/src/dip/consumer.rs similarity index 95% rename from runtimes/common/src/dip/receiver.rs rename to runtimes/common/src/dip/consumer.rs index f63470cd8..8c6c49285 100644 --- a/runtimes/common/src/dip/receiver.rs +++ b/runtimes/common/src/dip/consumer.rs @@ -19,12 +19,12 @@ use did::did_details::DidPublicKeyDetails; use dip_support::{v1, VersionedIdentityProof}; use frame_support::RuntimeDebug; -use pallet_dip_receiver::traits::IdentityProofVerifier; +use pallet_dip_consumer::traits::IdentityProofVerifier; use parity_scale_codec::Encode; use sp_std::{collections::btree_map::BTreeMap, marker::PhantomData, vec::Vec}; use sp_trie::{verify_trie_proof, LayoutV1}; -use crate::dip::{sender, KeyDetailsKey, KeyDetailsValue, KeyReferenceKey, KeyRelationship, ProofLeaf}; +use crate::dip::{provider, KeyDetailsKey, KeyDetailsValue, KeyReferenceKey, KeyRelationship, ProofLeaf}; // TODO: Avoid repetition of the same key if it appears multiple times, e.g., by // having a vector of `KeyRelationship` instead. @@ -53,7 +53,7 @@ where BlockNumber: Encode + Clone + Ord, Hasher: sp_core::Hasher, { - type BlindedValue = Vec; + type BlindedValue = Vec; // TODO: Proper error handling type Error = (); type ProofDigest = ::Out; diff --git a/runtimes/common/src/dip/mod.rs b/runtimes/common/src/dip/mod.rs index 5f292b366..645f1ea4d 100644 --- a/runtimes/common/src/dip/mod.rs +++ b/runtimes/common/src/dip/mod.rs @@ -22,8 +22,8 @@ use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_std::vec::Vec; -pub mod receiver; -pub mod sender; +pub mod consumer; +pub mod provider; #[cfg(test)] mod tests; diff --git a/runtimes/common/src/dip/sender.rs b/runtimes/common/src/dip/provider.rs similarity index 99% rename from runtimes/common/src/dip/sender.rs rename to runtimes/common/src/dip/provider.rs index 8ae4658ce..0f555a199 100644 --- a/runtimes/common/src/dip/sender.rs +++ b/runtimes/common/src/dip/provider.rs @@ -19,7 +19,7 @@ use did::{did_details::DidDetails, DidVerificationKeyRelationship, KeyIdOf}; use dip_support::latest::Proof; use frame_support::RuntimeDebug; -use pallet_dip_sender::traits::{IdentityProofGenerator, IdentityProvider}; +use pallet_dip_provider::traits::{IdentityProofGenerator, IdentityProvider}; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_std::{borrow::ToOwned, collections::btree_set::BTreeSet, marker::PhantomData, vec::Vec}; diff --git a/runtimes/common/src/dip/tests.rs b/runtimes/common/src/dip/tests.rs index ae88fb736..b1ce9f943 100644 --- a/runtimes/common/src/dip/tests.rs +++ b/runtimes/common/src/dip/tests.rs @@ -28,7 +28,7 @@ use frame_system::{ mocking::{MockBlock, MockUncheckedExtrinsic}, EnsureSigned, RawOrigin, }; -use pallet_dip_receiver::traits::IdentityProofVerifier; +use pallet_dip_consumer::traits::IdentityProofVerifier; use parity_scale_codec::Encode; use sp_core::{ecdsa, ed25519, sr25519, ConstU16, ConstU32, ConstU64, Hasher, Pair}; use sp_io::TestExternalities; @@ -40,8 +40,8 @@ use sp_runtime::{ use sp_std::collections::btree_set::BTreeSet; use crate::dip::{ - receiver::DidMerkleProofVerifier, - sender::{CompleteMerkleProof, DidMerkleRootGenerator}, + consumer::DidMerkleProofVerifier, + provider::{CompleteMerkleProof, DidMerkleRootGenerator}, ProofLeaf, };