diff --git a/sui_core/src/authority/authority_store.rs b/sui_core/src/authority/authority_store.rs index 2ea710ae6a413..c8ab0b39000f2 100644 --- a/sui_core/src/authority/authority_store.rs +++ b/sui_core/src/authority/authority_store.rs @@ -422,11 +422,9 @@ impl SuiDataStore { transaction_digest: &TransactionDigest, object_ids: impl Iterator, ) -> Result>, SuiError> { - let keys: Vec<_> = object_ids - .map(|objid| (*transaction_digest, *objid)) - .collect(); + let keys = object_ids.map(|objid| (*transaction_digest, *objid)); - self.sequenced.multi_get(&keys[..]).map_err(SuiError::from) + self.sequenced.multi_get(keys).map_err(SuiError::from) } /// Read a lock for a specific (transaction, shared object) pair. diff --git a/sui_core/src/gateway_state.rs b/sui_core/src/gateway_state.rs index a2b8cdc6ba6fa..33285555fb810 100644 --- a/sui_core/src/gateway_state.rs +++ b/sui_core/src/gateway_state.rs @@ -5,7 +5,7 @@ use crate::{authority_aggregator::AuthorityAggregator, authority_client::AuthorityAPI}; use async_trait::async_trait; use futures::future; -use itertools::Itertools; + use move_core_types::identifier::Identifier; use move_core_types::language_storage::TypeTag; use move_core_types::value::MoveStructLayout; @@ -410,13 +410,10 @@ impl AccountState { /// The caller has to explicitly find which objects are locked /// TODO: always return true for immutable objects https://github.com/MystenLabs/sui/issues/305 fn can_lock_or_unlock(&self, transaction: &Transaction) -> Result { - let iter_matches = self.store.pending_transactions.multi_get( - &transaction - .input_objects()? - .iter() - .map(|q| q.object_id()) - .collect_vec(), - )?; + let iter_matches = self + .store + .pending_transactions + .multi_get(transaction.input_objects()?.iter().map(|q| q.object_id()))?; if iter_matches.into_iter().any(|match_for_transaction| { matches!(match_for_transaction, // If we find any transaction that isn't the given transaction, we cannot proceed