Fix setting rawMetadata as registry metadata (#1446)

This commit is contained in:
Tarik Gul
2024-08-14 11:21:12 -04:00
committed by GitHub
parent 5666ab247f
commit 03d8fb90f8
+3 -3
View File
@@ -26,7 +26,7 @@ export function metadataExpand (definition: MetadataDef, isPartial = false): Cha
return cached;
}
const { chain, genesisHash, icon, metaCalls, rawMetadata, specVersion, ss58Format, tokenDecimals, tokenSymbol, types, userExtensions } = definition;
const { chain, genesisHash, icon, metaCalls, specVersion, ss58Format, tokenDecimals, tokenSymbol, types, userExtensions } = definition;
const registry = new TypeRegistry();
if (!isPartial) {
@@ -41,8 +41,8 @@ export function metadataExpand (definition: MetadataDef, isPartial = false): Cha
const hasMetadata = !!metaCalls && !isPartial;
if (hasMetadata || !!rawMetadata) {
registry.setMetadata(new Metadata(registry, hasMetadata ? base64Decode(metaCalls) : rawMetadata), undefined, userExtensions);
if (hasMetadata) {
registry.setMetadata(new Metadata(registry, base64Decode(metaCalls)), undefined, userExtensions);
}
const isUnknown = genesisHash === '0x';