chore: use pascal case for class name

This commit is contained in:
fryorcraken.eth 2023-02-24 22:20:42 +11:00
parent 3e93e8f49e
commit 18d31381d2
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@ import { Uint8ArrayList } from "uint8arraylist";
import { BaseProtocol } from "../base_protocol.js"; import { BaseProtocol } from "../base_protocol.js";
import { DefaultPubSubTopic } from "../constants.js"; import { DefaultPubSubTopic } from "../constants.js";
import { PushRPC } from "./push_rpc.js"; import { PushRpc } from "./push_rpc.js";
const log = debug("waku:light-push"); const log = debug("waku:light-push");
@ -54,7 +54,7 @@ class LightPush extends BaseProtocol implements ILightPush {
log("Failed to encode to protoMessage, aborting push"); log("Failed to encode to protoMessage, aborting push");
return { recipients }; return { recipients };
} }
const query = PushRPC.createRequest(protoMessage, pubSubTopic); const query = PushRpc.createRequest(protoMessage, pubSubTopic);
const res = await pipe( const res = await pipe(
[query.encode()], [query.encode()],
lp.encode(), lp.encode(),
@ -68,7 +68,7 @@ class LightPush extends BaseProtocol implements ILightPush {
bytes.append(chunk); bytes.append(chunk);
}); });
const response = PushRPC.decode(bytes).response; const response = PushRpc.decode(bytes).response;
if (!response) { if (!response) {
log("No response in PushRPC"); log("No response in PushRPC");

View File

@ -2,14 +2,14 @@ import { proto_lightpush as proto } from "@waku/proto";
import type { Uint8ArrayList } from "uint8arraylist"; import type { Uint8ArrayList } from "uint8arraylist";
import { v4 as uuid } from "uuid"; import { v4 as uuid } from "uuid";
export class PushRPC { export class PushRpc {
public constructor(public proto: proto.PushRpc) {} public constructor(public proto: proto.PushRpc) {}
static createRequest( static createRequest(
message: proto.WakuMessage, message: proto.WakuMessage,
pubSubTopic: string pubSubTopic: string
): PushRPC { ): PushRpc {
return new PushRPC({ return new PushRpc({
requestId: uuid(), requestId: uuid(),
request: { request: {
message: message, message: message,
@ -19,9 +19,9 @@ export class PushRPC {
}); });
} }
static decode(bytes: Uint8ArrayList): PushRPC { static decode(bytes: Uint8ArrayList): PushRpc {
const res = proto.PushRpc.decode(bytes); const res = proto.PushRpc.decode(bytes);
return new PushRPC(res); return new PushRpc(res);
} }
encode(): Uint8Array { encode(): Uint8Array {