From e3d3a1ff716c79b64573b76ccc305041881888c2 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 27 Apr 2020 08:54:02 +0200 Subject: [PATCH] Handle no keysReturn StorageChangeSet with no keys (#2212) --- packages/rpc-core/src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/rpc-core/src/index.ts b/packages/rpc-core/src/index.ts index a3d9aae98e..2dd2811935 100644 --- a/packages/rpc-core/src/index.ts +++ b/packages/rpc-core/src/index.ts @@ -336,7 +336,11 @@ export default class Rpc implements RpcInterface { throw error; } } else if (rpc.type === 'StorageChangeSet') { - return this._formatStorageSet(params[0] as Vec, result.changes); + const keys = params[0] as Vec; + + return keys + ? this._formatStorageSet(keys, result.changes) + : this.registry.createType('StorageChangeSet', result); } else if (rpc.type === 'Vec') { const mapped = result.map(({ block, changes }: { block: string; changes: [string, string | null][] }): [Hash, Codec[]] => [ this.registry.createType('Hash', block),