From c1b6137e182eab82978dacfc15c0f43864726a6b Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 17 Feb 2022 01:48:05 -0600 Subject: [PATCH] Fix type error in script --- functions/src/scripts/migrate-to-dpm-2.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/functions/src/scripts/migrate-to-dpm-2.ts b/functions/src/scripts/migrate-to-dpm-2.ts index 8ceef137..80523a95 100644 --- a/functions/src/scripts/migrate-to-dpm-2.ts +++ b/functions/src/scripts/migrate-to-dpm-2.ts @@ -83,11 +83,15 @@ async function recalculateContract( let totalShares = { YES: Math.sqrt(p) * (phantomAnte + realAnte), NO: Math.sqrt(1 - p) * (phantomAnte + realAnte), + } as { [outcome: string]: number } + + let pool = { YES: p * realAnte, NO: (1 - p) * realAnte } as { + [outcome: string]: number } - let pool = { YES: p * realAnte, NO: (1 - p) * realAnte } - - let totalBets = { YES: p * realAnte, NO: (1 - p) * realAnte } + let totalBets = { YES: p * realAnte, NO: (1 - p) * realAnte } as { + [outcome: string]: number + } const betsRef = contractRef.collection('bets')