More tests for finality relay (#816)

* more tests for finality relay

* clippy

* remove env_logger dep

* fmt

* more clippy

* removed prune_unjustified_headers

* review
This commit is contained in:
Svyatoslav Nikolsky
2021-03-11 16:33:01 +03:00
committed by Bastian Köcher
parent d8852fd197
commit 53cdf66071
7 changed files with 342 additions and 227 deletions
@@ -89,7 +89,7 @@ where
type Hash = HashOf<SourceChain>;
type Number = BlockNumberOf<SourceChain>;
type Header = SyncHeader<SourceChain::Header>;
type FinalityProof = Justification<SourceChain::Header>;
type FinalityProof = Justification<SourceChain::BlockNumber>;
}
/// Run Substrate-to-Substrate finality sync.
@@ -103,7 +103,7 @@ pub async fn run<SourceChain, TargetChain, P>(
Hash = HashOf<SourceChain>,
Number = BlockNumberOf<SourceChain>,
Header = SyncHeader<SourceChain::Header>,
FinalityProof = Justification<SourceChain::Header>,
FinalityProof = Justification<SourceChain::BlockNumber>,
>,
SourceChain: Clone + Chain,
BlockNumberOf<SourceChain>: BlockNumberBase,
@@ -39,7 +39,7 @@ impl SubstrateFinalitySyncPipeline for MillauFinalityToRialto {
async fn make_submit_finality_proof_transaction(
&self,
header: MillauSyncHeader,
proof: Justification<bp_millau::Header>,
proof: Justification<bp_millau::BlockNumber>,
) -> Result<Self::SignedTransaction, SubstrateError> {
let account_id = self.target_sign.signer.public().as_array_ref().clone().into();
let nonce = self.target_client.next_account_index(account_id).await?;
@@ -39,7 +39,7 @@ impl SubstrateFinalitySyncPipeline for RialtoFinalityToMillau {
async fn make_submit_finality_proof_transaction(
&self,
header: RialtoSyncHeader,
proof: Justification<bp_rialto::Header>,
proof: Justification<bp_rialto::BlockNumber>,
) -> Result<Self::SignedTransaction, SubstrateError> {
let account_id = self.target_sign.signer.public().as_array_ref().clone().into();
let nonce = self.target_client.next_account_index(account_id).await?;