Use source registry in clones (#2597)
This commit is contained in:
+2
-1
@@ -4,8 +4,9 @@
|
||||
|
||||
Changes:
|
||||
|
||||
- When cloning an API instance the runtimeChain is now properly set from source
|
||||
- Allow `paymentInfo` on any extrinsic (already signed) with optional `{ blockHash: <hash> }` param for historic queries
|
||||
- When cloning an API instance the runtimeChain is now properly set from source
|
||||
- When cloning an API instance the registry is shared with the source
|
||||
- Optimize derive `receivedHeartbeats` to not re-create the full object
|
||||
- Add `staking.stakerPrefs` derive to retrieve validatorPrefs over a range of eras
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user