Skip to content

Commit

Permalink
feat(api): fix tests types
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Maldonado <[email protected]>
  • Loading branch information
md0x committed Dec 11, 2024
1 parent 79b1d5d commit 8be498b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/api/relayer-config.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { VercelResponse } from "@vercel/node";
import { ethers } from "ethers";
import * as utils from "../../api/_exclusivity/utils";
import { TypedRelayerConfigUpdateRequest } from "../../api/_types";
import {
RelayerConfigUpdate,
TypedRelayerConfigUpdateRequest,
} from "../../api/_types";
import handler from "../../api/relayer-config";
const { MAX_MESSAGE_AGE_SECONDS } = utils;

Expand All @@ -26,8 +29,9 @@ describe("Relayer Config API", () => {
});

test("POST request with valid timestamp", async () => {
const message = {
const message: RelayerConfigUpdate = {
timestamp: Date.now() / 1000,
relayerFillLimits: [],
};
const messageString = JSON.stringify(message);
const signature = await whitelistedRelayer.signMessage(messageString);
Expand All @@ -46,8 +50,9 @@ describe("Relayer Config API", () => {
});

test("POST request with invalid timestamp", async () => {
const message = {
const message: RelayerConfigUpdate = {
timestamp: Date.now() / 1000 - MAX_MESSAGE_AGE_SECONDS - 1,
relayerFillLimits: [],
};
const signature = await whitelistedRelayer.signMessage(
JSON.stringify(message)
Expand All @@ -68,8 +73,9 @@ describe("Relayer Config API", () => {
});

test("POST request with invalid signature", async () => {
const message = {
const message: RelayerConfigUpdate = {
timestamp: Date.now() / 1000,
relayerFillLimits: [],
};
const signature = await unauthorizedRelayer.signMessage(
JSON.stringify(message)
Expand Down

0 comments on commit 8be498b

Please sign in to comment.