Skip to content

Commit ffd4bae

Browse files
committed
šŸ› fix(functions.rs): add handling for OfferStatus::TF_PENDING_SIGNATURE to cancel the offer and update its status to CANCELLED
1 parent bf70449 commit ffd4bae

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ā€Žpallets/afloat/src/functions.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,15 @@ impl<T: Config> Pallet<T> {
874874
})?;
875875
Ok(())
876876
}
877+
OfferStatus::TF_PENDING_SIGNATURE => {
878+
<AfloatOffers<T>>::try_mutate(order_id, |offer| -> DispatchResult {
879+
let offer = offer.as_mut().ok_or(Error::<T>::OfferNotFound)?;
880+
offer.cancellation_date = Some(T::TimeProvider::now().as_secs());
881+
offer.status = OfferStatus::CANCELLED;
882+
Ok(())
883+
})?;
884+
Ok(())
885+
}
877886
_ => {
878887
Err(Error::<T>::OfferTaken.into())
879888
}

0 commit comments

Comments
Ā (0)