mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-22 16:08:00 +00:00
Fix documentation examples (#568)
* Fix documentation examples Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * CI: Add `cargo test --doc` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update .github/workflows/rust.yml Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> * Remove docs/subxt.md and move documentation to subxt/lib.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Hide polkadot interface for `events/mod.rs` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * docs: Use `#` for headers Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
+5
-2
@@ -29,13 +29,16 @@
|
||||
//!
|
||||
//! ## Example
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```no_run
|
||||
//! use std::fs;
|
||||
//! use codec::Decode;
|
||||
//! use frame_metadata::RuntimeMetadataPrefixed;
|
||||
//! use subxt_codegen::DerivesRegistry;
|
||||
//!
|
||||
//! let encoded = fs::read("../artifacts/polkadot_metadata.scale").unwrap();
|
||||
//!
|
||||
//! // Runtime metadata obtained from a node.
|
||||
//! let metadata = <RuntimeMetadataPrefixed as Decode>::decode(encoded)?;
|
||||
//! let metadata = <RuntimeMetadataPrefixed as Decode>::decode(&mut &*encoded).unwrap();
|
||||
//! // Module under which the API is generated.
|
||||
//! let item_mod = syn::parse_quote!(
|
||||
//! pub mod api {}
|
||||
|
||||
Reference in New Issue
Block a user