Skip to content

Commit ba91d58

Browse files
authored
feat(test): add missing (#14)
1 parent c6a02f0 commit ba91d58

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

microservices/tx/tx.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { GoldRushDecoder } from "../../services";
22
import {
33
CovalentClient,
44
type Chain,
5-
type LogEvent,
65
type Transaction,
76
} from "@covalenthq/client-sdk";
87

services/decoder/protocols/4337-entry-point/4337-entry-point.test.ts

+19
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,23 @@ describe("4337-entry-point", () => {
2121
}
2222
expect(event.details?.length).toEqual(5);
2323
});
24+
25+
test("avalanche-mainnet:UserOperationEvent", async () => {
26+
const res = await request(app)
27+
.post("/api/v1/tx/decode")
28+
.set({ "x-covalent-api-key": process.env.TEST_COVALENT_API_KEY })
29+
.send({
30+
network: "avalanche-mainnet",
31+
tx_hash:
32+
"0xc244be4710c3ad34e120c596555ce75c40356c3d9de9b141a8d5ce0ed056e0d2",
33+
});
34+
const { events } = res.body as { events: EventType[] };
35+
const event = events.find(
36+
({ name }) => name === "User Operation Event"
37+
);
38+
if (!event) {
39+
throw Error("Event not found");
40+
}
41+
expect(event.details?.length).toEqual(5);
42+
});
2443
});

services/decoder/protocols/covalent-network/covalent-network.decoders.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ GoldRushDecoder.on(
4343
{
4444
title: "Specimen Hash",
4545
value: decoded.specimenHash,
46-
type: "text",
46+
type: "address",
4747
},
4848
{
4949
title: "Storage URL",

services/decoder/protocols/paraswap-v5/paraswap-v5.test.ts

+18
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,22 @@ describe("paraswap-v5", () => {
3838
expect(event.details?.length).toEqual(4);
3939
expect(event.tokens?.length).toEqual(2);
4040
});
41+
42+
test("avalanche-mainnet:SwappedV3", async () => {
43+
const res = await request(app)
44+
.post("/api/v1/tx/decode")
45+
.set({ "x-covalent-api-key": process.env.TEST_COVALENT_API_KEY })
46+
.send({
47+
network: "avalanche-mainnet",
48+
tx_hash:
49+
"0x41525d4a5790d110ec0816397cafeab5d777e8a8c21f07b06a800d5c567d2804",
50+
});
51+
const { events } = res.body as { events: EventType[] };
52+
const event = events.find(({ name }) => name === "Swap V3");
53+
if (!event) {
54+
throw Error("Event not found");
55+
}
56+
expect(event.details?.length).toEqual(4);
57+
expect(event.tokens?.length).toEqual(2);
58+
});
4159
});

0 commit comments

Comments
 (0)