Rename Ethereum Headers to AuraHeader (#354)

* Rename Header to AuraHeader

This prevents some type conflicts with the PolkadotJS Apps types.

* Fix test and benchmark builds

* Update AuraHeader in types.json
This commit is contained in:
Hernando Castano
2020-09-17 07:31:22 -04:00
committed by Bastian Köcher
parent 750a369273
commit 5163f62df4
16 changed files with 94 additions and 91 deletions
+5 -5
View File
@@ -19,7 +19,7 @@ use crate::finality::finalize_blocks;
use crate::validators::{Validators, ValidatorsConfiguration};
use crate::verification::{is_importable_header, verify_aura_header};
use crate::{AuraConfiguration, ChangeToEnact, PruningStrategy, Storage};
use bp_eth_poa::{Header, HeaderId, Receipt};
use bp_eth_poa::{AuraHeader, HeaderId, Receipt};
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
/// Imports bunch of headers and updates blocks finality.
@@ -37,7 +37,7 @@ pub fn import_headers<S: Storage, PS: PruningStrategy>(
aura_config: &AuraConfiguration,
validators_config: &ValidatorsConfiguration,
submitter: Option<S::Submitter>,
headers: Vec<(Header, Option<Vec<Receipt>>)>,
headers: Vec<(AuraHeader, Option<Vec<Receipt>>)>,
finalized_headers: &mut BTreeMap<S::Submitter, u64>,
) -> Result<(u64, u64), Error> {
let mut useful = 0;
@@ -85,7 +85,7 @@ pub fn import_header<S: Storage, PS: PruningStrategy>(
aura_config: &AuraConfiguration,
validators_config: &ValidatorsConfiguration,
submitter: Option<S::Submitter>,
header: Header,
header: AuraHeader,
receipts: Option<Vec<Receipt>>,
) -> Result<(HeaderId, FinalizedHeaders<S>), Error> {
// first check that we are able to import this header at all
@@ -153,7 +153,7 @@ pub fn import_header<S: Storage, PS: PruningStrategy>(
pub fn header_import_requires_receipts<S: Storage>(
storage: &S,
validators_config: &ValidatorsConfiguration,
header: &Header,
header: &AuraHeader,
) -> bool {
is_importable_header(storage, header)
.map(|_| Validators::new(validators_config))
@@ -391,7 +391,7 @@ mod tests {
fn import_custom_block<S: Storage>(
storage: &mut S,
validators: &[SecretKey],
header: Header,
header: AuraHeader,
) -> Result<HeaderId, Error> {
let id = header.compute_id();
import_header(