Skip to content

Commit

Permalink
chore: use pascal case for class name
Browse files Browse the repository at this point in the history
  • Loading branch information
fryorcraken committed Feb 24, 2023
1 parent 4609ed2 commit affd3d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/core/src/lib/filter/filter_rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ export type ContentFilter = {
/**
* FilterRPC represents a message conforming to the Waku Filter protocol
*/
export class FilterRPC {
export class FilterRpc {
public constructor(public proto: proto.FilterRpc) {}

static createRequest(
topic: string,
contentFilters: ContentFilter[],
requestId?: string,
subscribe = true
): FilterRPC {
return new FilterRPC({
): FilterRpc {
return new FilterRpc({
requestId: requestId || uuid(),
request: {
subscribe,
Expand All @@ -31,11 +31,11 @@ export class FilterRPC {
/**
*
* @param bytes Uint8Array of bytes from a FilterRPC message
* @returns FilterRPC
* @returns FilterRpc
*/
static decode(bytes: Uint8Array): FilterRPC {
static decode(bytes: Uint8Array): FilterRpc {
const res = proto.FilterRpc.decode(bytes);
return new FilterRPC(res);
return new FilterRpc(res);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/lib/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { DefaultPubSubTopic } from "../constants.js";
import { groupByContentTopic } from "../group_by.js";
import { toProtoMessage } from "../to_proto_message.js";

import { ContentFilter, FilterRPC } from "./filter_rpc.js";
import { ContentFilter, FilterRpc } from "./filter_rpc.js";

export { ContentFilter };

Expand Down Expand Up @@ -84,7 +84,7 @@ class Filter implements IFilter {
const contentFilters = contentTopics.map((contentTopic) => ({
contentTopic,
}));
const request = FilterRPC.createRequest(
const request = FilterRpc.createRequest(
pubSubTopic,
contentFilters,
undefined,
Expand Down Expand Up @@ -141,7 +141,7 @@ class Filter implements IFilter {
try {
pipe(streamData.stream, lp.decode(), async (source) => {
for await (const bytes of source) {
const res = FilterRPC.decode(bytes.slice());
const res = FilterRpc.decode(bytes.slice());
if (res.requestId && res.push?.messages?.length) {
await this.pushMessages(res.requestId, res.push.messages);
}
Expand Down Expand Up @@ -241,7 +241,7 @@ class Filter implements IFilter {
requestId: string,
peer: Peer
): Promise<void> {
const unsubscribeRequest = FilterRPC.createRequest(
const unsubscribeRequest = FilterRpc.createRequest(
topic,
contentFilters,
requestId,
Expand Down

0 comments on commit affd3d6

Please sign in to comment.