Skip to content

Commit 78c04ae

Browse files
committed
add tests
1 parent 63427ff commit 78c04ae

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

services/decoder/protocols/renzo/renzo.decoders.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,6 @@ GoldRushDecoder.on(
225225
value: decoded.token,
226226
type: "address",
227227
},
228-
{
229-
heading: "ezETH Minted",
230-
value: decoded.ezETHMinted.toString(),
231-
type: "text",
232-
},
233228
{
234229
heading: "Referral ID",
235230
value: decoded.referralId.toString(),
@@ -306,4 +301,4 @@ GoldRushDecoder.on(
306301
tokens,
307302
};
308303
}
309-
);
304+
);

services/decoder/protocols/renzo/renzo.test.ts

+16-13
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ describe("renzo", () => {
99
.set({ "x-covalent-api-key": process.env.TEST_COVALENT_API_KEY })
1010
.send({
1111
chain_name: "eth-mainnet",
12-
tx_hash: "<ENTER TX HASH FOR TESTING>",
12+
tx_hash:
13+
"0x398cc4c5dd16f5e6fda2a14186c85692ea94de99c200df3665841be1bf9f2af4",
1314
});
1415
const { events } = res.body as { events: EventType[] };
15-
const event = events.find(({ name }) => name === "ShareWithdrawalQueued");
16+
const event = events.find(
17+
({ name }) => name === "ShareWithdrawalQueued"
18+
);
1619
if (!event) {
1720
throw Error("Event not found");
1821
}
19-
const testAdded: boolean = false;
20-
expect(testAdded).toEqual(true);
22+
expect(event?.details?.length).toEqual(4);
2123
});
2224
});
2325

@@ -28,15 +30,15 @@ describe("renzo", () => {
2830
.set({ "x-covalent-api-key": process.env.TEST_COVALENT_API_KEY })
2931
.send({
3032
chain_name: "eth-mainnet",
31-
tx_hash: "<ENTER TX HASH FOR TESTING>",
33+
tx_hash:
34+
"0x398cc4c5dd16f5e6fda2a14186c85692ea94de99c200df3665841be1bf9f2af4",
3235
});
3336
const { events } = res.body as { events: EventType[] };
3437
const event = events.find(({ name }) => name === "WithdrawalQueued");
3538
if (!event) {
3639
throw Error("Event not found");
3740
}
38-
const testAdded: boolean = false;
39-
expect(testAdded).toEqual(true);
41+
expect(event?.details?.length).toEqual(5);
4042
});
4143
});
4244

@@ -47,15 +49,15 @@ describe("renzo", () => {
4749
.set({ "x-covalent-api-key": process.env.TEST_COVALENT_API_KEY })
4850
.send({
4951
chain_name: "eth-mainnet",
50-
tx_hash: "<ENTER TX HASH FOR TESTING>",
52+
tx_hash:
53+
"0xf9842f803f7373eed7b0ad96bf91ea80e85c82074cc2855ccb0ba3d2d778bda7",
5154
});
5255
const { events } = res.body as { events: EventType[] };
5356
const event = events.find(({ name }) => name === "WithdrawalCompleted");
5457
if (!event) {
5558
throw Error("Event not found");
5659
}
57-
const testAdded: boolean = false;
58-
expect(testAdded).toEqual(true);
60+
expect(event?.details?.length).toEqual(4);
5961
});
6062
});
6163

@@ -66,14 +68,15 @@ describe("renzo", () => {
6668
.set({ "x-covalent-api-key": process.env.TEST_COVALENT_API_KEY })
6769
.send({
6870
chain_name: "eth-mainnet",
69-
tx_hash: "<ENTER TX HASH FOR TESTING>",
71+
tx_hash:
72+
"0xdfe1f29b8dfbdd3c6a0d8379e118225f936a4ea74c1e468048d1adbc18510cb0",
7073
});
7174
const { events } = res.body as { events: EventType[] };
7275
const event = events.find(({ name }) => name === "Deposit");
7376
if (!event) {
7477
throw Error("Event not found");
7578
}
76-
const testAdded: boolean = false;
77-
expect(testAdded).toEqual(true);
79+
expect(event?.details?.length).toEqual(3);
80+
expect(event.tokens?.length).toEqual(2);
7881
});
7982
});

0 commit comments

Comments
 (0)