Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentwschau committed Nov 26, 2024
1 parent 014315c commit 8ff8d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { RequestMethod, VaultHistoricalPnl } from '../../../../src/types';
import request from 'supertest';
import { getFixedRepresentation, sendRequest } from '../../../helpers/helpers';
import { DateTime } from 'luxon';
import { DateTime, Settings } from 'luxon';
import Big from 'big.js';
import config from '../../../../src/config';

Expand Down Expand Up @@ -124,6 +124,7 @@ describe('vault-controller#V4', () => {
effectiveAtHeight: twoDayBlockHeight,
}),
]);
Settings.now = () => latestTime.valueOf();
});

afterEach(async () => {
Expand All @@ -133,6 +134,7 @@ describe('vault-controller#V4', () => {
config.VAULT_PNL_HISTORY_HOURS = vaultPnlHistoryHoursPrev;
config.VAULT_LATEST_PNL_TICK_WINDOW_HOURS = vaultPnlLastPnlWindowPrev;
config.VAULT_PNL_START_DATE = vaultPnlStartDatePrev;
Settings.now = () => new Date().valueOf();
});

it.each([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ export async function getLatestPnlTicks(
] = await Promise.all([
PnlTicksTable.getLatestPnlTick(
vaultSubaccountIds,
DateTime.utc(),
DateTime.now().toUTC(),
),
PnlTicksTable.getLatestPnlTick(
vaultSubaccountIds,
Expand Down

0 comments on commit 8ff8d07

Please sign in to comment.