From 618a40a39697322daec11398430f85174d69c4f6 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 18 Dec 2023 22:45:51 -0500 Subject: [PATCH] fix backward compatible tests --- src/adapters/price/MonoswapPriceAdapter.ts | 2 +- src/services/donationService.test.ts | 4 ++++ src/services/onramper/donationService.ts | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/adapters/price/MonoswapPriceAdapter.ts b/src/adapters/price/MonoswapPriceAdapter.ts index 649f781ac..9ff96e34b 100644 --- a/src/adapters/price/MonoswapPriceAdapter.ts +++ b/src/adapters/price/MonoswapPriceAdapter.ts @@ -26,7 +26,7 @@ export class MonoswapPriceAdapter implements PriceAdapterInterface { const tokenPrices = await getMonoSwapTokenPrices( params.symbol, baseTokens, - params.networkId, + params.networkId!, ); return Number(tokenPrices[0]); } diff --git a/src/services/donationService.test.ts b/src/services/donationService.test.ts index b6b01a10f..6aafebc31 100644 --- a/src/services/donationService.test.ts +++ b/src/services/donationService.test.ts @@ -41,6 +41,7 @@ import { } from '../repositories/qfRoundHistoryRepository'; import { User } from '../entities/user'; import { QfRoundHistory } from '../entities/qfRoundHistory'; +import { ChainType } from '../types/network'; describe('isProjectAcceptToken test cases', isProjectAcceptTokenTestCases); describe( @@ -780,6 +781,7 @@ function fillOldStableCoinDonationsPriceTestCases() { token, CHAIN_ID.POLYGON, amount, + ChainType.EVM, ); donation = (await findDonationById(donation.id))!; @@ -812,6 +814,7 @@ function fillOldStableCoinDonationsPriceTestCases() { token, CHAIN_ID.CELO, amount, + ChainType.EVM, ); donation = (await findDonationById(donation.id))!; expect(donation.valueUsd).to.gt(0); @@ -843,6 +846,7 @@ function fillOldStableCoinDonationsPriceTestCases() { token, CHAIN_ID.ALFAJORES, amount, + ChainType.EVM, ); donation = (await findDonationById(donation.id))!; diff --git a/src/services/onramper/donationService.ts b/src/services/onramper/donationService.ts index b3016da0b..cd5a7b996 100644 --- a/src/services/onramper/donationService.ts +++ b/src/services/onramper/donationService.ts @@ -19,6 +19,7 @@ import { updateUserTotalDonated, updateUserTotalReceived, } from '../userService'; +import { ChainType } from '../../types/network'; export const createFiatDonationFromOnramper = async ( fiatTransaction: OnRamperFiatTransaction, @@ -140,6 +141,7 @@ export const createFiatDonationFromOnramper = async ( fiatTransaction.payload.outCurrency, priceChainId, fiatTransaction.payload.outAmount, + ChainType.EVM, ); // After updating, recalculate user total donated and owner total received