Handle plain multi queries diguised as map-form (#4011)
This commit is contained in:
@@ -373,9 +373,11 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
: this._rpcCore.state.queryStorageAt)(
|
||||
calls.map((args: QueryableStorageMultiArg<ApiType>) =>
|
||||
Array.isArray(args)
|
||||
? args[0].creator.meta.type.asMap.hashers.length === 1
|
||||
? [args[0].creator, args.slice(1)]
|
||||
: [args[0].creator, ...args.slice(1)]
|
||||
? args[0].creator.meta.type.isPlain
|
||||
? [args[0].creator]
|
||||
: args[0].creator.meta.type.asMap.hashers.length === 1
|
||||
? [args[0].creator, args.slice(1)]
|
||||
: [args[0].creator, ...args.slice(1)]
|
||||
: [args.creator])));
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export function unwrapStorageType (registry: Registry, type: StorageEntryTypeLat
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeStorageKey (registry: Registry, value?: string | Uint8Array | StorageKey | StorageEntry | [StorageEntry, unknown[]?]): Decoded {
|
||||
function decodeStorageKey (value?: string | Uint8Array | StorageKey | StorageEntry | [StorageEntry, unknown[]?]): Decoded {
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
if (value instanceof StorageKey) {
|
||||
return {
|
||||
@@ -174,7 +174,7 @@ export class StorageKey<A extends AnyTuple = AnyTuple> extends Bytes implements
|
||||
private _section?: string;
|
||||
|
||||
constructor (registry: Registry, value?: string | Uint8Array | StorageKey | StorageEntry | [StorageEntry, unknown[]?], override: Partial<StorageKeyExtra> = {}) {
|
||||
const { key, method, section } = decodeStorageKey(registry, value);
|
||||
const { key, method, section } = decodeStorageKey(value);
|
||||
|
||||
super(registry, key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user