Expose module name instead of prefix (#1055)

This commit is contained in:
Amaury Martiny
2019-06-25 13:24:44 +02:00
committed by GitHub
parent 1ccc0a6876
commit 8f89b9d40c
2 changed files with 3 additions and 3 deletions
@@ -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;
+1 -1
View File
@@ -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);