[NEVER MERGE] Update the plugin for the tutorial#2
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR transforms the Hardhat plugin from a simple greeting system to an account management plugin. The plugin now provides functionality to access specific accounts from the available accounts list based on a configurable index.
- Replaces the greeting configuration with network-level account index configuration
- Updates tasks to print account information instead of greetings
- Implements network hooks to populate account information on connections
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin/test/example-tests.ts | Comments out all existing tests |
| packages/plugin/test/config.ts | Comments out all existing configuration tests |
| packages/plugin/src/types.ts | Removes greeting-related type definitions |
| packages/plugin/src/type-extensions.ts | Replaces greeting config with account index config for network types |
| packages/plugin/src/tasks/my-task.ts | Removes greeting task implementation |
| packages/plugin/src/tasks/my-account.ts | Adds new task to display account information |
| packages/plugin/src/index.ts | Updates task registration from greeting to account display |
| packages/plugin/src/hooks/network.ts | Implements account selection logic in network connection hook |
| packages/plugin/src/config.ts | Replaces greeting validation/resolution with account index logic |
| packages/example-project/hardhat.config.ts | Updates config to use account index instead of greeting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/plugin/src/hooks/network.ts
Outdated
| return next(context, networkConnection, jsonRpcRequest); | ||
| if (accounts.length <= myAccountIndex) { | ||
| throw new HardhatPluginError( | ||
| `hardhat-plugin-template`, // TODO: This is duplicated |
There was a problem hiding this comment.
The plugin name 'hardhat-plugin-template' is hardcoded and duplicated. Consider extracting this to a constant or importing from package.json to maintain consistency across the codebase.
5c891f3 to
827b182
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
16e1bd3 to
7842760
Compare
I think the plugin is mostly ready for the tutorial, except for its readme.
NOTE: THIS PR SHOULD NEVER BE MERGED, ONLY HERE FOR REVIEWS