Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 20, 2025
1 parent 437df8f commit 36f512e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions yarn-project/p2p/src/services/dummy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ export class DummyP2PService implements P2PService {
return Promise.resolve(undefined);
}

/**
* Sends a batch request to a peer.
* @param _protocol - The protocol to send the request on.
* @param _requests - The requests to send.
* @returns The responses from the peer, otherwise undefined.
*/
public sendBatchRequest<Protocol extends ReqRespSubProtocol>(
_protocol: Protocol,
_requests: InstanceType<SubProtocolMap[Protocol]['request']>[],
): Promise<InstanceType<SubProtocolMap[Protocol]['response']>[]> {
return Promise.resolve([]);
}

/**
* Returns the ENR of the peer.
* @returns The ENR of the peer, otherwise undefined.
Expand Down
5 changes: 4 additions & 1 deletion yarn-project/p2p/src/services/reqresp/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ export const DEFAULT_SUB_PROTOCOL_HANDLERS: ReqRespSubProtocolHandlers = {
* The Request Response Pair interface defines the methods that each
* request response pair must implement
*/
interface RequestResponsePair<Req, Res> {
interface RequestResponsePair<Req extends { toBuffer(): Buffer }, Res> {
/**
* The request must implement the toBuffer method (generic serialisation)
*/
request: new (...args: any[]) => Req;
/**
* The response must implement the static fromBuffer method (generic serialisation)
Expand Down

0 comments on commit 36f512e

Please sign in to comment.