Skip to content

Commit f2709dd

Browse files
committed
Merge branch 'uni_v2_remaining_events' into uni_v3
2 parents bce55c7 + 2195c83 commit f2709dd

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.env.example

-2
This file was deleted.

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,
@@ -489,6 +501,11 @@ GoldRushDecoder.on(
489501
value: data?.items?.[0]?.token_1?.contract_address || "",
490502
type: "address",
491503
},
504+
{
505+
heading: "Pair Address",
506+
value: decoded.pair,
507+
type: "address",
508+
},
492509
],
493510
};
494511
}

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)