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

Commit

Permalink
fix: update mock duplex type (#380)
Browse files Browse the repository at this point in the history
Updates to be compatible with mock multiaddr connection
  • Loading branch information
achingbrain authored Apr 19, 2023
1 parent ad18a26 commit 5260314
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/interface-mocks/src/duplex.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { Duplex } from 'it-stream-types'
import type { Duplex, Source } from 'it-stream-types'

export function mockDuplex (): Duplex<Iterable<Uint8Array>> {
export function mockDuplex (): Duplex<AsyncGenerator<Uint8Array>, Source<Uint8Array>, Promise<void>> {
return {
source: [],
source: (async function * () {
yield * []
}()),
sink: async () => {}
}
}

0 comments on commit 5260314

Please sign in to comment.