Skip to content

Commit

Permalink
Update uniswap-v2.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gurjotd23 committed Feb 21, 2024
1 parent 5b2b028 commit 45b8523
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions services/decoder/protocols/uniswap-v2/uniswap-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,23 @@ describe("uniswap-v2", () => {
}
expect(event.tokens?.length).toEqual(2);
});

test("eth-mainnet:PairCreated", async () => {
const res = await request(app)
.post("/api/v1/tx/decode")
.set({
"x-covalent-api-key": process.env.TEST_COVALENT_API_KEY,
})
.send({
network: "eth-mainnet",
tx_hash:
"0x9584cdf7d99a22e18843cf26c484018bfb11ab4ce4f2d898ec69075ed8e3c8dc",
});
const { events } = res.body as { events: EventType[] };
const event = events.find(({ name }) => name === "PairCreated");
if (!event) {
throw Error("Event not found");
}
expect(event.tokens?.length).toEqual(2);
});
});

0 comments on commit 45b8523

Please sign in to comment.