-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A0-3390: Proposals with headers (#1491)
# Description Proposals now include headers. ## Type of change - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) # Checklist: - I have made corresponding changes to the existing documentation
- Loading branch information
Showing
26 changed files
with
657 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
use crate::{ | ||
abft::SignatureSet, | ||
block::UnverifiedHeader, | ||
crypto::Signature, | ||
data_io::{AlephData, AlephNetworkMessage}, | ||
Hasher, | ||
}; | ||
|
||
pub type NetworkData = | ||
current_aleph_bft::NetworkData<Hasher, AlephData, Signature, SignatureSet<Signature>>; | ||
pub type NetworkData<UH> = | ||
current_aleph_bft::NetworkData<Hasher, AlephData<UH>, Signature, SignatureSet<Signature>>; | ||
|
||
impl AlephNetworkMessage for NetworkData { | ||
fn included_data(&self) -> Vec<AlephData> { | ||
impl<UH: UnverifiedHeader> AlephNetworkMessage<UH> for NetworkData<UH> { | ||
fn included_data(&self) -> Vec<AlephData<UH>> { | ||
self.included_data() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
//! Implementations and definitions of traits used in current abft | ||
use crate::data_io::{AlephData, ChainInfoProvider, DataProvider, OrderedDataInterpreter}; | ||
use crate::{ | ||
block::{Header, HeaderVerifier, UnverifiedHeader}, | ||
data_io::{AlephData, ChainInfoProvider, DataProvider, OrderedDataInterpreter}, | ||
}; | ||
|
||
#[async_trait::async_trait] | ||
impl current_aleph_bft::DataProvider<AlephData> for DataProvider { | ||
async fn get_data(&mut self) -> Option<AlephData> { | ||
impl<UH: UnverifiedHeader> current_aleph_bft::DataProvider<AlephData<UH>> for DataProvider<UH> { | ||
async fn get_data(&mut self) -> Option<AlephData<UH>> { | ||
DataProvider::get_data(self).await | ||
} | ||
} | ||
|
||
impl<CIP> current_aleph_bft::FinalizationHandler<AlephData> for OrderedDataInterpreter<CIP> | ||
impl<CIP, H, V> current_aleph_bft::FinalizationHandler<AlephData<H::Unverified>> | ||
for OrderedDataInterpreter<CIP, H, V> | ||
where | ||
CIP: ChainInfoProvider, | ||
H: Header, | ||
V: HeaderVerifier<H>, | ||
{ | ||
fn data_finalized(&mut self, data: AlephData, _creator: current_aleph_bft::NodeIndex) { | ||
fn data_finalized( | ||
&mut self, | ||
data: AlephData<H::Unverified>, | ||
_creator: current_aleph_bft::NodeIndex, | ||
) { | ||
OrderedDataInterpreter::data_finalized(self, data) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.