This commit is contained in:
Linda Guiga 2023-08-22 16:21:10 +01:00
parent 5b962f3c06
commit caae038cec
No known key found for this signature in database

View File

@ -122,34 +122,34 @@ impl PublicValuesTarget {
buffer.write_target(block_difficulty)?; buffer.write_target(block_difficulty)?;
buffer.write_target(block_gaslimit)?; buffer.write_target(block_gaslimit)?;
buffer.write_target(block_chain_id)?; buffer.write_target(block_chain_id)?;
buffer.write_target_vec(&block_base_fee)?; buffer.write_target_array(&block_base_fee)?;
buffer.write_target_vec(&block_bloom)?; buffer.write_target_array(&block_bloom)?;
Ok(()) Ok(())
} }
pub fn from_buffer(buffer: &mut Buffer) -> IoResult<Self> { pub fn from_buffer(buffer: &mut Buffer) -> IoResult<Self> {
let trie_roots_before = TrieRootsTarget { let trie_roots_before = TrieRootsTarget {
state_root: buffer.read_target_array()?, state_root: buffer.read_target_array()?.try_into().unwrap(),
transactions_root: buffer.read_target_array()?, transactions_root: buffer.read_target_array()?.try_into().unwrap(),
receipts_root: buffer.read_target_array()?, receipts_root: buffer.read_target_array()?.try_into().unwrap(),
}; };
let trie_roots_after = TrieRootsTarget { let trie_roots_after = TrieRootsTarget {
state_root: buffer.read_target_array()?, state_root: buffer.read_target_array()?.try_into().unwrap(),
transactions_root: buffer.read_target_array()?, transactions_root: buffer.read_target_array()?.try_into().unwrap(),
receipts_root: buffer.read_target_array()?, receipts_root: buffer.read_target_array()?.try_into().unwrap(),
}; };
let block_metadata = BlockMetadataTarget { let block_metadata = BlockMetadataTarget {
block_beneficiary: buffer.read_target_array()?, block_beneficiary: buffer.read_target_array()?.try_into().unwrap(),
block_timestamp: buffer.read_target()?, block_timestamp: buffer.read_target()?,
block_number: buffer.read_target()?, block_number: buffer.read_target()?,
block_difficulty: buffer.read_target()?, block_difficulty: buffer.read_target()?,
block_gaslimit: buffer.read_target()?, block_gaslimit: buffer.read_target()?,
block_chain_id: buffer.read_target()?, block_chain_id: buffer.read_target()?,
block_base_fee: buffer.read_target_vec()?.try_into().unwrap(), block_base_fee: buffer.read_target_array()?.try_into().unwrap(),
block_bloom: buffer.read_target_vec()?.try_into().unwrap(), block_bloom: buffer.read_target_array()?.try_into().unwrap(),
}; };
Ok(Self { Ok(Self {