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

External tests for sushiswap/trident #12197

Merged
merged 3 commits into from
Jan 10, 2022
Merged

External tests for sushiswap/trident #12197

merged 3 commits into from
Jan 10, 2022

Conversation

cameel
Copy link
Member

@cameel cameel commented Oct 27, 2021

This adds an external test run for trident.

Unfortunately there is a problem: it uses mixed Solidity versions. contracts/flat/BentoBoxV1Flat.sol wants 0.6.12 and requires some minor changes to compile on 0.8.9 (some conversions and constructor visibility. We need a workaround for that or an upstream PR to make the contracts compatible with both versions.

@cameel cameel requested review from axic, chriseth and hrkrshnn October 27, 2021 10:28
@cameel cameel self-assigned this Oct 27, 2021
@cameel cameel force-pushed the update-gnosis-ext-test branch from 555ea65 to d2c01aa Compare October 27, 2021 15:01
@cameel
Copy link
Member Author

cameel commented Oct 27, 2021

  • Switched this to a fork with fixed conversions: solidity-external-tests/trident, branch master_080. If this works I will submit it as a PR to sushiswap.
  • Had to add workaround for other 0.6.12 contracts present in node_modules/. Fortunately they seem unsued.
  • Now I can run tests but many fail with ProviderError: Must be authenticated!. I think I need to find a way to run only the subset that does not require an external node.

@cameel cameel force-pushed the update-gnosis-ext-test branch 2 times, most recently from 6b41eae to 9f695dc Compare November 4, 2021 17:37
@cameel cameel force-pushed the update-gnosis-ext-test branch from 9f695dc to 217b998 Compare November 5, 2021 16:41
@cameel cameel force-pushed the update-gnosis-ext-test branch from 217b998 to e4037d8 Compare November 5, 2021 17:07
@cameel cameel force-pushed the update-gnosis-ext-test branch from e4037d8 to 6e03d91 Compare November 5, 2021 18:13
@cameel cameel force-pushed the update-gnosis-ext-test branch from 6e03d91 to a04ef39 Compare November 9, 2021 16:17
@cameel cameel force-pushed the trident-ext-test branch 2 times, most recently from d1d65c1 to ab154bc Compare November 25, 2021 19:06
@cameel
Copy link
Member Author

cameel commented Nov 25, 2021

This now works, though not without workarounds:

@cameel cameel changed the base branch from update-gnosis-ext-test to hardhat-in-oz-ext-test November 29, 2021 12:24
@cameel
Copy link
Member Author

cameel commented Nov 29, 2021

Since #12195 has the unresolved issue with Hardhat tests failing due to the changes in the extcodesize check, I swapped it with this PR so that it can go in first. Now this one is directly on top of #12192 and #12195 is on top of this PR.

Base automatically changed from hardhat-in-oz-ext-test to develop November 30, 2021 15:17
@cameel
Copy link
Member Author

cameel commented Dec 9, 2021

I got no feedback in sushiswap/trident#282 so far so it looks like it might not get merged in the near future. I adjusted the test script to solve the problem by patching upstream repo. This way we can track project's master branch and not rely on our fork that needs to be manually updated.

@cameel cameel marked this pull request as draft December 13, 2021 12:28
@cameel cameel force-pushed the trident-ext-test branch 5 times, most recently from 96be215 to 6607e8f Compare December 20, 2021 21:01
@cameel cameel marked this pull request as ready for review December 20, 2021 21:01
@cameel cameel force-pushed the trident-ext-test branch 5 times, most recently from 8091c66 to 3d5bcfd Compare December 22, 2021 20:08
hrkrshnn
hrkrshnn previously approved these changes Jan 3, 2022
Comment on lines +81 to +85
sed -i 's|uint128(-1)|type(uint128).max|g' contracts/flat/BentoBoxV1Flat.sol
sed -i 's|uint64(-1)|type(uint64).max|g' contracts/flat/BentoBoxV1Flat.sol
sed -i 's|uint32(-1)|type(uint32).max|g' contracts/flat/BentoBoxV1Flat.sol
sed -i 's|IERC20(0)|IERC20(address(0))|g' contracts/flat/BentoBoxV1Flat.sol
sed -i 's|IStrategy(0)|IStrategy(address(0))|g' contracts/flat/BentoBoxV1Flat.sol
Copy link
Member

Choose a reason for hiding this comment

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

Oh wow!

Copy link
Member

Choose a reason for hiding this comment

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

Mudit said bentobox is a legacy deployed contract, and they probably won't change it in the repo.

I just checked that there are no contract dependencies for Bento. So the project will still compile without this file, however, it's needed for tests. Fine with the sed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, unfortunately we really do want to run tests, not just compile. Especially now that #12441 requires a full test run to gather gas usage for the benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants