Generic SyncHeader type (#529)

* generic SyncHeader type

* add panic condition to method description

* extract -> into_inner

* checked_sub + expect
This commit is contained in:
Svyatoslav Nikolsky
2020-11-25 20:41:45 +03:00
committed by Bastian Köcher
parent dd7242bc79
commit 441f63a34f
7 changed files with 71 additions and 76 deletions
@@ -54,7 +54,7 @@ impl SubstrateHeadersSyncPipeline for MillauHeadersToRialto {
) -> 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?;
let call = BridgeMillauCall::import_signed_header(header.header().clone().into()).into();
let call = BridgeMillauCall::import_signed_header(header.header().clone().into_inner()).into();
let transaction = Rialto::sign_transaction(&self.target_client, &self.target_sign.signer, nonce, call);
Ok(transaction)
}
@@ -53,7 +53,7 @@ impl SubstrateHeadersSyncPipeline for RialtoHeadersToMillau {
) -> 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?;
let call = BridgeRialtoCall::import_signed_header(header.header().clone().into()).into();
let call = BridgeRialtoCall::import_signed_header(header.header().clone().into_inner()).into();
let transaction = Millau::sign_transaction(&self.target_client, &self.target_sign.signer, nonce, call);
Ok(transaction)
}