Feature or Improvement Description
Remove the hardhatExec functionality from the testUtils file and replace it with hardcoded bytecode deployment using setCode on the Anvil instance. Add K1_VALIDATOR_FACTORY_BYTECODE, K1_VALIDATOR_BYTECODE, and NEXUS_IMPLEMENTATION_BYTECODE to callData.ts.
Benefits & Outcomes
- Enable our code to be included in viem's repository for testing purposes
- Simplify the testing setup by removing the dependency on hardhat execution
- Improve test reliability by using consistent, hardcoded bytecode
- Reduce external dependencies in the testing process
- Speed up test execution by eliminating the need for hardhat compilation and deployment
Implementation Ideas
-
Remove hardhatExec imports and related functions from testUtils.ts
-
Add new constants to callData.ts:
export const K1_VALIDATOR_FACTORY_BYTECODE: Hex = "0x..."
export const K1_VALIDATOR_BYTECODE: Hex = "0x..."
export const NEXUS_IMPLEMENTATION_BYTECODE: Hex = "0x..."
(Fetch these bytecodes from the Base Sepolia explorer)
-
Update the initDeployments function in testUtils.ts:
- Remove calls to hardhatExec.init() and hardhatExec.deploy()
- Implement
setCode calls using the new bytecode constants:
await testClient.setCode({
address: K1_VALIDATOR_FACTORY_ADDRESS,
bytecode: K1_VALIDATOR_FACTORY_BYTECODE
})
// Repeat for K1_VALIDATOR and NEXUS_IMPLEMENTATION
-
Update any other functions in testUtils.ts that relied on hardhatExec
-
Modify the toConfiguredAnvil function to remove any hardhat-specific configurations
-
Update unit tests to reflect the new deployment method
-
Verify that all tests pass with the new bytecode deployment method
-
Update documentation to reflect the changes in the testing setup
-
Remove any remaining hardhat dependencies that are no longer needed
References
Any References?
No response
Code of Conduct
Feature or Improvement Description
Remove the hardhatExec functionality from the testUtils file and replace it with hardcoded bytecode deployment using
setCodeon the Anvil instance. Add K1_VALIDATOR_FACTORY_BYTECODE, K1_VALIDATOR_BYTECODE, and NEXUS_IMPLEMENTATION_BYTECODE to callData.ts.Benefits & Outcomes
Implementation Ideas
Remove hardhatExec imports and related functions from testUtils.ts
Add new constants to callData.ts:
(Fetch these bytecodes from the Base Sepolia explorer)
Update the
initDeploymentsfunction in testUtils.ts:setCodecalls using the new bytecode constants:Update any other functions in testUtils.ts that relied on hardhatExec
Modify the
toConfiguredAnvilfunction to remove any hardhat-specific configurationsUpdate unit tests to reflect the new deployment method
Verify that all tests pass with the new bytecode deployment method
Update documentation to reflect the changes in the testing setup
Remove any remaining hardhat dependencies that are no longer needed
References
Any References?
No response
Code of Conduct