diff --git a/node_core/src/chain_storage/mod.rs b/node_core/src/chain_storage/mod.rs index 38dfa4a..6412ca0 100644 --- a/node_core/src/chain_storage/mod.rs +++ b/node_core/src/chain_storage/mod.rs @@ -209,7 +209,7 @@ impl NodeChainStore { self.block_store.put_block_at_id(block)?; //Snapshot - if block_id % self.node_config.shapshot_frequency_in_blocks == 0 { + if block_id.is_multiple_of(self.node_config.shapshot_frequency_in_blocks) { //Serializing all important data structures //If we fail serialization, it is not the reason to stop running diff --git a/node_core/src/lib.rs b/node_core/src/lib.rs index d18a79a..bab62c1 100644 --- a/node_core/src/lib.rs +++ b/node_core/src/lib.rs @@ -41,7 +41,7 @@ pub mod sequencer_client; fn vec_u8_to_vec_u64(bytes: Vec) -> Vec { // Pad with zeros to make sure it's a multiple of 8 let mut padded = bytes.clone(); - while padded.len() % 8 != 0 { + while !padded.len().is_multiple_of(8) { padded.push(0); }