Skip to content

Commit e04677f

Browse files
committed
🐛 fix(functions.rs): add call to do_add_account_to_afloat_frunique to ensure consistency with admin role assignment
✨ feat(lib.rs): add support for adding afloat and frunique roles during initial setup 🔧 chore(types.rs): add AddAfloatRole and AddFruniqueRole variants to InitialSetupArgs enum for role assignment
1 parent 7ec0bdf commit e04677f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

pallets/afloat/src/functions.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,8 @@ impl<T: Config> Pallet<T> {
856856

857857
Self::give_role_to_user(user_address.clone(), AfloatRole::Admin)?;
858858

859+
Self::do_add_account_to_afloat_frunique(user_address.clone(), FruniqueRole::Admin)?;
860+
859861
Self::deposit_event(Event::AdminAdded(authority, user_address));
860862
Ok(())
861863
}

pallets/afloat/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,14 @@ pub mod pallet {
223223
Self::do_setup_roles(creator, admin)?;
224224
Ok(())
225225
},
226+
InitialSetupArgs::AddAfloatRole { who, role } => {
227+
Self::give_role_to_user(who, role)?;
228+
Ok(())
229+
},
230+
InitialSetupArgs::AddFruniqueRole { who, role } => {
231+
Self::do_add_account_to_afloat_frunique(who, FruniqueRole::Admin)?;
232+
Ok(())
233+
},
226234
}
227235
}
228236

pallets/afloat/src/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ pub enum CreateAsset<T: Config> {
197197
pub enum InitialSetupArgs<T: Config> {
198198
All { creator: T::AccountId, admin: T::AccountId, asset: CreateAsset<T> },
199199
Roles { creator: T::AccountId, admin: T::AccountId },
200+
AddAfloatRole { who: T::AccountId, role: AfloatRole },
201+
AddFruniqueRole { who: T::AccountId, role: AfloatRole },
200202
}
201203

202204
// ! Transaction structures

0 commit comments

Comments
 (0)