mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +00:00
pre-generate metadata
This commit is contained in:
+3
-5
@@ -16,11 +16,13 @@ keywords = ["parity", "substrate", "blockchain"]
|
||||
|
||||
[dependencies]
|
||||
async-std = { version = "1.8.0", features = ["tokio1"] }
|
||||
codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] }
|
||||
futures = "0.3.9"
|
||||
jsonrpsee = { version = "0.8.0", features = ["async-client"] }
|
||||
log = "0.4.13"
|
||||
thiserror = "1.0.23"
|
||||
serde_json = "1"
|
||||
subxt = { path = "../subxt" }
|
||||
thiserror = "1.0.23"
|
||||
|
||||
sc-client-db = { git = "https://github.com/paritytech/substrate.git", tag = "publish-sp-version-v4.0.0" }
|
||||
sp-keyring = { git = "https://github.com/paritytech/substrate.git", tag = "publish-sp-version-v4.0.0" }
|
||||
@@ -38,10 +40,6 @@ env_logger = "0.9"
|
||||
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
|
||||
node-cli = { git = "https://github.com/paritytech/substrate.git", tag = "publish-sp-version-v4.0.0", default-features = false }
|
||||
tempdir = "0.3.7"
|
||||
subxt = { path = "../subxt" }
|
||||
# TODO(niklasad1): we should probably generate some other runtime because of the
|
||||
# tag i.e. not "master".
|
||||
test-runtime = { path = "../test-runtime" }
|
||||
|
||||
[patch.crates-io]
|
||||
sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "publish-sp-version-v4.0.0" }
|
||||
|
||||
Binary file not shown.
+3
-2
@@ -16,11 +16,12 @@
|
||||
|
||||
//! Client for embedding substrate nodes.
|
||||
|
||||
#![deny(missing_docs)]
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "metadata.scale")]
|
||||
pub mod substrate {}
|
||||
|
||||
use async_std::task;
|
||||
use futures::{
|
||||
channel::mpsc,
|
||||
|
||||
+3
-6
@@ -15,6 +15,7 @@
|
||||
// along with subxt. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{
|
||||
substrate,
|
||||
DatabaseSource,
|
||||
KeystoreConfig,
|
||||
Role,
|
||||
@@ -31,10 +32,6 @@ use subxt::{
|
||||
PairSigner,
|
||||
};
|
||||
use tempdir::TempDir;
|
||||
use test_runtime::node_runtime::{
|
||||
self,
|
||||
system,
|
||||
};
|
||||
|
||||
#[async_std::test]
|
||||
pub async fn test_embedded_client() {
|
||||
@@ -79,7 +76,7 @@ pub async fn test_embedded_client() {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let api: node_runtime::RuntimeApi<DefaultConfig, DefaultExtra<_>> =
|
||||
let api: substrate::RuntimeApi<DefaultConfig, DefaultExtra<_>> =
|
||||
ext_client.clone().to_runtime_api();
|
||||
|
||||
// verify that we can read storage
|
||||
@@ -103,7 +100,7 @@ pub async fn test_embedded_client() {
|
||||
.wait_for_finalized_success()
|
||||
.await
|
||||
.unwrap()
|
||||
.has_event::<system::events::ExtrinsicSuccess>()
|
||||
.has_event::<substrate::system::events::ExtrinsicSuccess>()
|
||||
.unwrap();
|
||||
|
||||
// verify that we receive events
|
||||
|
||||
Reference in New Issue
Block a user