Skip to content

Commit 121d3cb

Browse files
api, api-{augment, base, contract, derive}, rpc-{augment, core, provider}, types, types-{augment, codec, create, known} 16.2.2
1 parent 460bcd5 commit 121d3cb

File tree

15 files changed

+32
-13
lines changed

15 files changed

+32
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## master
44

5+
- api, api-{augment, base, contract, derive}, rpc-{augment, core, provider}, types, types-{augment, codec, create, known} 16.2.2
56
- hw-{ledger, ledger-transports}, keyring, networks, util, util-crypto, x-{bigint, fetch, global, randomvalues, textdecoder, textencoder, ws} 13.5.2
67
- api, api-{augment, base, contract, derive}, rpc-{augment, core, provider}, types, types-{augment, codec, create, known} 16.2.1
78
- phishing 0.25.12

api-augment/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/api-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/api-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

api-base/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/api-base', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/api-base', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

api-contract/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/api-contract', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/api-contract', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

api-derive/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/api-derive', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/api-derive', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

api/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/api', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/api', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

rpc-augment/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/rpc-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/rpc-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

rpc-core/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/rpc-core', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/rpc-core', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

rpc-provider/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/rpc-provider', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/rpc-provider', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

types-augment/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/types-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/types-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

types-codec/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/types-codec', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/types-codec', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

types-codec/utils/decodeU8a.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import type { Codec, CodecClass, Registry } from '../types/index.ts';
33

44
import { u8aToHex } from 'https://deno.land/x/polkadot/util/mod.ts';
55

6+
const MAX_DEPTH = 1024;
7+
8+
/** @internal */
9+
function isComplexType (Type: CodecClass): boolean {
10+
const typeName = Type.name?.toLowerCase() || '';
11+
12+
return ['enum', 'hashmap', 'linkage', 'null', 'option', 'range', 'rangeinclusive', 'result', 'struct', 'tuple', 'vec', 'vecfixed'].includes(typeName);
13+
}
14+
615
/** @internal */
716
function formatFailure (registry: Registry, fn: 'decodeU8a' | 'decodeU8aStruct' | 'decodeU8aVec', _result: unknown[], { message }: Error, u8a: Uint8Array, i: number, count: number, Type: CodecClass, key?: string): string {
817
let type = '';
@@ -61,6 +70,10 @@ export function decodeU8aStruct (registry: Registry, result: [string, Codec][],
6170
let offset = 0;
6271
let i = 0;
6372

73+
if (count > MAX_DEPTH && isComplexType(Types[i])) {
74+
throw new Error(`decodeU8aStruct: Maximum depth exceeded, received ${count} elements, limit ${MAX_DEPTH}`);
75+
}
76+
6477
try {
6578
while (i < count) {
6679
const value = new Types[i](registry, u8a.subarray(offset));
@@ -84,6 +97,11 @@ export function decodeU8aStruct (registry: Registry, result: [string, Codec][],
8497
*/
8598
export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, result: unknown[], u8a: Uint8Array, startAt: number, Type: CodecClass<T>): [number, number] {
8699
const count = result.length;
100+
101+
if (count > MAX_DEPTH && isComplexType(Type)) {
102+
throw new Error(`decodeU8aVec: Maximum depth exceeded, received ${count} elements, limit ${MAX_DEPTH}`);
103+
}
104+
87105
let offset = startAt;
88106
let i = 0;
89107

types-create/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/types-create', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/types-create', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

types-known/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/types-known', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/types-known', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

types/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
export const packageInfo = { name: '@polkadot/types', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.1' };
3+
export const packageInfo = { name: '@polkadot/types', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.2.2' };

0 commit comments

Comments
 (0)