@@ -5,21 +5,18 @@ import { ethers } from "ethers";
5
5
import { emp } from ".." ;
6
6
7
7
// multicall contract deployed to mainnet
8
- const multicallV1Address = "0xeefba1e63905ef1d7acba5a8513c70307c1ce441" ;
9
- const multicallV2Address = "0x5ba1e12693dc8f9c48aad8770482f4739beed696" ;
8
+ const address = "0xeefba1e63905ef1d7acba5a8513c70307c1ce441" ;
10
9
const empAddress = "0xd81028a6fbAAaf604316F330b20D24bFbFd14478" ;
11
10
// these require integration testing, skip for ci
12
11
describe ( "multicall" , function ( ) {
13
- let clientV1 : Client . Instance ;
14
- let clientV2 : Client . Instance ;
12
+ let client : Client . Instance ;
15
13
let empClient : emp . Instance ;
14
+
16
15
test ( "inits" , function ( ) {
17
16
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 ) ;
20
18
empClient = emp . connect ( empAddress , provider ) ;
21
- assert . ok ( clientV1 ) ;
22
- assert . ok ( clientV2 ) ;
19
+ assert . ok ( client ) ;
23
20
assert . ok ( empClient ) ;
24
21
} ) ;
25
22
@@ -31,27 +28,11 @@ describe("multicall", function () {
31
28
callData : empClient . interface . encodeFunctionData ( call ) ,
32
29
} ;
33
30
} ) ;
34
- const response = await clientV1 . callStatic . aggregate ( multicalls ) ;
31
+ const response = await client . callStatic . aggregate ( multicalls ) ;
35
32
const decoded = calls . map ( ( call : any , i : number ) => {
36
33
const result = response . returnData [ i ] ;
37
34
return empClient . interface . decodeFunctionResult ( call , result ) ;
38
35
} ) ;
39
36
assert . equal ( decoded . length , calls . length ) ;
40
37
} ) ;
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
- } ) ;
57
38
} ) ;
0 commit comments