Make storage_page_size for the LegacyBackend configurable (#1458)

This commit is contained in:
James Wilson
2024-02-29 13:13:58 +00:00
committed by GitHub
parent 3ffccb0369
commit ddd0865fa9
3 changed files with 53 additions and 13 deletions
+3 -3
View File
@@ -76,7 +76,7 @@ impl<T: Config> OnlineClient<T> {
/// Allows insecure URLs without SSL encryption, e.g. (http:// and ws:// URLs).
pub async fn from_insecure_url(url: impl AsRef<str>) -> Result<OnlineClient<T>, Error> {
let client = RpcClient::from_insecure_url(url).await?;
let backend = LegacyBackend::new(client);
let backend = LegacyBackend::builder().build(client);
OnlineClient::from_backend(Arc::new(backend)).await
}
}
@@ -85,7 +85,7 @@ impl<T: Config> OnlineClient<T> {
/// Construct a new [`OnlineClient`] by providing an [`RpcClient`] to drive the connection.
/// This will use the current default [`Backend`], which may change in future releases.
pub async fn from_rpc_client(rpc_client: RpcClient) -> Result<OnlineClient<T>, Error> {
let backend = Arc::new(LegacyBackend::new(rpc_client));
let backend = Arc::new(LegacyBackend::builder().build(rpc_client));
OnlineClient::from_backend(backend).await
}
@@ -108,7 +108,7 @@ impl<T: Config> OnlineClient<T> {
metadata: impl Into<Metadata>,
rpc_client: RpcClient,
) -> Result<OnlineClient<T>, Error> {
let backend = Arc::new(LegacyBackend::new(rpc_client));
let backend = Arc::new(LegacyBackend::builder().build(rpc_client));
OnlineClient::from_backend_with(genesis_hash, runtime_version, metadata, backend)
}