Fix RPC non-available section init (#4263)

This commit is contained in:
Jaco
2021-11-26 14:47:54 +02:00
committed by GitHub
parent 4b0e0bc6d3
commit cfbde5f6bd
2 changed files with 5 additions and 2 deletions
+1
View File
@@ -4,6 +4,7 @@
Changes:
- Fix for HttpProvider init (RPC sections with only subscriptions)
- Bump static metadata for latest Substrate, Polkadot & Kusama
+4 -2
View File
@@ -354,8 +354,10 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const [k, { method, section }] = allKnown[i];
if (hasResults && !exposed.includes(k) && k !== 'rpc_methods') {
delete (this._rpc as Record<string, Record<string, unknown>>)[section][method];
delete (this._rx.rpc as Record<string, Record<string, unknown>>)[section][method];
if ((this._rpc as Record<string, Record<string, unknown>>)[section]) {
delete (this._rpc as Record<string, Record<string, unknown>>)[section][method];
delete (this._rx.rpc as Record<string, Record<string, unknown>>)[section][method];
}
}
}
}