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;