From 8a078a8cec285907d37a2f5521069bcce113ac87 Mon Sep 17 00:00:00 2001 From: Gautham Date: Thu, 18 Apr 2024 13:23:42 +0300 Subject: [PATCH] disable place bid --- pallets/ocex/src/lib.rs | 44 ++++++++++++++++++------------------- runtimes/mainnet/src/lib.rs | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pallets/ocex/src/lib.rs b/pallets/ocex/src/lib.rs index 754eca04d..069bfce18 100644 --- a/pallets/ocex/src/lib.rs +++ b/pallets/ocex/src/lib.rs @@ -1023,28 +1023,28 @@ pub mod pallet { Ok(()) } - /// Place Bid - #[pallet::call_index(22)] - #[pallet::weight(< T as Config >::WeightInfo::place_bid())] - pub fn place_bid(origin: OriginFor, bid_amount: BalanceOf) -> DispatchResult { - let bidder = ensure_signed(origin)?; - let mut auction_info = >::get().ok_or(Error::::AuctionNotFound)?; - ensure!(bid_amount > Zero::zero(), Error::::InvalidBidAmount); - ensure!(bid_amount > auction_info.highest_bid, Error::::InvalidBidAmount); - ensure!( - T::NativeCurrency::can_reserve(&bidder, bid_amount), - Error::::InsufficientBalance - ); - T::NativeCurrency::reserve(&bidder, bid_amount)?; - if let Some(old_bidder) = auction_info.highest_bidder { - // Un-reserve the old bidder - T::NativeCurrency::unreserve(&old_bidder, auction_info.highest_bid); - } - auction_info.highest_bid = bid_amount; - auction_info.highest_bidder = Some(bidder); - >::put(auction_info); - Ok(()) - } + // /// Place Bid TODO: Enable it after frontend is ready. + // #[pallet::call_index(22)] + // #[pallet::weight(< T as Config >::WeightInfo::place_bid())] + // pub fn place_bid(origin: OriginFor, bid_amount: BalanceOf) -> DispatchResult { + // let bidder = ensure_signed(origin)?; + // let mut auction_info = >::get().ok_or(Error::::AuctionNotFound)?; + // ensure!(bid_amount > Zero::zero(), Error::::InvalidBidAmount); + // ensure!(bid_amount > auction_info.highest_bid, Error::::InvalidBidAmount); + // ensure!( + // T::NativeCurrency::can_reserve(&bidder, bid_amount), + // Error::::InsufficientBalance + // ); + // T::NativeCurrency::reserve(&bidder, bid_amount)?; + // if let Some(old_bidder) = auction_info.highest_bidder { + // // Un-reserve the old bidder + // T::NativeCurrency::unreserve(&old_bidder, auction_info.highest_bid); + // } + // auction_info.highest_bid = bid_amount; + // auction_info.highest_bidder = Some(bidder); + // >::put(auction_info); + // Ok(()) + // } /// Starts a new liquidity mining epoch #[pallet::call_index(23)] diff --git a/runtimes/mainnet/src/lib.rs b/runtimes/mainnet/src/lib.rs index 7ca29b560..3ca3966e3 100644 --- a/runtimes/mainnet/src/lib.rs +++ b/runtimes/mainnet/src/lib.rs @@ -122,7 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 347, + spec_version: 348, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2,