-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🗞️ Bits and pieces of types and configuration for localnet [3/N] (#474)
- Loading branch information
1 parent
c4f19c6
commit 6d2e1f8
Showing
5 changed files
with
110 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@layerzerolabs/devtools-evm-hardhat": patch | ||
"@layerzerolabs/devtools-evm": patch | ||
"@layerzerolabs/devtools": patch | ||
--- | ||
|
||
Add types for simulation |
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,63 @@ | ||
import { AnvilOptions } from '@layerzerolabs/devtools-evm' | ||
|
||
export interface SimulationUserConfig { | ||
/** | ||
* Simulation works by creating local forks of networks specified | ||
* in hardhat config. These networks are containerized and not accessible | ||
* from the developer machine - instead, a simple proxy server | ||
* listening on this port proxies requests to the individual networks. | ||
* | ||
* For example, a hardhat configuration with networks `fuji` and `mainnet` | ||
* will result in two forks being created. These networks will then be accessible | ||
* on `http://localhost:<port>/fuji` and `http://localhost:<port>/mainnet` | ||
* | ||
* @default 8545 | ||
*/ | ||
port?: number | ||
|
||
/** | ||
* Simulation task stores its artifacts on the local filesystem. | ||
* | ||
* To customize the path, set this property to a relative or absolute path | ||
* (relative path will be resolved against the root path of your hardhat project) | ||
* | ||
* @default .layerzero | ||
*/ | ||
directory?: string | ||
|
||
/** | ||
* Anvil overrides for the underlying EVM nodes. | ||
*/ | ||
anvil?: SimulationAnvilUserConfig | ||
} | ||
|
||
/** | ||
* Resolved simulation config | ||
*/ | ||
export interface SimulationConfig { | ||
port: number | ||
directory: string | ||
anvil: SimulationAnvilConfig | ||
} | ||
|
||
/** | ||
* Resolved simulation config for anvil. | ||
* | ||
* This config is created by taking the user config | ||
* and applying defaults. | ||
*/ | ||
export type SimulationAnvilConfig = AnvilOptions & { | ||
mnemonic: NonNullable<AnvilOptions['mnemonic']> | ||
} | ||
|
||
/** | ||
* User facing simulation config for anvil. | ||
* | ||
* This config cannot override several system attributes for anvil | ||
* (since it would not really make sense seeing that anvil is being run in containers): | ||
* | ||
* - host & port: this would break the docker port bindings | ||
* - state: state is kept within the container and is not accessible from the outside | ||
* - forkUrl: this is set based on the hardhat config and points to the hardhat network url | ||
*/ | ||
export type SimulationAnvilUserConfig = Omit<AnvilOptions, 'host' | 'port' | 'state' | 'forkUrl'> |
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