From 68b07eb19b9669eb4c3bd9d839bcdb28a6ddd723 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 25 Jun 2019 14:30:36 +0200 Subject: [PATCH] cameCase storage section (as in extrinsics) (#1056) --- packages/type-storage/src/fromMetadata/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/type-storage/src/fromMetadata/index.ts b/packages/type-storage/src/fromMetadata/index.ts index 5a998d93fc..02e2ba8b43 100644 --- a/packages/type-storage/src/fromMetadata/index.ts +++ b/packages/type-storage/src/fromMetadata/index.ts @@ -5,7 +5,7 @@ import { ModuleStorage, Storage } from '../types'; import Metadata from '@polkadot/types/Metadata'; -import { stringLowerFirst } from '@polkadot/util'; +import { stringCamelCase, stringLowerFirst } from '@polkadot/util'; import createFunction from './createFunction'; import { storage } from './storage'; @@ -26,7 +26,7 @@ export default function fromMetadata (metadata: Metadata): Storage { const { name, prefix } = moduleMetadata; // For access, we change the index names, i.e. Balances.FreeBalance -> balances.freeBalance - result[stringLowerFirst(name.toString())] = moduleMetadata.storage.unwrap().reduce((newModule, storageFnMeta) => { + result[stringCamelCase(name.toString())] = moduleMetadata.storage.unwrap().reduce((newModule, storageFnMeta) => { newModule[stringLowerFirst(storageFnMeta.name.toString())] = createFunction(prefix, storageFnMeta.name, storageFnMeta); return newModule;