File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -859,7 +859,11 @@ impl<T: Config> Pallet<T> {
859
859
Ok ( ( ) )
860
860
}
861
861
862
- pub fn do_cancel_offer ( offer_id : StorageId ) -> DispatchResult {
862
+ pub fn do_cancel_offer ( order_id : StorageId ) -> DispatchResult {
863
+ // ensure offer exists
864
+ ensure ! ( <AfloatOffers <T >>:: contains_key( order_id) , Error :: <T >:: OfferNotFound ) ;
865
+ //get offer details
866
+ let offer = <AfloatOffers < T > >:: get ( order_id) . unwrap ( ) ;
863
867
Ok ( ( ) )
864
868
}
865
869
}
Original file line number Diff line number Diff line change @@ -402,11 +402,11 @@ pub mod pallet {
402
402
403
403
#[ pallet:: call_index( 11 ) ]
404
404
#[ pallet:: weight( Weight :: from_parts( 10_000 , 0 ) + T :: DbWeight :: get( ) . reads_writes( 1 , 1 ) ) ]
405
- pub fn cancel_offer ( origin : OriginFor < T > , offer_id : StorageId ) -> DispatchResult {
405
+ pub fn cancel_offer ( origin : OriginFor < T > , order_id : StorageId ) -> DispatchResult {
406
406
let who = ensure_signed ( origin. clone ( ) ) ?;
407
407
let is_admin_or_owner = Self :: is_admin_or_owner ( who. clone ( ) ) ?;
408
408
ensure ! ( is_admin_or_owner, Error :: <T >:: Unauthorized ) ;
409
- Self :: do_cancel_offer ( offer_id )
409
+ Self :: do_cancel_offer ( order_id )
410
410
}
411
411
}
412
412
}
You can’t perform that action at this time.
0 commit comments