mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +00:00
move examples to main repo so we can include_str them for publishing (#993)
* move exampels to main repo so we can include_str them for publishing * update CI to not break examples
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
//! accounts, Alice to Bob:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/examples/tx_basic.rs")]
|
||||
#![doc = include_str!("../../examples/tx_basic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! This example assumes that a Polkadot node is running locally (Subxt endeavors to support all
|
||||
|
||||
@@ -36,18 +36,18 @@
|
||||
//! Defining some custom config based off the default Substrate config:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/setup_client_custom_config.rs")]
|
||||
#![doc = include_str!("../../../examples/setup_client_custom_config.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! Writing a custom [`crate::rpc::RpcClientT`] implementation:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/setup_client_custom_rpc.rs")]
|
||||
#![doc = include_str!("../../../examples/setup_client_custom_rpc.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! Creating an [`crate::OfflineClient`]:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/setup_client_offline.rs")]
|
||||
#![doc = include_str!("../../../examples/setup_client_offline.rs")]
|
||||
//! ```
|
||||
//!
|
||||
|
||||
@@ -34,6 +34,6 @@
|
||||
//! can decode the extrinsics and access various details, including the associated events:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/blocks_subscribing.rs")]
|
||||
#![doc = include_str!("../../../examples/blocks_subscribing.rs")]
|
||||
//! ```
|
||||
//!
|
||||
|
||||
@@ -49,12 +49,12 @@
|
||||
//! Here's an example using a static query:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/constants_static.rs")]
|
||||
#![doc = include_str!("../../../examples/constants_static.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! And here's one using a dynamic query:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/constants_dynamic.rs")]
|
||||
#![doc = include_str!("../../../examples/constants_dynamic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
|
||||
@@ -44,6 +44,6 @@
|
||||
//! Here's an example which puts this all together:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/events.rs")]
|
||||
#![doc = include_str!("../../../examples/events.rs")]
|
||||
//! ```
|
||||
//!
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
//! The easiest way to make a runtime API call is to use the statically generated interface.
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/runtime_apis_static.rs")]
|
||||
#![doc = include_str!("../../../examples/runtime_apis_static.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! ### Making a dynamic Runtime API call
|
||||
@@ -67,7 +67,7 @@
|
||||
//! [`crate::dynamic::runtime_api_call`] method.
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/runtime_apis_dynamic.rs")]
|
||||
#![doc = include_str!("../../../examples/runtime_apis_dynamic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! ### Making a raw call
|
||||
@@ -77,6 +77,6 @@
|
||||
//! the argument bytes and manually provide a type for the response bytes to be decoded into.
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/runtime_apis_raw.rs")]
|
||||
#![doc = include_str!("../../../examples/runtime_apis_raw.rs")]
|
||||
//! ```
|
||||
//!
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
//! latter will only work for storage queries that have a default value when empty):
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/storage_fetch.rs")]
|
||||
#![doc = include_str!("../../../examples/storage_fetch.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! For completeness, below is an example using a dynamic query instead. The return type from a
|
||||
@@ -83,7 +83,7 @@
|
||||
//! [`crate::dynamic::Value`], or else the raw bytes can be accessed instead.
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/storage_fetch_dynamic.rs")]
|
||||
#![doc = include_str!("../../../examples/storage_fetch_dynamic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! ### Iterating storage entries
|
||||
@@ -92,13 +92,13 @@
|
||||
//! iterate over all of the values stored at that location:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/storage_iterating.rs")]
|
||||
#![doc = include_str!("../../../examples/storage_iterating.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! Here's the same logic but using dynamically constructed values instead:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/storage_iterating_dynamic.rs")]
|
||||
#![doc = include_str!("../../../examples/storage_iterating_dynamic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! ### Advanced
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
//! inspection. This looks like:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/tx_basic.rs")]
|
||||
#![doc = include_str!("../../../examples/tx_basic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! ### Providing transaction parameters
|
||||
@@ -156,7 +156,7 @@
|
||||
//! [`crate::tx::TxClient::sign_and_submit_then_watch`] instead:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/tx_with_params.rs")]
|
||||
#![doc = include_str!("../../../examples/tx_with_params.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! This example doesn't wait for the transaction to be included in a block; it just submits it and
|
||||
@@ -168,7 +168,7 @@
|
||||
//! the transaction, you can monitor them as they are emitted and react however you choose:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../../examples/examples/tx_status_stream.rs")]
|
||||
#![doc = include_str!("../../../examples/tx_status_stream.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! Take a look at the API docs for [`crate::tx::TxProgress`], [`crate::tx::TxStatus`] and
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
//! Subxt is a library for interacting with Substrate based nodes. Using it looks something like this:
|
||||
//!
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../examples/examples/tx_basic.rs")]
|
||||
#![doc = include_str!("../examples/tx_basic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//! Take a look at [the Subxt guide](book) to learn more about how to use Subxt.
|
||||
|
||||
Reference in New Issue
Block a user