mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-06-06 20:09:32 +00:00
address comments
This commit is contained in:
parent
5c4118041e
commit
0f73c0f331
@ -3,7 +3,7 @@ import type { PeerId } from "@libp2p/interface-peer-id";
|
|||||||
import { Peer } from "@libp2p/interface-peer-store";
|
import { Peer } from "@libp2p/interface-peer-store";
|
||||||
import { sha256 } from "@noble/hashes/sha256";
|
import { sha256 } from "@noble/hashes/sha256";
|
||||||
import { concat, utf8ToBytes } from "@waku/byte-utils";
|
import { concat, utf8ToBytes } from "@waku/byte-utils";
|
||||||
import { DecodedMessage, Decoder } from "@waku/interfaces";
|
import { DecodedMessage, Decoder, Index } from "@waku/interfaces";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
import all from "it-all";
|
import all from "it-all";
|
||||||
import * as lp from "it-length-prefixed";
|
import * as lp from "it-length-prefixed";
|
||||||
@ -80,7 +80,7 @@ export interface QueryOptions {
|
|||||||
/**
|
/**
|
||||||
* Cursor as an index to start a query from.
|
* Cursor as an index to start a query from.
|
||||||
*/
|
*/
|
||||||
cursor?: proto.Index;
|
cursor?: Index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -278,7 +278,7 @@ async function* paginate<T extends DecodedMessage>(
|
|||||||
protocol: string,
|
protocol: string,
|
||||||
queryOpts: Params,
|
queryOpts: Params,
|
||||||
decoders: Map<string, Decoder<T>>,
|
decoders: Map<string, Decoder<T>>,
|
||||||
cursor?: proto.Index
|
cursor?: Index
|
||||||
): AsyncGenerator<Promise<T | undefined>[]> {
|
): AsyncGenerator<Promise<T | undefined>[]> {
|
||||||
if (
|
if (
|
||||||
queryOpts.contentTopics.toString() !==
|
queryOpts.contentTopics.toString() !==
|
||||||
@ -381,7 +381,7 @@ export function isDefined<T>(msg: T | undefined): msg is T {
|
|||||||
export async function createCursor(
|
export async function createCursor(
|
||||||
message: DecodedMessage,
|
message: DecodedMessage,
|
||||||
pubsubTopic: string = DefaultPubSubTopic
|
pubsubTopic: string = DefaultPubSubTopic
|
||||||
): Promise<proto.Index> {
|
): Promise<Index> {
|
||||||
if (
|
if (
|
||||||
!message ||
|
!message ||
|
||||||
!message.timestamp ||
|
!message.timestamp ||
|
||||||
|
|||||||
@ -62,8 +62,6 @@ export class MessageV1 extends MessageV0 implements DecodedMessage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { sha256 } from "./crypto";
|
|
||||||
|
|
||||||
export class AsymEncoder implements Encoder {
|
export class AsymEncoder implements Encoder {
|
||||||
constructor(
|
constructor(
|
||||||
public contentTopic: string,
|
public contentTopic: string,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user