chore: use pascal case for class name

This commit is contained in:
fryorcraken.eth 2023-02-24 16:00:20 +11:00
parent 5f0e8b72f5
commit f6130d65c9
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 10 additions and 10 deletions

View File

@ -8,7 +8,7 @@ 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(
@ -16,8 +16,8 @@ export class FilterRPC {
contentFilters: ContentFilter[],
requestId?: string,
subscribe = true
): FilterRPC {
return new FilterRPC({
): FilterRpc {
return new FilterRpc({
requestId: requestId || uuid(),
request: {
subscribe,
@ -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);
}
/**

View File

@ -21,7 +21,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 };
@ -75,7 +75,7 @@ class Filter extends BaseProtocol implements IFilter {
const contentFilters = contentTopics.map((contentTopic) => ({
contentTopic,
}));
const request = FilterRPC.createRequest(
const request = FilterRpc.createRequest(
pubSubTopic,
contentFilters,
undefined,
@ -128,7 +128,7 @@ class Filter extends BaseProtocol 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);
}
@ -228,7 +228,7 @@ class Filter extends BaseProtocol implements IFilter {
requestId: string,
peer: Peer
): Promise<void> {
const unsubscribeRequest = FilterRPC.createRequest(
const unsubscribeRequest = FilterRpc.createRequest(
topic,
contentFilters,
requestId,