mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
Spawn test node process for integration tests (#252)
* Move tests to module in own file * Add test-node-proc crate * Move test node to main lib, fix compilation errors * Fmt * Attempted port scanning * Use global static port to allocate open ports * Register missing type sizes * Fix port scanning and balances test * Don't wait for blocks on insert_jey test * Fmt * Remove unused dependencies * Download v3.0.0 rust binary * Move substrate bin to home dir * Add test instructions to README * Figure out the $PATH * Remove path echo * Add check for missing substrate binary on the PATH * @niklasad1 review: don't include client feature for tests
This commit is contained in:
+5
-5
@@ -157,7 +157,7 @@ pub enum TransactionStatus<Hash, BlockHash> {
|
||||
Invalid,
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "client", test))]
|
||||
#[cfg(feature = "client")]
|
||||
use substrate_subxt_client::SubxtClient;
|
||||
|
||||
/// Rpc client wrapper.
|
||||
@@ -169,7 +169,7 @@ pub enum RpcClient {
|
||||
/// JSONRPC client HTTP transport.
|
||||
// NOTE: Arc because `HttpClient` is not clone.
|
||||
Http(Arc<HttpClient>),
|
||||
#[cfg(any(feature = "client", test))]
|
||||
#[cfg(feature = "client")]
|
||||
/// Embedded substrate node.
|
||||
Subxt(SubxtClient),
|
||||
}
|
||||
@@ -186,7 +186,7 @@ impl RpcClient {
|
||||
inner.request(method, params).await.map_err(Into::into)
|
||||
}
|
||||
Self::Http(inner) => inner.request(method, params).await.map_err(Into::into),
|
||||
#[cfg(any(feature = "client", test))]
|
||||
#[cfg(feature = "client")]
|
||||
Self::Subxt(inner) => inner.request(method, params).await.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
@@ -211,7 +211,7 @@ impl RpcClient {
|
||||
)
|
||||
.into())
|
||||
}
|
||||
#[cfg(any(feature = "client", test))]
|
||||
#[cfg(feature = "client")]
|
||||
Self::Subxt(inner) => {
|
||||
inner
|
||||
.subscribe(subscribe_method, params, unsubscribe_method)
|
||||
@@ -234,7 +234,7 @@ impl From<HttpClient> for RpcClient {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "client", test))]
|
||||
#[cfg(feature = "client")]
|
||||
impl From<SubxtClient> for RpcClient {
|
||||
fn from(client: SubxtClient) -> Self {
|
||||
RpcClient::Subxt(client)
|
||||
|
||||
Reference in New Issue
Block a user