-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated the instance tests to support fuzzing of new integrations #1114
Updated the instance tests to support fuzzing of new integrations #1114
Conversation
Pull Request Test Coverage Report for Build 10115614749Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together! Everything here looks relatively straightforward to use
Hyperdrive Gas Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
@@ -80,14 +80,14 @@ contract AaveHyperdriveTest is InstanceTest { | |||
|
|||
/// @dev Gets the extra data used to deploy Hyperdrive instances. | |||
/// @return The extra data. | |||
function getExtraData() internal pure override returns (bytes memory) { | |||
function getExtraData() public pure override returns (bytes memory) { | |||
return new bytes(0); | |||
} | |||
|
|||
/// @dev Converts base amount to the equivalent about in shares. | |||
function convertToShares( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this reimplemented rather than calling the public method on the hyperdrive instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. That method isn’t available before deployHyperdrive is called, and this is used within deployHyperdrive. We might be able to find a workaround in the future, but for now, we need this.
test/utils/HyperdriveTest.sol
Outdated
@@ -1,6 +1,8 @@ | |||
// SPDX-License-Identifier: Apache-2.0 | |||
pragma solidity 0.8.20; | |||
|
|||
import { console2 as console } from "forge-std/console2.sol"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -110,12 +110,12 @@ contract AaveHyperdriveTest is InstanceTest { | |||
/// @param _factory The address of the Hyperdrive factory. | |||
function deployCoordinator( | |||
address _factory | |||
) internal override returns (address) { | |||
) public override returns (address) { | |||
vm.startPrank(alice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to be having trouble calling this contract's functions. My best guess is that I'm not using the alice
account correctly from this function. Any chance we can either (1) expose the private key of alice
, or (2) allow the account as an argument?
@@ -110,12 +110,12 @@ contract AaveHyperdriveTest is InstanceTest { | |||
/// @param _factory The address of the Hyperdrive factory. | |||
function deployCoordinator( | |||
address _factory | |||
) internal override returns (address) { | |||
) public override returns (address) { | |||
vm.startPrank(alice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm attempting to deploy this contract, then call this function to deploy the coordinator, but getting execution reverted on this line. Are cheatcodes supported when the contract is deployed?
Closing this since we found that this wasn't a viable path to fuzzing the instances. |
Resolved Issues
Partially resolves: #1108.
Description
This PR makes several functions in the
InstanceTest
harness public. This makes it possible to leverage this functionality on a mainnet fork to run fuzz tests against new integrations. This is the PR that should bring this system to the MCP (minimum crappy product). Some notable features that are absent are:accrue
function, although that will not be hard to add in a later PR.