Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cuteolaf committed Mar 14, 2023
1 parent a28f691 commit 7fdc699
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pallets/asset_management/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl<T: Config> Pallet<T> {
let proposal_hash = T::Hashing::hash_of(&call_dispatch);
let proposal_encoded: Vec<u8> = call_dispatch.encode();
Dem::Pallet::<T>::note_preimage(origin, proposal_encoded).ok();

proposal_hash
}

Expand Down
20 changes: 10 additions & 10 deletions pallets/tenancy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,26 @@ pub mod pallet {
let caller = ensure_signed(origin.clone())?;
// Ensure that the caller has the tenancy role
ensure!(Roles::TenantLog::<T>::contains_key(caller.clone()), Error::<T>::NotATenant);



// Ensure that the asset is valid
let collection_id: T::NftCollectionId = asset_type.value().into();
let ownership = Share::Pallet::<T>::virtual_acc(collection_id, asset_id);
ensure!(ownership.is_some(), Error::<T>::NotAnAsset);
let virtual_account = ownership.unwrap().virtual_account;

if !Tenants::<T>::contains_key(caller.clone()){
RegisteredTenant::<T>::new(caller.clone(), info.clone(), Some(virtual_account.clone())).ok();
}else{
if !Tenants::<T>::contains_key(caller.clone()) {
RegisteredTenant::<T>::new(
caller.clone(),
info.clone(),
Some(virtual_account.clone()),
)
.ok();
} else {
let mut val0 = Self::infos(&caller).unwrap();
Tenants::<T>::mutate(&caller,|val|{
Tenants::<T>::mutate(&caller, |val| {
val0.asset_requested = Some(virtual_account.clone());
*val = Some(val0);
});
});
}

Self::request_helper(origin.clone(), virtual_account.clone(), info).ok();
Expand Down Expand Up @@ -237,12 +240,9 @@ pub mod pallet {
Error::<T>::NotAValidPayment
);


Self::payment_helper(origin, virtual_account.clone(), collection_id, asset_id).ok();
let now = <frame_system::Pallet<T>>::block_number();



Self::deposit_event(Event::GuarantyDepositPayment {
tenant: caller,
when: now,
Expand Down

0 comments on commit 7fdc699

Please sign in to comment.