diff --git a/crates/sui-genesis-builder/src/lib.rs b/crates/sui-genesis-builder/src/lib.rs index b0925b19951f3..7d440f701f309 100644 --- a/crates/sui-genesis-builder/src/lib.rs +++ b/crates/sui-genesis-builder/src/lib.rs @@ -525,7 +525,7 @@ impl Builder { let committee = system_state.get_current_epoch_committee(); for signature in self.signatures.values() { - if self.validators.get(&signature.authority).is_none() { + if !self.validators.contains_key(&signature.authority) { panic!("found signature for unknown validator: {:#?}", signature); } diff --git a/sui-execution/v0/sui-adapter/src/temporary_store.rs b/sui-execution/v0/sui-adapter/src/temporary_store.rs index 22c8ec7ade4f6..5c1cd85f37fdf 100644 --- a/sui-execution/v0/sui-adapter/src/temporary_store.rs +++ b/sui-execution/v0/sui-adapter/src/temporary_store.rs @@ -350,7 +350,7 @@ impl<'backing> TemporaryStore<'backing> { pub fn write_object(&mut self, mut object: Object, kind: WriteKind) { // there should be no write after delete - debug_assert!(self.deleted.get(&object.id()).is_none()); + debug_assert!(!self.deleted.contains_key(&object.id())); // Check it is not read-only #[cfg(test)] // Movevm should ensure this if let Some(existing_object) = self.read_object(&object.id()) { @@ -380,7 +380,7 @@ impl<'backing> TemporaryStore<'backing> { pub fn delete_object(&mut self, id: &ObjectID, kind: DeleteKindWithOldVersion) { // there should be no deletion after write - debug_assert!(self.written.get(id).is_none()); + debug_assert!(!self.written.contains_key(id)); // TODO: promote this to an on-in-prod check that raises an invariant_violation // Check that we are not deleting an immutable object @@ -413,7 +413,7 @@ impl<'backing> TemporaryStore<'backing> { pub fn read_object(&self, id: &ObjectID) -> Option<&Object> { // there should be no read after delete - debug_assert!(self.deleted.get(id).is_none()); + debug_assert!(!self.deleted.contains_key(id)); self.written .get(id) .map(|(obj, _kind)| obj) @@ -939,7 +939,7 @@ impl<'backing> ChildObjectResolver for TemporaryStore<'backing> { child_version_upper_bound: SequenceNumber, ) -> SuiResult> { // there should be no read after delete - debug_assert!(self.deleted.get(child).is_none()); + debug_assert!(!self.deleted.contains_key(child)); let obj_opt = self.written.get(child).map(|(obj, _kind)| obj); if obj_opt.is_some() { Ok(obj_opt.cloned()) @@ -958,8 +958,8 @@ impl<'backing> ChildObjectResolver for TemporaryStore<'backing> { ) -> SuiResult> { // You should never be able to try and receive an object after deleting it or writing it in the same // transaction since `Receiving` doesn't have copy. - debug_assert!(self.deleted.get(receiving_object_id).is_none()); - debug_assert!(self.written.get(receiving_object_id).is_none()); + debug_assert!(!self.deleted.contains_key(receiving_object_id)); + debug_assert!(!self.written.contains_key(receiving_object_id)); self.store.get_object_received_at_version( owner, receiving_object_id,