Skip to content

Commit

Permalink
Further documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndkazu committed Feb 26, 2023
1 parent e941696 commit 39ed3a0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pallets/asset_management/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
//!
//! * `owners_vote` - Each asset owner can vote in an ongoing referendum.
//!
//! * `request_asset_management` - An active Representative can request an additional asset to manage.
//!
//! * `representative_approval` - Call used as a proposal for Representative election.
//!
//! * `demote_representative` - Call used as a proposal for Representative demotion.
Expand Down Expand Up @@ -325,15 +327,18 @@ pub mod pallet {
Ok(().into())
}

/// Using the function below, an active Representative can request an additional asset to manage
/// The origin must be an active Representative
/// Using the function below, an active Representative can request an additional asset to manage.
/// The origin must be an active Representative.
/// - account_id: an account with the representative role
#[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1).ref_time())]
pub fn request_asset_management(
origin: OriginFor<T>,
account_id: AccountIdOf<T>,
) -> DispatchResultWithPostInfo {
let _caller = ensure_signed(origin.clone())?;
let caller = ensure_signed(origin.clone())?;
if caller != account_id {
ensure!(Roles::Pallet::<T>::servicers(&caller).is_some(), Roles::Error::<T>::OnlyForServicers);
}
//Caller is a registered Representative
ensure!(
Roles::RepresentativeLog::<T>::contains_key(&account_id),
Expand Down

0 comments on commit 39ed3a0

Please sign in to comment.