Adjust ietartion argument check (#5156)

This commit is contained in:
Jaco
2022-08-13 10:03:25 +03:00
committed by GitHub
parent cc953efd58
commit 8ec5c2abc3
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -10,6 +10,8 @@ Changes:
- Explicit param length checks for all generic portable overrides
- Re-export `ScProvider` in `@polkadot/api`, aligning with `{Http, Ws}Provider`
- Expose `WellKnownChain` as static on `ScProvider.WellKnownChain`
- Checks for non-available interface types & runtime/rpc definitions
- Ensure `.entries/.keys` arguments is less than map-entry query
- Add Polkadot 9260 upgrade block
- Add Westend 9271 upgrade block
- Update to latest Substrate metadata
@@ -219,8 +219,8 @@ function extendPrefixedMap (registry: Registry, itemFn: CreateItemFn, storageFn:
const { meta: { type }, method, section } = itemFn;
storageFn.iterKey = extendHeadMeta(registry, itemFn, storageFn, (...args: unknown[]): Raw => {
if (args.length && (type.isPlain || (args.length > type.asMap.hashers.length))) {
throw new Error(`Iteration ${stringCamelCase(section || 'unknown')}.${stringCamelCase(method || 'unknown')} needs arguments to be at least one less than the full arguments, found [${args.join(', ')}]`);
if (args.length && (type.isPlain || (args.length >= type.asMap.hashers.length))) {
throw new Error(`Iteration of ${stringCamelCase(section || 'unknown')}.${stringCamelCase(method || 'unknown')} needs arguments to be at least one less than the full arguments, found [${args.join(', ')}]`);
}
if (args.length) {