Skip to content

Commit ab050df

Browse files
tgntrNeopalliumHenriqueNogara
authored
Remove CDD claim checks and add DID Registrars (#1873)
* Refactor our changes out of the core Staking code. (#1802) * Start moving our changes out of the core Staking code. * Refactor chill/nominate code. * Refactor slashing switch. * Add missing "Polymesh added" notes. * FIXUP * Access Polymesh staking logic through an associated type. * Impl PermissionedStaking on the pallet. * Refactor some of our logic out of the benchmarking and testing code. * Avoid using our User type. * Add ED check to trait. * Staking split (#1813) * Revert benchmarking and testing utils to Substrate code. * Port our staking benchmarks onto the Substrate code. * Split the permissioned validator logic into a different pallet. * Update tests. * cargo fmt * Move Polymesh types out of staking pallet. * Cleanup * Clean and revert some changes. * Import Substrate mock/tests. * Use staking pallet from Substrate. * Fix tests. * Remove old PolymeshStorageVersion. * Remove unused events. * Add migration. * Switch Substrate branches. * FIXUP: weights. * Update balance pallet (#1833) * Remove pallet-balances * Fix benchmarks * Remove cdd check; Fix bench * Fix bench and integration tests * Add polymesh_v8 feature to polymesh-api * Update ci commands * Change ci flag * Remove error * Update substrate stable2503 7 (#1845) * Add workspace dependency * Update Substrate * Update WeightMeter * Deprecated GenesisBuild, use BuildGenesisConfig * Use Weight::from_parts instead of Weight::from_ref_time * T::BlockNumber update * Fix chrono deprecated warnings. * Fix deprecated check_accrue call. * Add TypeInfo to Runtime API types. * System pallet renamed Index -> Nonce. * Update contracts * Update weights * Bump recursion_limit * Update Babe and Grandpa. * Update staking pallet * Update im-online. * Require serde. * no_std GenesisConfig. * Update node binary service/command code. * Add missing runtime_version attribute. * Fix wasm-builder * Remove old test. * Fix warnings. * Fix warnings about OldWeight. * Fix benchmark build. * Fix RPC port number. * System.set_code doesn't use max block weight anymore. * Use sensible maths for `from_rational`. paritytech/substrate#13660 * Bump contract gas fees. * Add NoopMigration for v10 contracts pallet. * Add feature flag for ed; Fix tests and runtime * Update Weights * Fix integration tests * Update .toml and .lock; Update rustc --version; Remove old testing feature * Fix compilation errors - part I * Fix compilation errors - part II * Fix compilation errors - part III * Fix compilation errors - part IV * Fix compilation errors - Tx payment * Fix compilation errors - Remove deprecated scheduler * Fix compilation erros - Impl TransactionExtension for pallet_permissions * Fix compilation errors - Remove deprecated scheduler * Remove deprecated calls - pallet_sudo pallet_validators * Fix compilation errors - pallet_tx_payments currency adapter * Fix compilation errors - Update dependency; add Preimage * Update develop runtime * Update mainnet and testnet runtime * Fix rpc-protocol-fee - part I * Fix node-rpc errors - part I * Fix node-rpc errors * Fix group and protocol rpc build * Updating node part I * Update node part II * Update chain_spec - part I * Update chain spec - part II * Update node - part III * Remove warnings; Remove local dependecies * Impl TransactionExtension * Add missing GenesisBuilder impl; Use camel case for json genesis; Add validators genesis config * Remove duplicated chainspec merge; Update toml; Cargo fmt * Update rust version * Add ci_runtime * Fix sudo mock * Fix tests - part I; Fix storage and builder * Fix tests - part I * Fix tests - pips committee * Fix settlement tests; Add subsidiser to tx_payment pallet * Fix relayer tests * Fix tx_payment tests * Fix Utility tests * Compile staking tests * Fix staking tests - UseNominatorsAndValidatorsMap does not sort * Fix toml files missing runtime-benchmark feature * Fix toml files for benchmarks part II * Fix benchmarks - part III * Order toml dependencies * Update .lock; Change rust-toolchain * Change rust version * Fix benchmarks build * Change rust version for ci * Run cargo fmt * Fix the ci pipeline; Remove contracts from benchmarks temporarily * FIx manual_slash benchmark * Build docker temporarily * Add CA certs to debian docker image. * FIXUP: ca cert install * Remove unimplemented call * Add migrations (#1850) * update Cargo.lock * Fix CI pipeline. * FIXUP: ci pipeline. * Add missing pallet_contract migrations. * Fix Rust integration build with v8 chain metadata. * Update tests to use TransferWithMemo event. * Update TS integration tests. * Fix Rust integration build against v8. * Fix initial funding amounts. * Update Substrate to fix CheckNonce. * Fix proofSize limit for contract calls. * Bump transaction version to 8. --------- Co-authored-by: Robert G. Jakabosky <rjakabosky+neopallium@neoawareness.com> * Update to Substrate stable2512 (#1857) * Update Substrate deps to stable2512. * Fix runtime_interface for benchmark host functions. * Fix runtime build errors. * Fix runtime compile errors. * Fix staking tests. * Fix node services code. * Use polymesh builder tool again. * cargo update. Update non-substrate deps. * Use the Sudo pallet from Substrate instead of our forked version. * Move Substrate Staking tests to Validators pallet. * Don't rustfmt the Staking test code. * Cleanup some TODOs. * Update branches in CI pipeline. * Store runtimes as artifacts of CI jobs. * Fix CI pipeline config. * Remove PR branch from CI pipeline. * Fix validators migration (#1858) * Fix migration of permissioned validators from Staking pallet. * Bump spec. * Fix tx_payment `TransactionExtensions`; Use `call_weight` instead of `total_weight` (#1863) * Fix fee withdraw * Fix tests; Improve validate and prepare code * Change total_weight to call_weight * Remove duplicated check in tx extension; Fix call_weight usage * Another call_weight -> total_weight fix. --------- Co-authored-by: Robert G. Jakabosky <rjakabosky+neopallium@neoawareness.com> * Refactor transaction payment (#1864) * Reuse pallet-transaction-payment from Substrate, split our ChargeTransactionPayment code out. * Use improved transaction priority calculation from Substrate. * Implement support for disable fees. * Add benchmark of ChargeTransactionPayment tx extension. * Benchmark ChargeTransactionPayment extension. * Return the extension weight. * Use git paths instead of version for Substrate deps. * Update to Substrate release polkadot-stable2512. * Fix tests build. * Add Beefy, Beefy-MMR and MMR pallets. * Add migration for SessionKeys. Allow Beefy to be disabled. * Add AuthorizedCall and CheckNonZeroSender tx extensions. * Add WeightReclaim tx extension. * Add support for CheckMetadataHash tx extension. * Fix Rust integration tests to support CheckMetadataHash tx extension. * Support metadata-hash. * Migrate to FungibleAdapter. * Fix staking election in Genesis block for dev chains. * Add Beefy, Beefy-MMR and MMR pallets. * Add migration for SessionKeys. Allow Beefy to be disabled. * Add AuthorizedCall and CheckNonZeroSender tx extensions. * Add WeightReclaim tx extension. * Add support for CheckMetadataHash tx extension. * Fix Rust integration tests to support CheckMetadataHash tx extension. * Support metadata-hash. * Migrate to FungibleAdapter. * Fix staking election in Genesis block for dev chains. * replace cdd claim checks with did checks, rename errors/types, remove unused code * rename CddServiceProviders to DidRegistrars * add register_did extrinsic, deprecate old extrinsics * add register_did tests and update naming in tests * rename cdd provider leftovers in benchmarking and tests * cleanup and check did active in benchmark * rename SystematicIssuers::CDDProvider to DIDRegistrar * update polymesh_schema.json and chain spec files * update cli types * update tests * cleanup unused imports + fix ts integration tests * Revert "rename SystematicIssuers::CDDProvider to DIDRegistrar" This reverts commit 5b43d03. * deprecate AttestPrimaryKeyRotation * rename error IdentityIsMissingDID to IdentityDoesNotExist + revert CddId comment * allow deprecated * remove did check for sender and add is_did_locked stub * cleanup duplicate code * add storage migration for CddServiceProviders -> DidRegistrars * cleanup * fix ci --------- Co-authored-by: Robert Gabriel Jakabosky <rjakabosky+neopallium@neoawareness.com> Co-authored-by: Henrique Nogara <nogara.henrique@gmail.com>
1 parent a2804e9 commit ab050df

69 files changed

Lines changed: 2799 additions & 2575 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ members = [
5555
"rpc/runtime-api",
5656
"pallets/common",
5757
]
58-
exclude = [
59-
"contracts",
60-
"integration",
61-
"metadata-tools"
62-
]
58+
exclude = ["contracts", "integration", "metadata-tools"]
6359

6460
## Keep common dependencies here.
6561
[workspace.dependencies]
@@ -113,8 +109,13 @@ polymesh-runtime-testnet = { path = "pallets/runtime/testnet" }
113109
polymesh-build-tool = { path = "pallets/runtime/build_tool", default-features = false }
114110

115111
# SCALE Codec deps.
116-
codec = { package = "parity-scale-codec", version = "3.7.4", default-features = false, features = ["derive", "max-encoded-len"] }
117-
scale-info = { version = "2.11.6", default-features = false, features = ["derive"] }
112+
codec = { package = "parity-scale-codec", version = "3.7.4", default-features = false, features = [
113+
"derive",
114+
"max-encoded-len",
115+
] }
116+
scale-info = { version = "2.11.6", default-features = false, features = [
117+
"derive",
118+
] }
118119

119120
# Substrate pallet/runtime deps.
120121
frame-benchmarking = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false }
@@ -131,7 +132,9 @@ mmr-rpc = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch
131132
pallet-authority-discovery = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false }
132133
pallet-authorship = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false }
133134
pallet-babe = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false }
134-
pallet-balances = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false, features = ['insecure_zero_ed'] }
135+
pallet-balances = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false, features = [
136+
'insecure_zero_ed',
137+
] }
135138
pallet-beefy = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false }
136139
pallet-beefy-mmr = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false }
137140
pallet-contracts = { git = "https://github.com/PolymeshAssociation/polkadot-sdk", branch = "polymesh-v8-stable2512", default-features = false }
@@ -268,7 +271,10 @@ polymesh-runtime-testnet = { workspace = true }
268271
futures = "0.3.21"
269272
jsonrpsee = { version = "0.24.9", features = ["server"] }
270273
log = "0.4"
271-
serde = { version = "1.0.136", default-features = false, features = ["alloc", "derive"] }
274+
serde = { version = "1.0.136", default-features = false, features = [
275+
"alloc",
276+
"derive",
277+
] }
272278
serde_json = { version = "1.0", features = ["arbitrary_precision"] }
273279
clap = { version = "4.0.9", features = ["derive"] }
274280
rustc-hex = "2.1.0"
@@ -302,13 +308,18 @@ sc-transaction-pool-api = { workspace = true }
302308
sc-offchain = { workspace = true }
303309

