This commit is contained in:
Jaco
2021-09-20 15:38:54 +02:00
committed by GitHub
parent dbb5d66de3
commit 7c57778389
25 changed files with 146 additions and 119 deletions
+9 -1
View File
@@ -24,7 +24,12 @@ function entrySignature (lookup: PortableRegistry, allDefs: Record<string, Modul
if (storageEntry.type.isPlain) {
const typeDef = lookup.getTypeDef(storageEntry.type.asPlain);
setImports(allDefs, imports, [typeDef.lookupName || typeDef.type]);
setImports(allDefs, imports, [
typeDef.lookupName || typeDef.type,
storageEntry.modifier.isOptional
? 'Option'
: null
]);
return [storageEntry.modifier.isOptional, '', '', formatType(registry, allDefs, outputType, imports)];
} else if (storageEntry.type.isMap) {
@@ -38,6 +43,9 @@ function entrySignature (lookup: PortableRegistry, allDefs: Record<string, Modul
setImports(allDefs, imports, [
...similarTypes.reduce<string[]>((all, t) => all.concat(t), []),
storageEntry.modifier.isOptional
? 'Option'
: null,
defValue.lookupName
? undefined
: defValue.type
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/typegen', version: '6.0.4' };
export const packageInfo = { name: '@polkadot/typegen', version: '6.0.5' };