From 9e1752207c48ab185046f024979b9236686ba021 Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:54:42 +0000 Subject: [PATCH] fix --- yarn-project/circuit-types/src/interfaces/p2p.test.ts | 6 +++--- yarn-project/circuit-types/src/interfaces/p2p.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn-project/circuit-types/src/interfaces/p2p.test.ts b/yarn-project/circuit-types/src/interfaces/p2p.test.ts index ffd506c0276..4ed7920fd3c 100644 --- a/yarn-project/circuit-types/src/interfaces/p2p.test.ts +++ b/yarn-project/circuit-types/src/interfaces/p2p.test.ts @@ -8,13 +8,13 @@ import { type P2PApi, P2PApiSchema, type PeerInfo } from './p2p.js'; describe('P2PApiSchema', () => { let handler: MockP2P; - let context: JsonRpcTestContext>; + let context: JsonRpcTestContext; const tested = new Set(); beforeEach(async () => { handler = new MockP2P(); - context = await createJsonRpcTestSetup>(handler, P2PApiSchema); + context = await createJsonRpcTestSetup(handler, P2PApiSchema); }); afterEach(() => { @@ -66,7 +66,7 @@ const peers: PeerInfo[] = [ { status: 'cached', id: 'id', addresses: ['address'], enr: 'enr', dialAttempts: 1 }, ]; -class MockP2P implements P2PApi { +class MockP2P implements P2PApi { getAttestationsForSlot(slot: bigint, proposalId?: string | undefined): Promise { expect(slot).toEqual(1n); expect(proposalId).toEqual('proposalId'); diff --git a/yarn-project/circuit-types/src/interfaces/p2p.ts b/yarn-project/circuit-types/src/interfaces/p2p.ts index 5721d19c590..d2032f9d129 100644 --- a/yarn-project/circuit-types/src/interfaces/p2p.ts +++ b/yarn-project/circuit-types/src/interfaces/p2p.ts @@ -62,11 +62,11 @@ export interface P2PClient extends P2PApiWithoutAttestations { getAttestationsForSlot(slot: bigint, proposalId?: string): Promise; } -export type P2PApi = T extends P2PClientType.Full +export type P2PApi = T extends P2PClientType.Full ? P2PClient & P2PApiWithoutAttestations : P2PApiWithoutAttestations; -export const P2PApiSchema: ApiSchemaFor> = { +export const P2PApiSchema: ApiSchemaFor = { getAttestationsForSlot: z .function() .args(schemas.BigInt, optional(z.string()))