Use source registry in clones (#2597)

This commit is contained in:
Jaco Greeff
2020-09-10 02:38:07 +02:00
committed by GitHub
parent e5b7e7f16f
commit b59b60ae1f
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
super();
this.#instanceId = `${++instanceCounter}`;
this.#registry = options.registry || new TypeRegistry();
this.#registry = options.source?.registry || options.registry || new TypeRegistry();
const thisProvider = options.source
? options.source._rpcCore.provider.clone()
+1 -2
View File
@@ -45,7 +45,7 @@ export default abstract class Init<ApiType extends ApiTypes> extends Decorate<Ap
if (!options.source) {
this.registerTypes(options.types);
} else {
this.registry.setKnownTypes(options.source.registry.knownTypes);
this.#registries = options.source.#registries;
}
this._rpc = this._decorateRpc(this._rpcCore, this._decorateMethod);
@@ -164,7 +164,6 @@ export default abstract class Init<ApiType extends ApiTypes> extends Decorate<Ap
this._runtimeChain = source.runtimeChain;
this._runtimeVersion = source.runtimeVersion;
this._genesisHash = source.genesisHash;
this.registry.setChainProperties(source.registry.getChainProperties());
const methods: string[] = [];