304310
# Substrate
305-
codec = { package = "parity-scale-codec", version = "3.7.4", default-features = false, features = ["derive", "max-encoded-len"] }
311+
codec = { package = "parity-scale-codec", version = "3.7.4", default-features = false, features = [
312+
"derive",
313+
"max-encoded-len",
314+
] }
306315
frame-metadata-hash-extension = { workspace = true, default-features = false }
307316
frame-support = { workspace = true }
308317
frame-system = { workspace = true }
309318
frame-system-rpc-runtime-api = { workspace = true }
310319
pallet-babe = { workspace = true }
311-
pallet-balances = { workspace = true, default-features = false, features = ["insecure_zero_ed"] }
320+
pallet-balances = { workspace = true, default-features = false, features = [
321+
"insecure_zero_ed",
322+
] }
312323
pallet-im-online = { workspace = true }
313324
pallet-indices = { workspace = true }
314325
pallet-session = { workspace = true }
@@ -353,7 +364,7 @@ disable_fees = [
353364
"polymesh-runtime-mainnet/disable_fees",
354365
"polymesh-runtime-testnet/disable_fees",
355366
]
356-
running-ci = [ "polymesh-runtime-develop/running-ci" ]
367+
running-ci = ["polymesh-runtime-develop/running-ci"]
357368
runtime-benchmarks = [
358369
"frame-benchmarking/runtime-benchmarks",
359370
"frame-benchmarking-cli/runtime-benchmarks",
@@ -364,7 +375,7 @@ runtime-benchmarks = [
364375
]
365376

366377
# Only build a "ci" runtime.
367-
ci-runtime = [ "polymesh-runtime-develop/ci-runtime" ]
378+
ci-runtime = ["polymesh-runtime-develop/ci-runtime"]
368379

369380
metadata-hash = [
370381
"polymesh-runtime-develop/metadata-hash",

integration/tests/multisig_permissions.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,16 @@ impl MuliSigState {
182182
.await?
183183
.expect("Missing RotatePrimaryKey auth id");
184184

185+
#[cfg(feature = "previous_release")]
185186
let rotate_primary_call = self
186187
.api
187188
.call()
188189
.identity()
189190
.accept_primary_key(auth_id, None)?;
191+
192+
#[cfg(feature = "current_release")]
193+
let rotate_primary_call = self.api.call().identity().accept_primary_key(auth_id)?;
194+
190195
self.run_proposal(rotate_primary_call).await
191196
}
192197

pallets/asset/src/lib.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,10 +1800,8 @@ pub mod pallet {
18001800
InvalidTransferFrozenAsset,
18011801
/// Failed to transfer an NFT - compliance failed.
18021802
InvalidTransferComplianceFailure,
1803-
/// Failed to transfer the asset - receiver cdd is not valid.
1804-
InvalidTransferInvalidReceiverCDD,
1805-
/// Failed to transfer the asset - sender cdd is not valid.
1806-
InvalidTransferInvalidSenderCDD,
1803+
/// Failed to transfer the asset - receiver DID is not active.
1804+
InvalidTransferInvalidReceiverDID,
18071805
/// The ticker registration associated to the ticker was not found.
18081806
TickerRegistrationNotFound,
18091807
/// The given ticker is already linked to an asset.
@@ -3112,13 +3110,8 @@ impl<T: AssetConfig> Pallet<T> {
31123110
);
31133111

31143112
ensure!(
3115-
IdentityPallet::<T>::has_valid_cdd(receiver_portfolio.did),
3116-
Error::<T>::InvalidTransferInvalidReceiverCDD
3117-
);
3118-
3119-
ensure!(
3120-
IdentityPallet::<T>::has_valid_cdd(sender_portfolio.did),
3121-
Error::<T>::InvalidTransferInvalidSenderCDD
3113+
IdentityPallet::<T>::is_did_active(receiver_portfolio.did),
3114+
Error::<T>::InvalidTransferInvalidReceiverDID
31223115
);
31233116

31243117
// Verifies that the statistics restrictions are satisfied
@@ -3213,12 +3206,8 @@ impl<T: AssetConfig> Pallet<T> {
32133206
}
32143207
}
32153208

3216-
if !IdentityPallet::<T>::has_valid_cdd(receiver_portfolio.did) {
3217-
asset_transfer_errors.push(Error::<T>::InvalidTransferInvalidReceiverCDD.into());
3218-
}
3219-
3220-
if !IdentityPallet::<T>::has_valid_cdd(sender_portfolio.did) {
3221-
asset_transfer_errors.push(Error::<T>::InvalidTransferInvalidSenderCDD.into());
3209+
if !IdentityPallet::<T>::is_did_active(receiver_portfolio.did) {
3210+
asset_transfer_errors.push(Error::<T>::InvalidTransferInvalidReceiverDID.into());
32223211
}
32233212

32243213
if Frozen::<T>::get(asset_id) {

pallets/compliance-manager/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl<T: Config> Pallet<T> {
581581
issuer: TrustedIssuer,
582582
) -> DispatchResult {
583583
ensure!(
584-
<Identity<T>>::is_identity_exists(&issuer.issuer),
584+
<Identity<T>>::is_did_active(issuer.issuer),
585585
Error::<T>::DidNotExist
586586
);
587587

pallets/contracts/src/benchmarking.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use sp_runtime::Perbill;
2626
use sp_std::prelude::*;
2727
use wasm_instrument::parity_wasm::elements::{Instruction, ValueType};
2828

29-
use pallet_identity::benchmarking::{cdd_provider, user, User, UserBuilder};
29+
use pallet_identity::benchmarking::{did_registrar, user, User, UserBuilder};
3030
use pallet_identity::ParentDid;
3131
use polymesh_primitives::asset::AssetId;
3232
use polymesh_primitives::constants::currency::POLY;
@@ -88,22 +88,18 @@ where
8888
}
8989

9090
fn register_did(account_id: T::AccountId) -> DispatchResult {
91-
let cdd_provider_origin = {
92-
match T::CddServiceProviders::get_members().first() {
93-
Some(cdd_did) => {
94-
let cdd_acc = pallet_identity::Pallet::<T>::get_primary_key(*cdd_did).unwrap();
95-
RawOrigin::Signed(cdd_acc).into()
91+
let did_registrar_origin = {
92+
match T::DidRegistrars::get_members().first() {
93+
Some(did_registrar) => {
94+
let did_registrar_acc =
95+
pallet_identity::Pallet::<T>::get_primary_key(*did_registrar).unwrap();
96+
RawOrigin::Signed(did_registrar_acc).into()
9697
}
97-
None => cdd_provider::<T>("cdd", 0).origin.into(),
98+
None => did_registrar::<T>("did_registrar", 0).origin.into(),
9899
}
99100
};
100101

101-
pallet_identity::Pallet::<T>::cdd_register_did_with_cdd(
102-
cdd_provider_origin,
103-
account_id.into(),
104-
Vec::new(),
105-
None,
106-
)
102+
pallet_identity::Pallet::<T>::register_did(did_registrar_origin, account_id)
107103
}
108104
}
109105

@@ -188,7 +184,7 @@ where
188184
let caller = UserBuilder::<T>::default()
189185
.seed(SEED)
190186
.generate_did()
191-
.become_cdd_provider()
187+
.become_did_registrar()
192188
.build("Caller");
193189
T::Currency::make_free_balance_be(&caller.account(), 1_000_000 * POLY);
194190

@@ -510,7 +506,7 @@ benchmarks! {
510506
link_contract_as_secondary_key {
511507
let alice = UserBuilder::<T>::default()
512508
.generate_did()
513-
.become_cdd_provider()
509+
.become_did_registrar()
514510
.build("Alice");
515511
T::Currency::make_free_balance_be(&alice.account(), 1_000_000 * POLY);
516512
let caller = alice.account();
@@ -525,7 +521,7 @@ benchmarks! {
525521
link_contract_as_primary_key {
526522
let alice = UserBuilder::<T>::default()
527523
.generate_did()
528-
.become_cdd_provider()
524+
.become_did_registrar()
529525
.build("Alice");
530526
T::Currency::make_free_balance_be(&alice.account(), 1_000_000 * POLY);
531527
let caller = alice.account();

pallets/identity/src/benchmarking.rs

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use crate::*;
1717

1818
use frame_benchmarking::{account, benchmarks};
19-
use frame_system::RawOrigin;
2019
use polymesh_common_utilities::identity::TargetIdAuthorization;
2120
use polymesh_primitives::asset::AssetId;
2221
use polymesh_primitives::identity::limits::{
@@ -113,32 +112,32 @@ benchmarks! {
113112
let cdd_claim = Claim::CustomerDueDiligence(CddId::default());
114113

115114
// Add CDD claim to the child identity.
116-
let cdd = cdd_provider::<T>("cdd", 0).did.unwrap();
115+
let cdd = did_registrar::<T>("cdd", 0).did.unwrap();
117116
Pallet::<T>::unverified_add_claim_with_scope(child_did, cdd_claim, None, cdd, None);
118117

119118
}: _(parent.origin, child_did)
120119
verify {
121-
assert!(Pallet::<T>::has_valid_cdd(child_did));
120+
assert!(Pallet::<T>::is_did_active(child_did));
121+
}
122+
123+
register_did {
124+
let registrar = did_registrar::<T>("registrar", 0);
125+
let target: T::AccountId = account("target", SEED, SEED);
126+
}: _(registrar.origin, target.clone())
127+
verify {
128+
let did = Pallet::<T>::get_identity(&target).expect("target should have a DID");
129+
assert!(Pallet::<T>::is_did_active(did));
122130
}
123131

124132
cdd_register_did {
125133
// Number of secondary items.
126134
let i in 0 .. MAX_SECONDARY_KEYS;
127135

128-
let cdd = cdd_provider::<T>("cdd", 0);
136+
let cdd = did_registrar::<T>("cdd", 0);
129137
let target: T::AccountId = account("target", SEED, SEED);
130138
let secondary_keys = generate_secondary_keys::<T>(i as usize);
131139
}: _(cdd.origin, target, secondary_keys)
132140

133-
invalidate_cdd_claims {
134-
// NB: This function loops over all cdd claims issued by the cdd provider.
135-
// Therefore, it's unbounded in complexity. However, this can only be called by governance.
136-
// Hence, the weight is for best case scenario
137-
138-
let cdd = cdd_provider::<T>("cdd", 0);
139-
140-
}: _(RawOrigin::Root, cdd.did(), 0u32.into(), None)
141-
142141
remove_secondary_keys {
143142
// Number of secondary items.
144143
let i in 0 .. MAX_SECONDARY_KEYS;
@@ -154,67 +153,31 @@ benchmarks! {
154153
}: _(target.origin, signatories.clone())
155154

156155
accept_primary_key {
157-
let cdd = cdd_provider::<T>("cdd", 0);
158156
let target = user::<T>("target", 0);
159157
let new_key = UserBuilder::<T>::default().build("key");
160158
let signatory = Signatory::Account(new_key.account());
161159

162-
let cdd_auth_id = Pallet::<T>::add_auth(
163-
cdd.did(), signatory.clone(),
164-
AuthorizationData::AttestPrimaryKeyRotation(target.did()),
165-
None,
166-
)
167-
.unwrap();
168-
Pallet::<T>::change_cdd_requirement_for_mk_rotation(
169-
RawOrigin::Root.into(),
170-
true
171-
).unwrap();
172-
173160
let owner_auth_id = Pallet::<T>::add_auth(
174161
target.did(), signatory,
175162
AuthorizationData::RotatePrimaryKey,
176163
None,
177164
).
178165
unwrap();
179-
}: _(new_key.origin, owner_auth_id, Some(cdd_auth_id))
166+
}: _(new_key.origin, owner_auth_id)
180167

181168
rotate_primary_key_to_secondary {
182-
let cdd = cdd_provider::<T>("cdd", 0);
183169
let target = user::<T>("target", 0);
184170
let new_key = UserBuilder::<T>::default().build("key");
185171
let signatory = Signatory::Account(new_key.account());
186172

187-
let cdd_auth_id = Pallet::<T>::add_auth(
188-
cdd.did(), signatory.clone(),
189-
AuthorizationData::AttestPrimaryKeyRotation(target.did()),
190-
None,
191-
)
192-
.unwrap();
193173
let rotate_auth_id = Pallet::<T>::add_auth(
194174
target.did(), signatory.clone(),
195175
AuthorizationData::RotatePrimaryKeyToSecondary(Permissions::default()),
196176
None,
197177
)
198178
.unwrap();
199-
Pallet::<T>::change_cdd_requirement_for_mk_rotation(
200-
RawOrigin::Root.into(),
201-
true
202-
).unwrap();
203-
204-
}: _(new_key.origin, rotate_auth_id, Some(cdd_auth_id))
205179

206-
change_cdd_requirement_for_mk_rotation {
207-
assert!(
208-
!CddAuthForPrimaryKeyRotation::<T>::get(),
209-
"CDD auth for primary key rotation is enabled"
210-
);
211-
}: _(RawOrigin::Root, true)
212-
verify {
213-
assert!(
214-
CddAuthForPrimaryKeyRotation::<T>::get(),
215-
"CDD auth for primary key rotation did not change"
216-
);
217-
}
180+
}: _(new_key.origin, rotate_auth_id)
218181

219182
join_identity_as_key {
220183
let target = user::<T>("target", 0);

0 commit comments

Comments
 (0)