Skip to content

Commit

Permalink
fix backward compatible tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Dec 19, 2023
1 parent bc41efa commit 618a40a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapters/price/MonoswapPriceAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class MonoswapPriceAdapter implements PriceAdapterInterface {
const tokenPrices = await getMonoSwapTokenPrices(
params.symbol,
baseTokens,
params.networkId,
params.networkId!,
);
return Number(tokenPrices[0]);
}
Expand Down
4 changes: 4 additions & 0 deletions src/services/donationService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -780,6 +781,7 @@ function fillOldStableCoinDonationsPriceTestCases() {
token,
CHAIN_ID.POLYGON,
amount,
ChainType.EVM,
);

donation = (await findDonationById(donation.id))!;
Expand Down Expand Up @@ -812,6 +814,7 @@ function fillOldStableCoinDonationsPriceTestCases() {
token,
CHAIN_ID.CELO,
amount,
ChainType.EVM,
);
donation = (await findDonationById(donation.id))!;
expect(donation.valueUsd).to.gt(0);
Expand Down Expand Up @@ -843,6 +846,7 @@ function fillOldStableCoinDonationsPriceTestCases() {
token,
CHAIN_ID.ALFAJORES,
amount,
ChainType.EVM,
);

donation = (await findDonationById(donation.id))!;
Expand Down
2 changes: 2 additions & 0 deletions src/services/onramper/donationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
updateUserTotalDonated,
updateUserTotalReceived,
} from '../userService';
import { ChainType } from '../../types/network';

export const createFiatDonationFromOnramper = async (
fiatTransaction: OnRamperFiatTransaction,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 618a40a

Please sign in to comment.