Skip to content
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

list yearn bridge for both deposit/withdraw, as gas differs #225

Merged
merged 6 commits into from
Aug 31, 2022

Conversation

LHerskind
Copy link
Collaborator

@LHerskind LHerskind commented Aug 26, 2022

Description

Update gas constraints in the yearn tests + deployment.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • There are no unexpected formatting changes, or superfluous debug logs.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewers next convenience.
  • NatSpec documentation of all the non-test functions is present and is complete.
  • Continuous integration (CI) passes.
  • Command forge coverage --match-contract MyContract returns 100% line coverage.
  • All the possible reverts are tested.

Copy link
Collaborator

@benesjan benesjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments.

Also please rename _depositAmount to depositAmount on line 112 in YearnBridgeE2E.t.sol. Would like to not modify params if possible.

@@ -49,7 +49,8 @@ abstract contract BaseDeployment is Test {
bool envMode = vm.envBool(modeKey);
MODE = envMode ? Mode.BROADCAST : Mode.SIMULATE;

bytes32 envNetwork = keccak256(abi.encodePacked(vm.envString(networkKey)));
string memory nw = vm.envString(networkKey);
bytes32 envNetwork = keccak256(abi.encodePacked(nw));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think better naming here would be string memory envNetwork and bytes32 envNetworkHash.

deal(underlyingToken, address(_vault), _depositAmount / 2);
}

uint256 _withdrawAmount = outputAssetAMid;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use underscores only for params.

@@ -154,8 +178,20 @@ contract YearnBridgeE2ETest is BridgeTestBase {
assertEq(inputAssetAMid, inputAssetABefore - _depositAmount, "Balance missmatch after deposit");
assertGt(outputAssetAMid, outputAssetABefore, "No change in output asset balance after deposit");

_withdrawAmount = outputAssetAMid;
bridgeCallData = encodeBridgeCallData(id, depositOutputAssetA, emptyAsset, depositInputAssetA, emptyAsset, 1);
// Move some funds to strategies to have underlying balance be less than the required.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand this. Is this supposed to cause revert or something else? Please expand a bit on what this will achieve.

@LHerskind LHerskind merged commit 74b8824 into master Aug 31, 2022
@LHerskind LHerskind deleted the lh/yearn-gas-constraints branch December 8, 2022 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants