Skip to content

Commit

Permalink
Finality votes cache (paritytech#116)
Browse files Browse the repository at this point in the history
* removeInMemoryStorage + extract Kovan stuff to runtime

* removed comment from the future

* remove redundant conversions

* remove redundant `u8 as usize`

* remove redundant `u8 as usize`

* Update modules/ethereum/src/mock.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* use hex-literal in kovan config

* cargo fmt --all

* extracted insert_header

* cargo fmt --all

* finality cache

* cargo fmt --all

* cargo fmt --all

* impl Default for FinalityVotes

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Hernando Castano <castano.ha@gmail.com>
  • Loading branch information
3 people authored Jun 10, 2020
1 parent 8e61d68 commit 4f23abb
Show file tree
Hide file tree
Showing 8 changed files with 819 additions and 277 deletions.
5 changes: 4 additions & 1 deletion bridges/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,14 @@ impl pallet_aura::Trait for Runtime {
}

parameter_types! {
pub const FinalityVotesCachingInterval: Option<u64> = Some(16);
pub const KovanAuraConfiguration: pallet_bridge_eth_poa::AuraConfiguration = kovan::kovan_aura_configuration();
pub const KovanValidatorsConfiguration: pallet_bridge_eth_poa::ValidatorsConfiguration = kovan::kovan_validators_configuration();
}

impl pallet_bridge_eth_poa::Trait for Runtime {
type AuraConfiguration = KovanAuraConfiguration;
type FinalityVotesCachingInterval = FinalityVotesCachingInterval;
type ValidatorsConfiguration = KovanValidatorsConfiguration;
type OnHeadersSubmitted = ();
}
Expand Down Expand Up @@ -495,7 +497,8 @@ impl_runtime_apis! {

impl sp_bridge_eth_poa::EthereumHeadersApi<Block> for Runtime {
fn best_block() -> (u64, sp_bridge_eth_poa::H256) {
BridgeEthPoA::best_block()
let best_block = BridgeEthPoA::best_block();
(best_block.number, best_block.hash)
}

fn is_import_requires_receipts(header: sp_bridge_eth_poa::Header) -> bool {
Expand Down
Loading

0 comments on commit 4f23abb

Please sign in to comment.