mirror of https://github.com/waku-org/js-waku.git
Prefer camel case for module constants
This commit is contained in:
parent
cbe9559096
commit
ace5f2776f
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue