Skip to content

Commit 1a4391a

Browse files
committed
Revert client to old implementation
1 parent 51028e1 commit 1a4391a

File tree

2 files changed

+8
-27
lines changed

2 files changed

+8
-27
lines changed

packages/sdk/src/clients/multicall/client.e2e.ts

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,18 @@ import { ethers } from "ethers";
55
import { emp } from "..";
66

77
// multicall contract deployed to mainnet
8-
const multicallV1Address = "0xeefba1e63905ef1d7acba5a8513c70307c1ce441";
9-
const multicallV2Address = "0x5ba1e12693dc8f9c48aad8770482f4739beed696";
8+
const address = "0xeefba1e63905ef1d7acba5a8513c70307c1ce441";
109
const empAddress = "0xd81028a6fbAAaf604316F330b20D24bFbFd14478";
1110
// these require integration testing, skip for ci
1211
describe("multicall", function () {
13-
let clientV1: Client.Instance;
14-
let clientV2: Client.Instance;
12+
let client: Client.Instance;
1513
let empClient: emp.Instance;
14+
1615
test("inits", function () {
1716
const provider = ethers.providers.getDefaultProvider(process.env.CUSTOM_NODE_URL);
18-
clientV1 = Client.connect(multicallV1Address, provider);
19-
clientV2 = Client.connect(multicallV2Address, provider);
17+
client = Client.connect(address, provider);
2018
empClient = emp.connect(empAddress, provider);
21-
assert.ok(clientV1);
22-
assert.ok(clientV2);
19+
assert.ok(client);
2320
assert.ok(empClient);
2421
});
2522

@@ -31,27 +28,11 @@ describe("multicall", function () {
3128
callData: empClient.interface.encodeFunctionData(call),
3229
};
3330
});
34-
const response = await clientV1.callStatic.aggregate(multicalls);
31+
const response = await client.callStatic.aggregate(multicalls);
3532
const decoded = calls.map((call: any, i: number) => {
3633
const result = response.returnData[i];
3734
return empClient.interface.decodeFunctionResult(call, result);
3835
});
3936
assert.equal(decoded.length, calls.length);
4037
});
41-
42-
test("multicall2 on emp", async function () {
43-
const calls = ["priceIdentifier", "tokenCurrency", "collateralCurrency"];
44-
const multicalls = calls.map((call: any) => {
45-
return {
46-
target: empAddress,
47-
callData: empClient.interface.encodeFunctionData(call),
48-
};
49-
});
50-
const response = await clientV2.callStatic.tryBlockAndAggregate(false, multicalls);
51-
const decoded = calls.map((call: any, i: number) => {
52-
const result = response.returnData[i];
53-
return empClient.interface.decodeFunctionResult(call, result[1]);
54-
});
55-
assert.equal(decoded.length, calls.length);
56-
});
5738
});

packages/sdk/src/clients/multicall/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { EthersContracts } from "@uma/core";
22
import type { SignerOrProvider } from "../..";
33

4-
export type Instance = EthersContracts.Multicall2;
5-
const Factory = EthersContracts.Multicall2__factory;
4+
export type Instance = EthersContracts.Multicall;
5+
const Factory = EthersContracts.Multicall__factory;
66

77
export function connect(address: string, provider: SignerOrProvider): Instance {
88
return Factory.connect(address, provider);

0 commit comments

Comments
 (0)