Skip to content

Commit 7e7ef22

Browse files
api, api-{augment, base, contract, derive}, rpc-{augment, core, provider}, types, types-{augment, codec, create, known} 15.9.2
1 parent 50cbeeb commit 7e7ef22

File tree

16 files changed

+24
-21
lines changed

16 files changed

+24
-21
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} 15.9.2
56
- phishing 0.25.8
67
- hw-{ledger, ledger-transports}, keyring, networks, util, util-crypto, x-{bigint, fetch, global, randomvalues, textdecoder, textencoder, ws} 13.4.4
78
- phishing 0.25.7

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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/api-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/api-base', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/api-contract', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/api-derive', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/api', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/rpc-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/rpc-core', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/rpc-provider', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/types-augment', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.2' };

types-codec/native/Struct.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function decodeStructFromObject (registry: Registry, [Types, keys]: Definition,
4141
} else if (typeofMap) {
4242
assign = jsonKey && value.get(jsonKey);
4343
} else {
44-
assign = jsonKey && value[jsonKey] as unknown;
44+
assign = jsonKey && Object.prototype.hasOwnProperty.call(value, jsonKey) ? value[jsonKey] as unknown : undefined;
4545

4646
if (isUndefined(assign)) {
4747
if (isUndefined(jsonObj)) {
@@ -50,11 +50,13 @@ function decodeStructFromObject (registry: Registry, [Types, keys]: Definition,
5050
jsonObj = {};
5151

5252
for (let e = 0, ecount = entries.length; e < ecount; e++) {
53-
jsonObj[stringCamelCase(entries[e][0])] = entries[e][1];
53+
if (Object.prototype.hasOwnProperty.call(value, entries[e][0])) {
54+
jsonObj[stringCamelCase(entries[e][0])] = entries[e][1];
55+
}
5456
}
5557
}
5658

57-
assign = jsonKey && jsonObj[jsonKey];
59+
assign = jsonKey && Object.prototype.hasOwnProperty.call(jsonObj, jsonKey) ? jsonObj[jsonKey] : undefined;
5860
}
5961
}
6062

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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/types-codec', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.2' };

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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/types-create', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/types-known', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.2' };

types/create/registry.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class TypeRegistry implements Registry {
174174
#unknownTypes = new Map<string, boolean>();
175175
#userExtensions?: ExtDef | undefined;
176176

177-
readonly #knownDefaults: Record<string, CodecClass>;
177+
readonly #knownDefaults: Map<string, CodecClass>;
178178
readonly #knownDefaultsEntries: [string, CodecClass][];
179179
readonly #knownDefinitions: Record<string, Definitions>;
180180
readonly #metadataCalls: Record<string, Record<string, CallFunction>> = {};
@@ -185,8 +185,8 @@ export class TypeRegistry implements Registry {
185185
public createdAtHash?: Hash;
186186

187187
constructor (createdAtHash?: Hash | Uint8Array | string) {
188-
this.#knownDefaults = objectSpread({ Json, Metadata, PortableRegistry, Raw }, baseTypes);
189-
this.#knownDefaultsEntries = Object.entries(this.#knownDefaults);
188+
this.#knownDefaults = new Map(Object.entries({ Json, Metadata, PortableRegistry, Raw, ...baseTypes }));
189+
this.#knownDefaultsEntries = Array.from(this.#knownDefaults.entries());
190190
this.#knownDefinitions = definitions;
191191

192192
const allKnown = Object.values(this.#knownDefinitions);
@@ -345,7 +345,7 @@ export class TypeRegistry implements Registry {
345345
}
346346

347347
public getUnsafe <T extends Codec = Codec, K extends string = string> (name: K, withUnknown?: boolean, knownTypeDef?: TypeDef): CodecClass<T> | undefined {
348-
let Type = this.#classes.get(name) || this.#knownDefaults[name];
348+
let Type = this.#classes.get(name) || this.#knownDefaults.get(name);
349349

350350
// we have not already created the type, attempt it
351351
if (!Type) {
@@ -449,7 +449,7 @@ export class TypeRegistry implements Registry {
449449
}
450450

451451
public hasClass (name: string): boolean {
452-
return this.#classes.has(name) || !!this.#knownDefaults[name];
452+
return this.#classes.has(name) || !!this.#knownDefaults.has(name);
453453
}
454454

455455
public hasDef (name: string): boolean {

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: '15.9.1' };
3+
export const packageInfo = { name: '@polkadot/types', path: new URL(import.meta.url).pathname, type: 'deno', version: '15.9.2' };

0 commit comments

Comments
 (0)