Prefer camel case for module constants

This commit is contained in:
Franck Royer 2021-05-10 11:43:57 +10:00
parent cbe9559096
commit ace5f2776f
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 8 additions and 8 deletions

View File

@ -4,8 +4,8 @@ import { Reader } from 'protobufjs/minimal';
// Protecting the user from protobuf oddities
import * as proto from '../proto/waku/v2/message';
export const DEFAULT_CONTENT_TOPIC = '/waku/2/default-content/proto';
const DEFAULT_VERSION = 0;
export const DefaultContentTopic = '/waku/2/default-content/proto';
const DefaultVersion = 0;
export class WakuMessage {
public constructor(public proto: proto.WakuMessage) {}
@ -18,12 +18,12 @@ export class WakuMessage {
*/
static fromUtf8String(
utf8: string,
contentTopic: string = DEFAULT_CONTENT_TOPIC
contentTopic: string = DefaultContentTopic
): WakuMessage {
const payload = Buffer.from(utf8, 'utf-8');
return new WakuMessage({
payload,
version: DEFAULT_VERSION,
version: DefaultVersion,
contentTopic,
});
}
@ -36,11 +36,11 @@ export class WakuMessage {
*/
static fromBytes(
payload: Uint8Array,
contentTopic: string = DEFAULT_CONTENT_TOPIC
contentTopic: string = DefaultContentTopic
): WakuMessage {
return new WakuMessage({
payload,
version: DEFAULT_VERSION,
version: DefaultVersion,
contentTopic,
});
}

View File

@ -2,14 +2,14 @@ import { Reader } from 'protobufjs/minimal';
import { v4 as uuid } from 'uuid';
import * as proto from '../../proto/waku/v2/store';
import { DEFAULT_CONTENT_TOPIC } from '../waku_message';
import { DefaultContentTopic } from '../waku_message';
import { RelayDefaultTopic } from '../waku_relay';
export class HistoryRPC {
public constructor(public proto: proto.HistoryRPC) {}
static createQuery(
contentTopics: string[] = [DEFAULT_CONTENT_TOPIC],
contentTopics: string[] = [DefaultContentTopic],
cursor?: proto.Index,
pubsubTopic: string = RelayDefaultTopic
): HistoryRPC {