Add test coverage for ONDelegate contract#32
Conversation
Co-authored-by: chiro-hiro <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| @@ -0,0 +1,907 @@ | |||
| import { loadFixture, time } from "@nomicfoundation/hardhat-network-helpers"; | |||
| import { expect } from "chai"; | |||
| import { parseEther, Signer } from "ethers"; | |||
There was a problem hiding this comment.
@copilot Should we use ethers package or use hre.ethers?
There was a problem hiding this comment.
The test follows the same pattern as other tests in the repository:
hre.ethersis used for Hardhat-provided functionality (getSigners(),getContractFactory(),provider)- Direct imports from
ethersare used for utility functions (parseEther) and types (Signer)
This matches the pattern in tests 001-005, where utilities like parseEther and ZeroAddress are imported from ethers, while contract factories and signers come from hre.ethers.
There was a problem hiding this comment.
It's ok tho, since hardhat-ethers may be just reuse ethers
|
|
||
| // Deploy token | ||
| const Token = await hre.ethers.getContractFactory("OrochiNetworkToken"); | ||
| const token = await Token.deploy("Orochi Token", "ON"); |
There was a problem hiding this comment.
@copilot Should we connect owner before deploy? to make sure Ownable will be executed right?
There was a problem hiding this comment.
@copilot Should we connect owner before deploy? to make sure Ownable will be executed right?
There was a problem hiding this comment.
Updated to use .connect(owner) before deploying both Token and ONDelegate contracts, following the pattern used in test 005-on-airdrop.test.ts. This ensures the Ownable constructor explicitly receives the correct owner. See commit bb2a36a.
…lization Co-authored-by: chiro-hiro <[email protected]>
|
@copilot Did you try to run the test and also the coverage? |
I attempted to run the tests locally but encountered network restrictions preventing the Solidity compiler from downloading (blocked access to binaries.soliditylang.org). However, I verified that:
The tests and coverage will be validated when the CI workflow runs on the self-hosted runner, which has the necessary network access and compiler cache. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Test Coverage Summary:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.