forked from NomicFoundation/hardhat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a types module that defines the interface for additional Hardhat fields. Separate out compilation projects for the plugin and its tests.
- Loading branch information
Showing
24 changed files
with
99 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
# Compilation output | ||
/build-test/ | ||
/dist | ||
/plugin | ||
/types | ||
|
||
# Code coverage artifacts | ||
/coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/hardhat-ethers/src/dist/src/ethers-provider-wrapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "../../plugin/ethers-provider-wrapper"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "../../plugin/helpers"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "../../plugin/index"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "../../plugin/provider-proxy"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "../../plugin/signer-with-address"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "../../plugin/type-extensions"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "../../plugin/updatable-target-proxy"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as ethers from "ethers"; | ||
import "hardhat/types/runtime"; | ||
|
||
import type { | ||
FactoryOptions as FactoryOptionsT, | ||
getContractFactory as getContractFactoryT, | ||
HardhatEthers, | ||
Libraries as LibrariesT, | ||
} from "../types"; | ||
|
||
declare module "hardhat/types/runtime" { | ||
// Beware, adding new types to any hardhat type submodule is not a good practice in a Hardhat plugin. | ||
// Doing so increases the risk of a type clash with another plugin. | ||
type Libraries = LibrariesT; | ||
type FactoryOptions = FactoryOptionsT; | ||
// tslint:disable-next-line: naming-convention | ||
type getContractFactory = typeof getContractFactoryT; | ||
|
||
interface HardhatRuntimeEnvironment { | ||
// We omit the ethers field because it is redundant. | ||
ethers: Omit<typeof ethers, "ethers"> & HardhatEthers; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../config/typescript/tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../", | ||
"rootDirs": ["."], | ||
"composite": true | ||
}, | ||
"include": ["./**/*.ts"], | ||
"exclude": [] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type * as ethers from "ethers"; | ||
|
||
import type { SignerWithAddress } from "../plugin/signer-with-address"; | ||
|
||
export interface Libraries { | ||
[libraryName: string]: string; | ||
} | ||
|
||
export interface FactoryOptions { | ||
signer?: ethers.Signer; | ||
libraries?: Libraries; | ||
} | ||
|
||
export declare function getContractFactory( | ||
name: string, | ||
signerOrOptions?: ethers.Signer | FactoryOptions | ||
): Promise<ethers.ContractFactory>; | ||
export declare function getContractFactory( | ||
abi: any[], | ||
bytecode: ethers.utils.BytesLike, | ||
signer?: ethers.Signer | ||
): Promise<ethers.ContractFactory>; | ||
|
||
export interface HardhatEthers { | ||
provider: ethers.providers.JsonRpcProvider; | ||
|
||
getContractFactory: typeof getContractFactory; | ||
getContractAt: ( | ||
nameOrAbi: string | any[], | ||
address: string, | ||
signer?: ethers.Signer | ||
) => Promise<ethers.Contract>; | ||
getSigners: () => Promise<SignerWithAddress[]>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/hardhat-ethers/test/fixture-projects/hardhat-project/hardhat.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require("../../../src/index"); | ||
require("../../../src/plugin/index"); | ||
|
||
module.exports = { | ||
solidity: "0.5.15", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
{ | ||
"extends": "../../config/typescript/tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"outDir": "./build-test", | ||
"rootDirs": ["./test"], | ||
"composite": true | ||
}, | ||
"exclude": ["./dist", "./node_modules", "./test/**/hardhat.config.ts"], | ||
"include": ["./test/**/*.ts"], | ||
"exclude": ["./node_modules", "./test/**/hardhat.config.ts"], | ||
"references": [ | ||
{ | ||
"path": "../hardhat-core/src" | ||
"path": "./src" | ||
} | ||
] | ||
} |