Skip to content

Commit 6224c88

Browse files
committed
updated tests, all pass now
1 parent cbdb51b commit 6224c88

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

.env.example

-2
This file was deleted.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,4 @@ dist
131131

132132
# Custom added
133133
decoders.dump
134+
.env.example

services/decoder/protocols/uniswap-v2/uniswap-v2.decoders.ts

+17
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ GoldRushDecoder.on(
7575
logo: log_event.sender_logo_url as string,
7676
name: log_event.sender_name as string,
7777
},
78+
details: [
79+
{
80+
heading: "Sender",
81+
type: "address",
82+
value: decoded.sender,
83+
},
84+
{
85+
heading: "To",
86+
type: "address",
87+
value: decoded.to,
88+
},
89+
],
7890
tokens: [
7991
{
8092
ticker_logo: inputToken?.logo_url ?? null,
@@ -491,6 +503,11 @@ GoldRushDecoder.on(
491503
value: data?.items?.[0]?.token_1?.contract_address || "",
492504
type: "address",
493505
},
506+
{
507+
heading: "Pair Address",
508+
value: decoded.pair,
509+
type: "address",
510+
},
494511
],
495512
};
496513
}

services/decoder/protocols/uniswap-v2/uniswap-v2.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe("uniswap-v2", () => {
5050
"x-covalent-api-key": process.env.TEST_COVALENT_API_KEY,
5151
})
5252
.send({
53-
network: "eth-mainnet",
53+
chain_name: "eth-mainnet",
5454
tx_hash:
5555
"0xf419cd1a89b928cb93f38237e9b1e6743218fbb87aaac678cb1f950951b7476e",
5656
});
@@ -69,7 +69,7 @@ describe("uniswap-v2", () => {
6969
"x-covalent-api-key": process.env.TEST_COVALENT_API_KEY,
7070
})
7171
.send({
72-
network: "eth-mainnet",
72+
chain_name: "eth-mainnet",
7373
tx_hash:
7474
"0xf419cd1a89b928cb93f38237e9b1e6743218fbb87aaac678cb1f950951b7476e",
7575
});
@@ -88,15 +88,15 @@ describe("uniswap-v2", () => {
8888
"x-covalent-api-key": process.env.TEST_COVALENT_API_KEY,
8989
})
9090
.send({
91-
network: "eth-mainnet",
91+
chain_name: "eth-mainnet",
9292
tx_hash:
9393
"0x9584cdf7d99a22e18843cf26c484018bfb11ab4ce4f2d898ec69075ed8e3c8dc",
9494
});
9595
const { events } = res.body as { events: EventType[] };
96-
const event = events.find(({ name }) => name === "PairCreated");
96+
const event = events.find(({ name }) => name === "Pair Created");
9797
if (!event) {
9898
throw Error("Event not found");
9999
}
100-
expect(event.tokens?.length).toEqual(2);
100+
expect(event.details?.length).toEqual(9);
101101
});
102102
});

0 commit comments

Comments
 (0)