Skip to content

Commit 77ca270

Browse files
committed
test: change timestamps to ms
1 parent 1949669 commit 77ca270

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

packages/pricing/test/providers/dummy.provider.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ describe("DummyPricingProvider", () => {
88
it("return 1 for all token prices", async () => {
99
const provider = new DummyPricingProvider();
1010

11-
const response = await provider.getTokenPrice("ETH" as TokenCode, 11111111 as TimestampMs);
11+
const response = await provider.getTokenPrice(
12+
"ETH" as TokenCode,
13+
1111111100000 as TimestampMs,
14+
);
1215

1316
expect(response).toEqual({
1417
priceUsd: 1,
15-
timestampMs: 11111111,
18+
timestampMs: 1111111100000,
1619
});
1720
});
1821

1922
describe("getTokenPrices", () => {
2023
it("returns dummy prices for all timestamps", async () => {
2124
const provider = new DummyPricingProvider(1);
22-
const timestamps = [1000, 2000, 3000] as TimestampMs[];
25+
const timestamps = [1111111100000, 1111111200000, 1111111300000] as TimestampMs[];
2326

2427
const result = await provider.getTokenPrices("ETH" as TokenCode, timestamps);
2528
expect(result).toEqual(

packages/processors/test/allo/handlers/poolFunded.handler.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function createMockEvent(
1919
): ProcessorEvent<"Allo", "PoolFunded"> {
2020
return {
2121
blockNumber: 116385567,
22-
blockTimestamp: 1708369911 as TimestampMs,
22+
blockTimestamp: 1708369911000 as TimestampMs,
2323
chainId: 10 as ChainId,
2424
contractName: "Allo",
2525
eventName: "PoolFunded",
@@ -84,7 +84,7 @@ describe("PoolFundedHandler", () => {
8484
)[0];
8585
const mockPrice = {
8686
priceUsd: 2.5,
87-
timestampMs: 1708369911 as TimestampMs,
87+
timestampMs: 1708369911000 as TimestampMs,
8888
};
8989
const round = {
9090
id: "1",

packages/processors/test/allo/handlers/roleGranted.handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function createMockEvent(
1616
): ProcessorEvent<"Allo", "RoleGranted"> {
1717
return {
1818
blockNumber: 116385567,
19-
blockTimestamp: 1708369911 as TimestampMs,
19+
blockTimestamp: 1708369911000 as TimestampMs,
2020
chainId: 10 as ChainId,
2121
contractName: "Allo",
2222
eventName: "RoleGranted",

packages/processors/test/registry/handlers/profileOwnerUpdated.handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("ProfileOwnerUpdatedHandler", () => {
99
it("handles ProfileOwnerUpdated event correctly", async () => {
1010
const mockEvent: ProcessorEvent<"Registry", "ProfileOwnerUpdated"> = {
1111
blockNumber: 123456,
12-
blockTimestamp: 123456 as TimestampMs,
12+
blockTimestamp: 1234560000000 as TimestampMs,
1313
chainId: 1 as ChainId,
1414
contractName: "Registry",
1515
eventName: "ProfileOwnerUpdated",

packages/processors/test/strategy/common/base.strategy.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("BaseStrategyHandler", () => {
4646
code: "ETH" as TokenCode,
4747
priceSourceCode: "ETH" as TokenCode,
4848
};
49-
const blockTimestamp = 1625097600 as TimestampMs; // Example timestamp
49+
const blockTimestamp = 1625097600000 as TimestampMs; // Example timestamp
5050

5151
const result = await handler.fetchMatchAmount(
5252
matchingFundsAvailable,

0 commit comments

Comments
 (0)