fix!: header consensus
Description
Fix header consensus encoding
How Has This Been Tested?
@@ -412,12 +412,12 @@ impl ConsensusEncoding for BlockHeader {
self.height.consensus_encode(writer)?;
copy_into_fixed_array_lossy::<_, 32>(&self.prev_hash).consensus_encode(writer)?;
self.timestamp.consensus_encode(writer)?;
- self.output_mr.as_slice().consensus_encode(writer)?;
- self.witness_mr.as_slice().consensus_encode(writer)?;
+ self.output_mr.consensus_encode(writer)?;
+ self.witness_mr.consensus_encode(writer)?;
self.output_mmr_size.consensus_encode(writer)?;
- self.kernel_mr.as_slice().consensus_encode(writer)?;
+ self.kernel_mr.consensus_encode(writer)?;
self.kernel_mmr_size.consensus_encode(writer)?;
- self.input_mr.as_slice().consensus_encode(writer)?;
+ self.input_mr.consensus_encode(writer)?;
self.total_kernel_offset.consensus_encode(writer)?;
self.total_script_offset.consensus_encode(writer)?;
self.nonce.consensus_encode(writer)?;
@@ -435,12 +435,12 @@ impl ConsensusDecoding for BlockHeader {
header.height = u64::consensus_decode(reader)?;
header.prev_hash = <[u8; 32] as ConsensusDecoding>::consensus_decode(reader)?.to_vec();
header.timestamp = EpochTime::consensus_decode(reader)?;
- header.output_mr = FixedHash::from(<[u8; 32] as ConsensusDecoding>::consensus_decode(reader)?);
- header.witness_mr = FixedHash::from(<[u8; 32] as ConsensusDecoding>::consensus_decode(reader)?);
+ header.output_mr = FixedHash::consensus_decode(reader)?;
+ header.witness_mr = FixedHash::consensus_decode(reader)?;
header.output_mmr_size = u64::consensus_decode(reader)?;
- header.kernel_mr = FixedHash::from(<[u8; 32] as ConsensusDecoding>::consensus_decode(reader)?);
+ header.kernel_mr = FixedHash::consensus_decode(reader)?;
header.kernel_mmr_size = u64::consensus_decode(reader)?;
- header.input_mr = FixedHash::from(<[u8; 32] as ConsensusDecoding>::consensus_decode(reader)?);
+ header.input_mr = FixedHash::consensus_decode(reader)?;
header.total_kernel_offset = BlindingFactor::consensus_decode(reader)?;
header.total_script_offset = BlindingFactor::consensus_decode(reader)?;
header.nonce = u64::consensus_decode(reader)?;
