Skip to content

Commit

Permalink
🐛 fix(functions.rs): add handling for OfferStatus::TF_PENDING_SIGNATU…
Browse files Browse the repository at this point in the history
…RE to cancel the offer and update its status to CANCELLED
  • Loading branch information
tlacloc committed Sep 19, 2023
1 parent bf70449 commit ffd4bae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pallets/afloat/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,15 @@ impl<T: Config> Pallet<T> {
})?;
Ok(())
}
OfferStatus::TF_PENDING_SIGNATURE => {
<AfloatOffers<T>>::try_mutate(order_id, |offer| -> DispatchResult {
let offer = offer.as_mut().ok_or(Error::<T>::OfferNotFound)?;
offer.cancellation_date = Some(T::TimeProvider::now().as_secs());
offer.status = OfferStatus::CANCELLED;
Ok(())
})?;
Ok(())
}
_ => {
Err(Error::<T>::OfferTaken.into())
}
Expand Down

0 comments on commit ffd4bae

Please sign in to comment.