@@ -32,16 +32,17 @@ export async function initializeEthers(
32
32
33
33
provider,
34
34
35
- getSigner : ( address : string ) => hardhatHelpers . getSigner ( address ) ,
36
- getSigners : ( ) => hardhatHelpers . getSigners ( ) ,
37
- getImpersonatedSigner : ( address : string ) =>
38
- hardhatHelpers . getImpersonatedSigner ( address ) ,
35
+ // The bind is necessary because otherwise in the function the "this" that refers to the HardhatHelpers class will be overwritten
36
+ getSigner : hardhatHelpers . getSigner . bind ( hardhatHelpers ) ,
37
+ getSigners : hardhatHelpers . getSigners . bind ( hardhatHelpers ) ,
38
+ getImpersonatedSigner :
39
+ hardhatHelpers . getImpersonatedSigner . bind ( hardhatHelpers ) ,
39
40
getContractFactory : hardhatHelpers . getContractFactory . bind ( hardhatHelpers ) ,
40
- getContractFactoryFromArtifact : ( ... args ) =>
41
- hardhatHelpers . getContractFactoryFromArtifact ( ... args ) ,
42
- getContractAt : ( ... args ) => hardhatHelpers . getContractAt ( ... args ) ,
43
- getContractAtFromArtifact : ( ... args ) =>
44
- hardhatHelpers . getContractAtFromArtifact ( ... args ) ,
41
+ getContractFactoryFromArtifact :
42
+ hardhatHelpers . getContractFactoryFromArtifact . bind ( hardhatHelpers ) ,
43
+ getContractAt : hardhatHelpers . getContractAt . bind ( hardhatHelpers ) ,
44
+ getContractAtFromArtifact :
45
+ hardhatHelpers . getContractAtFromArtifact . bind ( hardhatHelpers ) ,
45
46
deployContract : hardhatHelpers . deployContract . bind ( hardhatHelpers ) ,
46
47
} ;
47
48
}
0 commit comments