Expose module name instead of prefix (#1055)
This commit is contained in:
@@ -23,10 +23,10 @@ export default function fromMetadata (metadata: Metadata): Storage {
|
||||
return result;
|
||||
}
|
||||
|
||||
const prefix = moduleMetadata.prefix;
|
||||
const { name, prefix } = moduleMetadata;
|
||||
|
||||
// For access, we change the index names, i.e. Balances.FreeBalance -> balances.freeBalance
|
||||
result[stringLowerFirst(prefix.toString())] = moduleMetadata.storage.unwrap().reduce((newModule, storageFnMeta) => {
|
||||
result[stringLowerFirst(name.toString())] = moduleMetadata.storage.unwrap().reduce((newModule, storageFnMeta) => {
|
||||
newModule[stringLowerFirst(storageFnMeta.name.toString())] = createFunction(prefix, storageFnMeta.name, storageFnMeta);
|
||||
|
||||
return newModule;
|
||||
|
||||
@@ -141,7 +141,7 @@ function addStorage (metadata: MetadataV5) {
|
||||
return md;
|
||||
}
|
||||
|
||||
const sectionName = stringLowerFirst(moduleMetadata.prefix.toString());
|
||||
const sectionName = stringLowerFirst(moduleMetadata.name.toString());
|
||||
|
||||
renderAnchors += sectionLink(sectionName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user