Implement Clone for the generated RuntimeApi (#544)

* Implement Clone for the generated `RuntimeApi`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Don't reexport Derivative

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Implement `Clone` manually

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update `polkadot.rs`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2022-05-16 15:28:34 +03:00
committed by GitHub
parent 2b2f82edf8
commit fc19f881e3
2 changed files with 14 additions and 0 deletions
+6
View File
@@ -296,6 +296,12 @@ impl RuntimeGenerator {
marker: ::core::marker::PhantomData<X>,
}
impl<T: ::subxt::Config, X> Clone for RuntimeApi<T, X> {
fn clone(&self) -> Self {
Self { client: self.client.clone(), marker: ::core::marker::PhantomData }
}
}
impl<T, X> ::core::convert::From<::subxt::Client<T>> for RuntimeApi<T, X>
where
T: ::subxt::Config,