chore: use pascal case for class name

This commit is contained in:
fryorcraken.eth 2023-02-25 00:01:31 +11:00
parent 967e6ffc7e
commit 81d6638067
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 7 additions and 7 deletions

View File

@ -19,7 +19,7 @@ export interface Params {
cursor?: proto.Index; cursor?: proto.Index;
} }
export class HistoryRPC { export class HistoryRpc {
private constructor(public readonly proto: proto.HistoryRpc) {} private constructor(public readonly proto: proto.HistoryRpc) {}
get query(): proto.HistoryQuery | undefined { get query(): proto.HistoryQuery | undefined {
@ -33,7 +33,7 @@ export class HistoryRPC {
/** /**
* Create History Query. * Create History Query.
*/ */
static createQuery(params: Params): HistoryRPC { static createQuery(params: Params): HistoryRpc {
const contentFilters = params.contentTopics.map((contentTopic) => { const contentFilters = params.contentTopics.map((contentTopic) => {
return { contentTopic }; return { contentTopic };
}); });
@ -56,7 +56,7 @@ export class HistoryRPC {
// milliseconds 10^-3 to nanoseconds 10^-9 // milliseconds 10^-3 to nanoseconds 10^-9
endTime = BigInt(params.endTime.valueOf()) * OneMillion; endTime = BigInt(params.endTime.valueOf()) * OneMillion;
} }
return new HistoryRPC({ return new HistoryRpc({
requestId: uuid(), requestId: uuid(),
query: { query: {
pubsubTopic: params.pubSubTopic, pubsubTopic: params.pubSubTopic,
@ -69,9 +69,9 @@ export class HistoryRPC {
}); });
} }
decode(bytes: Uint8ArrayList): HistoryRPC { decode(bytes: Uint8ArrayList): HistoryRpc {
const res = proto.HistoryRpc.decode(bytes); const res = proto.HistoryRpc.decode(bytes);
return new HistoryRPC(res); return new HistoryRpc(res);
} }
encode(): Uint8Array { encode(): Uint8Array {

View File

@ -21,7 +21,7 @@ import { BaseProtocol } from "../base_protocol.js";
import { DefaultPubSubTopic } from "../constants.js"; import { DefaultPubSubTopic } from "../constants.js";
import { toProtoMessage } from "../to_proto_message.js"; import { toProtoMessage } from "../to_proto_message.js";
import { HistoryRPC, PageDirection, Params } from "./history_rpc.js"; import { HistoryRpc, PageDirection, Params } from "./history_rpc.js";
import HistoryError = proto.HistoryResponse.HistoryError; import HistoryError = proto.HistoryResponse.HistoryError;
@ -261,7 +261,7 @@ async function* paginate<T extends IDecodedMessage>(
while (true) { while (true) {
queryOpts.cursor = currentCursor; queryOpts.cursor = currentCursor;
const historyRpcQuery = HistoryRPC.createQuery(queryOpts); const historyRpcQuery = HistoryRpc.createQuery(queryOpts);
log( log(
"Querying store peer", "Querying store peer",