From 68e2fd36f1cb636b0a30c188e545e71a5024b10d Mon Sep 17 00:00:00 2001 From: str-mv Date: Wed, 09 Dec 2020 11:03:28 +0000 Subject: [PATCH] Add conditional compilation data for benchmark --- --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -1313,7 +1313,12 @@ contract_address: T::AccountId, enable: bool ) -> DispatchResult { + let sender = ensure_signed(origin)?; + + #[cfg(feature = "runtime-benchmarks")] + >::insert(contract_address.clone(), sender.clone()); + let mut is_owner = false; if >::contains_key(contract_address.clone()) { let owner = >::get(&contract_address); @@ -1360,6 +1365,17 @@ Ok(()) } + // #[cfg(feature = "runtime-benchmarks")] + // #[weight = 0] + // pub fn add_contract_sponsoring_debug( + // origin, + // contract_address: T::AccountId, + // owner: T::AccountId) -> DispatchResult { + // let sender = ensure_signed(origin)?; + // >::insert(contract_address.clone(), owner); + // Ok(()) + // } + } } -- gitstuff