refactor: remove Waku from protocol names

This is redundant with the context (waku package).
This commit is contained in:
fryorcraken.eth 2022-12-06 12:51:02 +11:00
parent 574f3ee80f
commit d946e443ad
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
4 changed files with 9 additions and 10 deletions

View File

@ -64,7 +64,7 @@ export type UnsubscribeFunction = () => Promise<void>;
* - https://github.com/status-im/go-waku/issues/245 * - https://github.com/status-im/go-waku/issues/245
* - https://github.com/status-im/nwaku/issues/948 * - https://github.com/status-im/nwaku/issues/948
*/ */
class WakuFilter implements IFilter { class Filter implements IFilter {
pubSubTopic: string; pubSubTopic: string;
private subscriptions: Map<string, Callback<any>>; private subscriptions: Map<string, Callback<any>>;
private decoders: Map< private decoders: Map<
@ -309,5 +309,5 @@ class WakuFilter implements IFilter {
export function wakuFilter( export function wakuFilter(
init: Partial<CreateOptions> = {} init: Partial<CreateOptions> = {}
): (components: FilterComponents) => IFilter { ): (components: FilterComponents) => IFilter {
return (components: FilterComponents) => new WakuFilter(components, init); return (components: FilterComponents) => new Filter(components, init);
} }

View File

@ -51,7 +51,7 @@ export interface CreateOptions {
/** /**
* Implements the [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/). * Implements the [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/).
*/ */
class WakuLightPush implements ILightPush { class LightPush implements ILightPush {
pubSubTopic: string; pubSubTopic: string;
constructor(public components: LightPushComponents, options?: CreateOptions) { constructor(public components: LightPushComponents, options?: CreateOptions) {
@ -152,6 +152,5 @@ class WakuLightPush implements ILightPush {
export function wakuLightPush( export function wakuLightPush(
init: Partial<CreateOptions> = {} init: Partial<CreateOptions> = {}
): (components: LightPushComponents) => ILightPush { ): (components: LightPushComponents) => ILightPush {
return (components: LightPushComponents) => return (components: LightPushComponents) => new LightPush(components, init);
new WakuLightPush(components, init);
} }

View File

@ -53,7 +53,7 @@ export type CreateOptions = {
* *
* @implements {require('libp2p-interfaces/src/pubsub')} * @implements {require('libp2p-interfaces/src/pubsub')}
*/ */
class WakuRelay extends GossipSub implements IRelay { class Relay extends GossipSub implements IRelay {
pubSubTopic: string; pubSubTopic: string;
defaultDecoder: IDecoder<IDecodedMessage>; defaultDecoder: IDecoder<IDecodedMessage>;
public static multicodec: string = constants.RelayCodecs[0]; public static multicodec: string = constants.RelayCodecs[0];
@ -185,10 +185,10 @@ class WakuRelay extends GossipSub implements IRelay {
} }
} }
WakuRelay.multicodec = constants.RelayCodecs[constants.RelayCodecs.length - 1]; Relay.multicodec = constants.RelayCodecs[constants.RelayCodecs.length - 1];
export function wakuRelay( export function wakuRelay(
init: Partial<CreateOptions> = {} init: Partial<CreateOptions> = {}
): (components: GossipSubComponents) => IRelay { ): (components: GossipSubComponents) => IRelay {
return (components: GossipSubComponents) => new WakuRelay(components, init); return (components: GossipSubComponents) => new Relay(components, init);
} }

View File

@ -104,7 +104,7 @@ export interface QueryOptions {
* *
* The Waku Store protocol can be used to retrieved historical messages. * The Waku Store protocol can be used to retrieved historical messages.
*/ */
class WakuStore implements IStore { class Store implements IStore {
pubSubTopic: string; pubSubTopic: string;
constructor(public components: StoreComponents, options?: CreateOptions) { constructor(public components: StoreComponents, options?: CreateOptions) {
@ -433,5 +433,5 @@ export async function createCursor(
export function wakuStore( export function wakuStore(
init: Partial<CreateOptions> = {} init: Partial<CreateOptions> = {}
): (components: StoreComponents) => IStore { ): (components: StoreComponents) => IStore {
return (components: StoreComponents) => new WakuStore(components, init); return (components: StoreComponents) => new Store(components, init);
} }