Skip to content

Commit

Permalink
Merge pull request #177 from Fair-Squares/126-implement-asset-distrib…
Browse files Browse the repository at this point in the history
…utor-pallet-fungible-+-config-shares-that-get-minted

Added an event to  dispatch
  • Loading branch information
ndkazu authored Sep 29, 2022
2 parents d26f1b6 + b6c4540 commit 3180e27
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion pallets/onboarding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ pub mod pallet {
FundsReserved { from_who: T::AccountId, amount: Option<BalanceOf<T>> },
///Funds slashed
SlashedFunds { from_who: T::AccountId, amount: Option<BalanceOf<T>> },
///StatusChanged
AssetStatusChanged {
changed_to: AssetStatus,
collection: T::NftCollectionId,
item: T::NftItemId,
}
}

// Errors inform users that something went wrong.
#[pallet::error]
Expand Down Expand Up @@ -278,7 +284,15 @@ pub mod pallet {
status: AssetStatus,
) -> DispatchResult {
let _caller = ensure_signed(origin.clone()).unwrap();
Self::status(collection, item_id, status);
let coll_id: T::NftCollectionId = collection.clone().value().into();
Self::status(collection.clone(), item_id.clone(), status.clone());
Self::deposit_event(Event::AssetStatusChanged {
changed_to: status,
collection: coll_id,
item: item_id,
});


Ok(())
}

Expand Down Expand Up @@ -474,6 +488,7 @@ pub mod pallet {
let house = Self::houses(collection_id.clone(), item_id.clone()).unwrap();

let _new_call = VotingCalls::<T>::new(collection_id.clone(), item_id.clone()).ok();

//Create Call for collective-to-democracy status change
let call1: T::Prop = Call::<T>::change_status {
collection: collection.clone(),
Expand Down
2 changes: 1 addition & 1 deletion pallets/roles/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ pub mod pallet {
sender == SUDO::Pallet::<T>::key().unwrap(),
"only the current sudo key can sudo"
);
ensure!(sender != new0, "The same manager is given");
//ensure!(sender != new0, "The same manager is given");
//Remove current Sudo from Servicers list
if ServicerLog::<T>::contains_key(sender.clone()) == true {
ServicerLog::<T>::remove(sender.clone());
Expand Down

0 comments on commit 3180e27

Please sign in to comment.