block cleanup (#9117)

* blockchain insert expects owned block instead of block reference

* reduce a number of times a block is deserialized

* removed cached uncle_bytes from block

* removed is_finalized from OpenBlock

* removed unused parity_machine::WithMetadata trait

* removed commented out code

* remove unused metadata from block

* remove unused metadata from block

* BlockDetails extras may have at most 5 elements
This commit is contained in:
Marek Kotewicz
2018-07-30 11:45:10 +02:00
committed by André Silva
parent a809621f63
commit c54beba932
14 changed files with 179 additions and 273 deletions

View File

@@ -43,8 +43,6 @@ pub struct ExtendedHeader {
pub is_finalized: bool,
/// The parent block difficulty.
pub parent_total_difficulty: U256,
/// The block metadata information.
pub metadata: Option<Vec<u8>>,
}
/// A block header.
@@ -418,10 +416,6 @@ impl ::parity_machine::FinalizableHeader for ExtendedHeader {
fn is_finalized(&self) -> bool { self.is_finalized }
}
impl ::parity_machine::WithMetadataHeader for ExtendedHeader {
fn metadata(&self) -> Option<&[u8]> { self.metadata.as_ref().map(|v| v.as_ref()) }
}
#[cfg(test)]
mod tests {
use rustc_hex::FromHex;