Sync Westend to Millau (#824)

* make finality verifier pallet instantiable

* add second instance of finality verifier pallet to the Millau runtime

* add Westend -> Millau headers relay

* use wss to connect to public westend nodes

* initialize with best_finalized_block

* typo

* Revert "initialize with best_finalized_block"

This reverts commit 954ed2832372d67618abc1a06d47e66faa93f674.

* pass VoterSet by ref

* new bridge initialization code

* loop upper bound

* Polkadot -> Westend

* fixed tests compilation

* default-features

* assert
This commit is contained in:
Svyatoslav Nikolsky
2021-03-16 10:09:02 +03:00
committed by Bastian Köcher
parent 249a8f73ff
commit d749bc3a96
18 changed files with 474 additions and 136 deletions
@@ -95,7 +95,12 @@ impl<C: Chain> Client<C> {
/// Build client to use in connection.
async fn build_client(params: ConnectionParams) -> Result<RpcClient> {
let uri = format!("ws://{}:{}", params.host, params.port);
let uri = format!(
"{}://{}:{}",
if params.secure { "wss" } else { "ws" },
params.host,
params.port,
);
let mut config = RpcConfig::with_url(&uri);
config.max_subscription_capacity = MAX_SUBSCRIPTION_CAPACITY;
let client = RpcClient::new(config).await?;
@@ -44,6 +44,8 @@ pub struct ConnectionParams {
pub host: String,
/// Websocket server TCP port.
pub port: u16,
/// Use secure websocket connection.
pub secure: bool,
}
impl Default for ConnectionParams {
@@ -51,6 +53,7 @@ impl Default for ConnectionParams {
ConnectionParams {
host: "localhost".into(),
port: 9944,
secure: false,
}
}
}