Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
feat!: pubsub Message types for signature policies
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `Message` type is now either a `StrictSignMessage`
or a `StrictNoSignMessage`
  • Loading branch information
wemeetagain committed Jun 29, 2022
1 parent 73d3b41 commit 7df06b0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/interface-pubsub/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,22 @@ export const StrictNoSign = 'StrictNoSign'

export type SignaturePolicy = typeof StrictSign | typeof StrictNoSign

export interface Message {
export interface StrictSignMessage {
from: PeerId
topic: string
data: Uint8Array
sequenceNumber?: bigint
signature?: Uint8Array
key?: Uint8Array
sequenceNumber: bigint
signature: Uint8Array
key: Uint8Array
}

export interface StrictNoSignMessage {
topic: string
data: Uint8Array
}

export type Message = StrictSignMessage | StrictNoSignMessage

export interface PubSubRPCMessage {
from?: Uint8Array
topic?: string
Expand Down

0 comments on commit 7df06b0

Please sign in to comment.