From ff390048005d5894d531e7c9df8c7146763928e9 Mon Sep 17 00:00:00 2001 From: Alexander Belopashentsev Date: Thu, 29 Sep 2022 15:57:29 +0500 Subject: [PATCH] add `Composite` case for `Compact` in `getCodecType` --- scale-codec/src/types-codec.ts | 8 ++++++++ substrate-ingest/Makefile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scale-codec/src/types-codec.ts b/scale-codec/src/types-codec.ts index 0998d301b..61cebb27d 100644 --- a/scale-codec/src/types-codec.ts +++ b/scale-codec/src/types-codec.ts @@ -184,6 +184,14 @@ export function getCodecType(types: Type[], ti: Ti): CodecType { case TypeKind.Primitive: assert(type.primitive[0] == 'U') return {kind: TypeKind.Compact, integer: type.primitive} + case TypeKind.Composite: + return { + kind: TypeKind.Struct, + fields: type.fields.map(f => { + let name = assertNotNull(f.name) + return {name, type: f.type} + }) + } default: throwUnexpectedCase(type.kind) } diff --git a/substrate-ingest/Makefile b/substrate-ingest/Makefile index a3f5b7c29..4e6401559 100644 --- a/substrate-ingest/Makefile +++ b/substrate-ingest/Makefile @@ -9,7 +9,7 @@ kusama: -c 20 \ --prom-port 0 \ --write-batch-size 30 \ - --start-block 13846889 + --start-block 14645899 kintsugi: