From 6149a48ee05c78ce1c223209c0242c96bf4fbcd4 Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Fri, 19 Aug 2022 10:19:24 +0200 Subject: [PATCH] Update base_layer/core/src/proof_of_work/monero_rx/fixed_array.rs Co-authored-by: Stan Bondi --- base_layer/core/src/proof_of_work/monero_rx/fixed_array.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base_layer/core/src/proof_of_work/monero_rx/fixed_array.rs b/base_layer/core/src/proof_of_work/monero_rx/fixed_array.rs index c27495bffe..4eb808e11a 100644 --- a/base_layer/core/src/proof_of_work/monero_rx/fixed_array.rs +++ b/base_layer/core/src/proof_of_work/monero_rx/fixed_array.rs @@ -136,8 +136,7 @@ impl ConsensusDecoding for FixedByteArray { impl ConsensusEncoding for FixedByteArray { fn consensus_encode(&self, writer: &mut W) -> Result<(), io::Error> { - writer.write_all(&[self.len][..])?; - writer.write_all(&self.elems[0..self.len()])?; + self.as_slice().consensus_decode(writer)?; Ok(()) } }