Allow passing $OUT_DIR in the runtime_metadata_path attribute (#2142)

* Allow passing $OUT_DIR in the runtime_metadata_path attribute

* nit

* fix build

* PR review

* ignore instead of no_run
This commit is contained in:
PG Herveou
2025-12-09 12:56:18 +01:00
committed by GitHub
parent 3f57740a9a
commit d0f91f8631
2 changed files with 37 additions and 6 deletions
+18
View File
@@ -146,6 +146,15 @@ pub mod ext {
/// mod polkadot {}
/// ```
///
/// You can use the `$OUT_DIR` placeholder in the path to reference metadata generated at build time:
///
/// ```rust,ignore
/// #[subxt::subxt(
/// runtime_metadata_path = "$OUT_DIR/metadata.scale",
/// )]
/// mod polkadot {}
/// ```
///
/// ## Using a WASM runtime via `runtime_path = "..."`
///
/// This requires the `runtime-wasm-path` feature flag.
@@ -159,6 +168,15 @@ pub mod ext {
/// mod polkadot {}
/// ```
///
/// You can also use the `$OUT_DIR` placeholder in the path to reference WASM files generated at build time:
///
/// ```rust,ignore
/// #[subxt::subxt(
/// runtime_path = "$OUT_DIR/runtime.wasm",
/// )]
/// mod polkadot {}
/// ```
///
/// ## Connecting to a node to download metadata via `runtime_metadata_insecure_url = "..."`
///
/// This will, at compile time, connect to the JSON-RPC interface for some node at the URL given,