generate docs for feature gated items (#1332)

* generate docs for feature-gated items on crates.io

* add newline in Cargo.toml

* unify newlines

* fix clippy

* introduce macros for features

* commit missing file

* Update subxt/src/lib.rs

* make it compile
This commit is contained in:
Niklas Adolfsson
2024-01-12 14:18:34 +01:00
committed by GitHub
parent ee95026186
commit 437ff7ee41
20 changed files with 204 additions and 86 deletions
+5 -2
View File
@@ -9,6 +9,8 @@
//! additional and signed extra parameters are used when constructing an extrinsic, and is a part
//! of the chain configuration (see [`crate::config::Config`]).
use crate::macros::cfg_substrate_compat;
mod signer;
mod tx_client;
mod tx_payload;
@@ -16,8 +18,9 @@ mod tx_progress;
// The PairSigner impl currently relies on Substrate bits and pieces, so make it an optional
// feature if we want to avoid needing sp_core and sp_runtime.
#[cfg(feature = "substrate-compat")]
pub use self::signer::PairSigner;
cfg_substrate_compat! {
pub use self::signer::PairSigner;
}
pub use self::{
signer::Signer,
+4 -2
View File
@@ -5,6 +5,7 @@
//! A library to **sub**mit e**xt**rinsics to a
//! [substrate](https://github.com/paritytech/substrate) node via RPC.
use crate::macros::cfg_substrate_compat;
use crate::Config;
/// Signing transactions requires a [`Signer`]. This is responsible for
@@ -24,8 +25,9 @@ pub trait Signer<T: Config> {
fn sign(&self, signer_payload: &[u8]) -> T::Signature;
}
#[cfg(feature = "substrate-compat")]
pub use pair_signer::PairSigner;
cfg_substrate_compat! {
pub use pair_signer::PairSigner;
}
// A signer suitable for substrate based chains. This provides compatibility with Substrate
// packages like sp_keyring and such, and so relies on sp_core and sp_runtime to be included.