mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-11 02:03:10 +00:00
* setup a generic protocol result type (DRY) * metadata: use generic * lightpush: use generic * peer-exchange: use error codes + generic + update tests * add issue link to skipped test * tests: improve while loop readability
18 lines
567 B
TypeScript
18 lines
567 B
TypeScript
import type { PeerId } from "@libp2p/interface";
|
|
|
|
import { type ShardInfo } from "./enr.js";
|
|
import type {
|
|
IBaseProtocolCore,
|
|
ProtocolResult,
|
|
ShardingParams
|
|
} from "./protocols.js";
|
|
|
|
export type QueryResult = ProtocolResult<"shardInfo", ShardInfo>;
|
|
|
|
// IMetadata always has shardInfo defined while it is optionally undefined in IBaseProtocol
|
|
export interface IMetadata extends Omit<IBaseProtocolCore, "shardInfo"> {
|
|
shardInfo: ShardingParams;
|
|
confirmOrAttemptHandshake(peerId: PeerId): Promise<QueryResult>;
|
|
query(peerId: PeerId): Promise<QueryResult>;
|
|
}
|