Relax Origin Checks in Registrar, Add Lock to Registration (#2808)

* Relax Origin Checks in Registrar

* fix tests

* Update runtime/common/src/paras_registrar.rs

* introduce para locks

* apply a lock after upgrade

* add test

* add lock when creating crowdloan
This commit is contained in:
Shawn Tabrizi
2021-04-07 15:16:35 +02:00
committed by GitHub
parent 251b6ca7bf
commit 45be2ac97e
6 changed files with 136 additions and 53 deletions
+5
View File
@@ -294,6 +294,9 @@ decl_module! {
fn deposit_event() = default;
/// Create a new crowdloaning campaign for a parachain slot with the given lease period range.
///
/// This applies a lock to your parachain configuration, ensuring that it cannot be changed
/// by the parachain manager.
#[weight = T::WeightInfo::create()]
pub fn create(origin,
#[compact] index: ParaId,
@@ -342,6 +345,8 @@ decl_module! {
});
NextTrieIndex::put(new_trie_index);
// Add a lock to the para so that the configuration cannot be changed.
T::Registrar::apply_lock(index);
Self::deposit_event(RawEvent::Created(index));
}