diff --git a/crates/core/component/sct/src/component/view.rs b/crates/core/component/sct/src/component/view.rs index ad981a7383..21a2c9fa04 100644 --- a/crates/core/component/sct/src/component/view.rs +++ b/crates/core/component/sct/src/component/view.rs @@ -31,9 +31,11 @@ pub trait StateReadExt: StateRead { match self .nonverifiable_get_raw(state_key::state_commitment_tree().as_bytes()) .await - .unwrap() + .expect("able to retrieve state commitment tree from nonverifiable storage") { - Some(bytes) => bincode::deserialize(&bytes).unwrap(), + Some(bytes) => bincode::deserialize(&bytes).expect( + "able to deserialize stored state commitment tree from nonverifiable storage", + ), None => tct::Tree::new(), } } @@ -135,7 +137,8 @@ trait StateWriteExt: StateWrite { // If the cached tree is dirty, flush it to storage if let Some(tree) = self.object_get::(state_key::cached_state_commitment_tree()) { - let bytes = bincode::serialize(&tree).unwrap(); + let bytes = bincode::serialize(&tree) + .expect("able to serialize state commitment tree to bincode"); self.nonverifiable_put_raw( state_key::state_commitment_tree().as_bytes().to_vec(), bytes, diff --git a/crates/core/component/sct/src/lib.rs b/crates/core/component/sct/src/lib.rs index 8672408e73..fb08388433 100644 --- a/crates/core/component/sct/src/lib.rs +++ b/crates/core/component/sct/src/lib.rs @@ -1,3 +1,4 @@ +#![deny(clippy::unwrap_used)] #![cfg_attr(docsrs, feature(doc_cfg))] #[cfg_attr(docsrs, doc(cfg(feature = "component")))]