mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-02 13:53:12 +00:00
getRoutingInfo is best as a method as it can use the context from this.
This commit is contained in:
parent
8d278f8132
commit
065ef0adb0
@ -260,8 +260,7 @@ export class WakuNode implements IWaku {
|
||||
}
|
||||
|
||||
public createDecoder(params: CreateDecoderParams): IDecoder<IDecodedMessage> {
|
||||
const routingInfo = getRoutingInfo(
|
||||
this.networkConfig,
|
||||
const routingInfo = this.createRoutingInfo(
|
||||
params.contentTopic,
|
||||
params.shardId
|
||||
);
|
||||
@ -269,8 +268,7 @@ export class WakuNode implements IWaku {
|
||||
}
|
||||
|
||||
public createEncoder(params: CreateEncoderParams): IEncoder {
|
||||
const routingInfo = getRoutingInfo(
|
||||
this.networkConfig,
|
||||
const routingInfo = this.createRoutingInfo(
|
||||
params.contentTopic,
|
||||
params.shardId
|
||||
);
|
||||
@ -281,12 +279,11 @@ export class WakuNode implements IWaku {
|
||||
routingInfo: routingInfo
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getRoutingInfo(
|
||||
networkConfig: NetworkConfig,
|
||||
contentTopic?: string,
|
||||
shardId?: number
|
||||
): IRoutingInfo {
|
||||
return createRoutingInfo(networkConfig, { contentTopic, shardId });
|
||||
private createRoutingInfo(
|
||||
contentTopic?: string,
|
||||
shardId?: number
|
||||
): IRoutingInfo {
|
||||
return createRoutingInfo(this.networkConfig, { contentTopic, shardId });
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user