--- a/pallets/nft/src/eth/log.rs +++ b/pallets/nft/src/eth/log.rs @@ -7,6 +7,9 @@ pub struct LogRecorder(RefCell, Vec)>>); impl LogRecorder { + pub fn is_empty(&self) -> bool { + self.0.borrow().is_empty() + } pub fn log(&self, topics: Vec, data: super::abi::AbiWriter) { self.0.borrow_mut().push((topics, data.finish())); } --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -2204,6 +2204,9 @@ } fn submit_logs(collection: CollectionHandle) -> DispatchResult { + if collection.logs.is_empty() { + return Ok(()) + } T::EthereumTransactionSender::submit_logs_transaction( eth::generate_transaction(collection.id, T::EthereumChainId::get()), collection.logs.retrieve_logs_for_contract(eth::collection_id_to_address(collection.id)),