diff --git a/pallets/nft/src/lib.rs b/pallets/nft/src/lib.rs index fc0b85d..151f18f 100644 --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -347,6 +347,7 @@ decl_event!( decl_error! { pub enum Error for Module { NamesNotExists, + SaleOrderNotExists, NamesOwnerInvalid, } } @@ -933,6 +934,7 @@ decl_module! { #[weight = T::WeightInfo::accept_sale_order()] pub fn accept_sale_order(origin, collection_id: u64, item_id: u64) -> DispatchResult { let sender = ensure_signed(origin)?; + ensure!(>::contains_key(collection_id, item_id), Error::::SaleOrderNotExists); let target_sale_order = >::get(collection_id, item_id); let nft_owner = target_sale_order.owner; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index cbecf63..91f05dc 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -102,7 +102,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("uart"), impl_name: create_runtime_str!("uart"), authoring_version: 1, - spec_version: 19, + spec_version: 20, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,