Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1132/add on chain identity to technical accounts #1169

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions common/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,33 @@ macro_rules! mock_pallet_timestamp_config {
}
};
}

/// Mock of pallet `pallet_identity::Config`.
#[macro_export]
macro_rules! mock_pallet_identity_config {
($runtime:ty) => {
parameter_types! {
pub const BasicDeposit: Balance = balance!(0.01);
pub const FieldDeposit: Balance = balance!(0.01);
pub const SubAccountDeposit: Balance = balance!(0.01);
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const MaxRegistrars: u32 = 20;
pub const MaxAdditionalDataLengthSwapTransferBatch: u32 = 2000;
}
impl pallet_identity::Config for $runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
type SubAccountDeposit = SubAccountDeposit;
type MaxSubAccounts = MaxSubAccounts;
type MaxAdditionalFields = MaxAdditionalFields;
type MaxRegistrars = MaxRegistrars;
type Slashed = ();
type ForceOrigin = EnsureRoot<AccountId>;
type RegistrarOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
}
};
}
1 change: 1 addition & 0 deletions pallets/apollo-platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-lib
dex-manager = { path = "../dex-manager", default-features = false }
apollo-platform = { path = ".", default-features = false }
pallet-balances = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
pallet-identity = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
sp-io = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", package = "orml-tokens", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", package = "orml-traits", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions pallets/apollo-platform/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use common::mock_pallet_identity_config;
use {
crate as apollo_platform,
common::{
Expand Down Expand Up @@ -84,6 +85,7 @@ construct_runtime! {
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
DexManager: dex_manager::{Pallet, Call, Config<T>, Storage},
PriceTools: price_tools::{Pallet, Storage, Event<T>},
Identity: pallet_identity::{Pallet, Storage, Event<T>},
}
}

Expand All @@ -96,6 +98,7 @@ mock_technical_config!(Runtime, pool_xyk::PolySwapAction<DEXId, AssetId, Account
mock_common_config!(Runtime);
mock_tokens_config!(Runtime);
mock_assets_config!(Runtime);
mock_pallet_identity_config!(Runtime);

impl<LocalCall> SendTransactionTypes<LocalCall> for Runtime
where
Expand Down
1 change: 1 addition & 0 deletions pallets/bridge-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ bridge-channel = { git = "https://github.com/sora-xor/sora2-common.git" }

sp-keyring = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38" }
pallet-balances = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38" }
pallet-identity = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38" }

tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", package = "orml-tokens" }
traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", package = "orml-traits" }
Expand Down
7 changes: 5 additions & 2 deletions pallets/bridge-proxy/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ use bridge_types::{GenericNetworkId, H160};
use common::mock::ExistentialDeposits;
use common::{
balance, mock_assets_config, mock_common_config, mock_currencies_config,
mock_pallet_balances_config, mock_technical_config, mock_tokens_config, Amount, AssetId32,
AssetName, AssetSymbol, Balance, DEXId, FromGenericPair, PredefinedAssetId, DAI, ETH, XOR, XST,
mock_pallet_balances_config, mock_pallet_identity_config, mock_technical_config,
mock_tokens_config, Amount, AssetId32, AssetName, AssetSymbol, Balance, DEXId, FromGenericPair,
PredefinedAssetId, DAI, ETH, XOR, XST,
};
use frame_support::parameter_types;
use frame_support::traits::{Everything, GenesisBuild};
Expand Down Expand Up @@ -80,6 +81,7 @@ frame_support::construct_runtime!(
BridgeOutboundChannel: bridge_channel::outbound::{Pallet, Config<T>, Storage, Event<T>},
FungibleApp: evm_fungible_app::{Pallet, Call, Config<T>, Storage, Event<T>},
BridgeProxy: proxy::{Pallet, Call, Storage, Event},
Identity: pallet_identity::{Pallet, Call, Storage, Event<T>},
}
);

Expand All @@ -95,6 +97,7 @@ mock_currencies_config!(Test);
mock_common_config!(Test);
mock_tokens_config!(Test);
mock_assets_config!(Test);
mock_pallet_identity_config!(Test);

parameter_types! {
pub const BlockHashCount: u64 = 250;
Expand Down
1 change: 1 addition & 0 deletions pallets/ceres-governance-platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-lib
dex-manager = { path = "../dex-manager", default-features = false }
ceres-governance-platform = { path = ".", default-features = false }
pallet-balances = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
pallet-identity = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
sp-io = { git = "https://github.com/sora-xor/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", package = "orml-tokens", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", package = "orml-traits", default-features = false }
Expand Down
Loading
Loading