From fc2fd81aed8419a684f1435cab5c8b00b414b8f1 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 16 Oct 2024 09:58:22 +0200 Subject: [PATCH] fix(market): fixed the ProposalDTO type that was wronlgy typed as partial This was forcing users to unnecessairly type-guard their code when writing proposal filters --- src/market/proposal/offer-proposal.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/market/proposal/offer-proposal.ts b/src/market/proposal/offer-proposal.ts index 8fa0793e7..d447e89ab 100644 --- a/src/market/proposal/offer-proposal.ts +++ b/src/market/proposal/offer-proposal.ts @@ -15,7 +15,7 @@ export type PricingInfo = { export type ProposalState = "Initial" | "Draft" | "Rejected" | "Accepted" | "Expired"; -export type ProposalDTO = Partial<{ +export type ProposalDTO = { transferProtocol: string[]; cpuBrand: string; cpuCapabilities: string[]; @@ -23,12 +23,14 @@ export type ProposalDTO = Partial<{ cpuThreads: number; memory: number; storage: number; - publicNet: boolean; runtimeCapabilities: string[]; runtimeName: string; runtimeVersion: string; state: ProposalState; -}>; + + /** Non-standardised property, we can't assume it will be always there */ + publicNet?: boolean; +}; /** * Entity representing the offer presented by the Provider to the Requestor