mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +00:00
Add feature: no-metadata-doc which removes doc from metadata and full-metadata which build metadata with all doc (#10493)
* add features to remove or add doc * fmt * add test for event/error/call * fmt
This commit is contained in:
committed by
GitHub
parent
2a122c44b1
commit
137628b4d7
@@ -417,7 +417,11 @@ where
|
||||
fn build_metadata(docs: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>) {
|
||||
<Self as MapWrapper>::Map::build_metadata(docs, entries);
|
||||
CounterFor::<Prefix>::build_metadata(
|
||||
vec![&"Counter for the related counted storage map"],
|
||||
if cfg!(feature = "no-metadata-docs") {
|
||||
vec![]
|
||||
} else {
|
||||
vec![&"Counter for the related counted storage map"]
|
||||
},
|
||||
entries,
|
||||
);
|
||||
}
|
||||
@@ -1054,7 +1058,11 @@ mod test {
|
||||
modifier: StorageEntryModifier::Default,
|
||||
ty: StorageEntryType::Plain(scale_info::meta_type::<u32>()),
|
||||
default: vec![0, 0, 0, 0],
|
||||
docs: vec!["Counter for the related counted storage map"],
|
||||
docs: if cfg!(feature = "no-metadata-docs") {
|
||||
vec![]
|
||||
} else {
|
||||
vec!["Counter for the related counted storage map"]
|
||||
},
|
||||
},
|
||||
]
|
||||
);
|
||||
|
||||
@@ -530,6 +530,8 @@ where
|
||||
MaxValues: Get<Option<u32>>,
|
||||
{
|
||||
fn build_metadata(docs: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>) {
|
||||
let docs = if cfg!(feature = "no-metadata-docs") { vec![] } else { docs };
|
||||
|
||||
let entry = StorageEntryMetadata {
|
||||
name: Prefix::STORAGE_PREFIX,
|
||||
modifier: QueryKind::METADATA,
|
||||
|
||||
@@ -352,6 +352,8 @@ where
|
||||
MaxValues: Get<Option<u32>>,
|
||||
{
|
||||
fn build_metadata(docs: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>) {
|
||||
let docs = if cfg!(feature = "no-metadata-docs") { vec![] } else { docs };
|
||||
|
||||
let entry = StorageEntryMetadata {
|
||||
name: Prefix::STORAGE_PREFIX,
|
||||
modifier: QueryKind::METADATA,
|
||||
|
||||
@@ -451,6 +451,8 @@ where
|
||||
MaxValues: Get<Option<u32>>,
|
||||
{
|
||||
fn build_metadata(docs: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>) {
|
||||
let docs = if cfg!(feature = "no-metadata-docs") { vec![] } else { docs };
|
||||
|
||||
let entry = StorageEntryMetadata {
|
||||
name: Prefix::STORAGE_PREFIX,
|
||||
modifier: QueryKind::METADATA,
|
||||
|
||||
@@ -210,6 +210,8 @@ where
|
||||
OnEmpty: crate::traits::Get<QueryKind::Query> + 'static,
|
||||
{
|
||||
fn build_metadata(docs: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>) {
|
||||
let docs = if cfg!(feature = "no-metadata-docs") { vec![] } else { docs };
|
||||
|
||||
let entry = StorageEntryMetadata {
|
||||
name: Prefix::STORAGE_PREFIX,
|
||||
modifier: QueryKind::METADATA,
|
||||
|
||||
Reference in New Issue
Block a user