mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 23:41:02 +00:00
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:
@@ -27,6 +27,7 @@ thread_local! {
|
||||
static OPERATIONS: RefCell<Vec<(ParaId, u32, bool)>> = RefCell::new(Vec::new());
|
||||
static PARACHAINS: RefCell<Vec<ParaId>> = RefCell::new(Vec::new());
|
||||
static PARATHREADS: RefCell<Vec<ParaId>> = RefCell::new(Vec::new());
|
||||
static LOCKS: RefCell<HashMap<ParaId, bool>> = RefCell::new(HashMap::new());
|
||||
static MANAGERS: RefCell<HashMap<ParaId, Vec<u8>>> = RefCell::new(HashMap::new());
|
||||
}
|
||||
|
||||
@@ -47,6 +48,14 @@ impl<T: frame_system::Config> Registrar for TestRegistrar<T> {
|
||||
PARATHREADS.with(|x| x.borrow().binary_search(&id).is_ok())
|
||||
}
|
||||
|
||||
fn apply_lock(id: ParaId) {
|
||||
LOCKS.with(|x| x.borrow_mut().insert(id, true));
|
||||
}
|
||||
|
||||
fn remove_lock(id: ParaId) {
|
||||
LOCKS.with(|x| x.borrow_mut().insert(id, false));
|
||||
}
|
||||
|
||||
fn register(
|
||||
manager: Self::AccountId,
|
||||
id: ParaId,
|
||||
|
||||
Reference in New Issue
Block a user