mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-22 07:58:02 +00:00
Propagate documentation to runtime API (#511)
* codegen: Propagate documentation for Constants Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate documentation for `CompositeDef` wrapper Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate docs for enum variant of `CompositeDef` wrapper Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate docs for Storage entries Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Move docs from internal structs to methods of StorageApi Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate the same docs for storage iter variants Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Move docs from call structs to methods of TransactionApi Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -38,8 +38,10 @@ pub fn generate_constants(
|
||||
let pallet_name = &pallet.name;
|
||||
let constant_name = &constant.name;
|
||||
let return_ty = type_gen.resolve_type_path(constant.ty.id(), &[]);
|
||||
let docs = &constant.docs;
|
||||
|
||||
quote! {
|
||||
#( #[doc = #docs ] )*
|
||||
pub fn #fn_name(&self) -> ::core::result::Result<#return_ty, ::subxt::BasicError> {
|
||||
let pallet = self.client.metadata().pallet(#pallet_name)?;
|
||||
let constant = pallet.constant(#constant_name)?;
|
||||
|
||||
Reference in New Issue
Block a user