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

Added TestWithExecutor contract to GovHelpers #29

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

eboadom
Copy link
Contributor

@eboadom eboadom commented Jan 19, 2023

It is pretty common use case across other projects to have some payload execution infra for tests, so seems appropriate to add it here

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2023

Foundry report

forge 0.2.0 (23c41b1 2023-01-19T00:08:45.857013991Z)
Build log
installing solc version "0.8.17"
Successfully installed solc 0.8.17
Compiling 46 files with 0.8.17
Solc 0.8.17 finished in 7.97s
Compiler run successful (with warnings)
warning[2018]: Warning: Function state mutability can be restricted to view
 --> src/ProxyHelpers.sol:7:3:
  |
7 |   function getInitializableAdminUpgradeabilityProxyAdmin(Vm vm, address proxy)
  |   ^ (Relevant source part starts here and spans across multiple lines).



warning[2018]: Warning: Function state mutability can be restricted to view
  --> src/ProxyHelpers.sol:19:3:
   |
19 |   function getInitializableAdminUpgradeabilityProxyImplementation(Vm vm, address proxy)
   |   ^ (Relevant source part starts here and spans across multiple lines).



| Contract                 | Size (kB) | Margin (kB) |
|--------------------------|-----------|-------------|
| AaveGovernanceV2         | 0.236     | 24.34       |
| AaveV3Polygon            | 0.086     | 24.49       |
| AaveV3PolygonMockListing | 1.976     | 22.6        |
| Address                  | 0.086     | 24.49       |
| BridgeExecutorHelpers    | 0.086     | 24.49       |
| ConfiguratorInputTypes   | 0.086     | 24.49       |
| DataTypes                | 0.086     | 24.49       |
| GenericV3ListingEngine   | 10.088    | 14.488      |
| GovHelpers               | 0.236     | 24.34       |
| MockExecutor             | 0.437     | 24.139      |
| ProxyHelpers             | 0.086     | 24.49       |
| console                  | 0.086     | 24.49       |
| console2                 | 0.086     | 24.49       |
| stdError                 | 0.591     | 23.985      |
| stdJson                  | 0.086     | 24.49       |
| stdMath                  | 0.086     | 24.49       |
| stdStorage               | 0.086     | 24.49       |
| stdStorageSafe           | 0.086     | 24.49       |
Test error :finnadie:
No files changed, compilation skipped
2023-01-19T08:47:43.793649Z ERROR sharedbackend: Failed to send/recv `basic` err=GetAccount(0x5615deb798bb3e4dfa0139dfa1b3d433cc23b72f, 
(code: -32000, message: missing trie node bdad16df1ad0cdce23b4e9d1e798baf5b88df554eeafe13a6bc05e64433b6631 (path ), data: None)) address=0x5615deb798bb3e4dfa0139dfa1b3d433cc23b72f
2023-01-19T08:47:43.853511Z ERROR sharedbackend: Failed to send/recv `basic` err=GetAccount(0x5615deb798bb3e4dfa0139dfa1b3d433cc23b72f, 
(code: -32000, message: missing trie node bdad16df1ad0cdce23b4e9d1e798baf5b88df554eeafe13a6bc05e64433b6631 (path ), data: None)) address=0x5615deb798bb3e4dfa0139dfa1b3d433cc23b72f

Running 1 test for src/test/GenericV3ListingEngineTest.t.sol:GenericV3ListingEngineTest
[FAIL. Reason: EvmError: FatalExternalError] testEngine() (gas: 9223372036854754743)
Test result: FAILED. 0 passed; 1 failed; finished in 1.38s

Running 2 tests for src/test/ProxyHelpers.t.sol:ProxyHelpersTest
[PASS] testAdmin() (gas: 3229)
[PASS] testImplementation() (gas: 3196)
Test result: ok. 2 passed; 0 failed; finished in 627.44ms
2023-01-19T08:47:48.655354Z ERROR sharedbackend: Failed to send/recv `basic` err=GetAccount(0x8f3cf7ad23cd3cadbd9735aff958023239c6a063, 
(code: -32000, message: missing trie node 4954976ae698e1a4738674ab4edc290148fbe5b4d5b46b4b73e818c783037dc7 (path ), data: None)) address=0x8f3cf7ad23cd3cadbd9735aff958023239c6a063
2023-01-19T08:47:48.655463Z ERROR sharedbackend: Failed to send/recv `basic` err=GetAccount(0x8f3cf7ad23cd3cadbd9735aff958023239c6a063, 
(code: -32000, message: missing trie node 4954976ae698e1a4738674ab4edc290148fbe5b4d5b46b4b73e818c783037dc7 (path ), data: None)) address=0x8f3cf7ad23cd3cadbd9735aff958023239c6a063

Running 2 tests for src/test/ProtocolV3Helper.t.sol:ProxyHelpersTest
[FAIL. Reason: EvmError: FatalExternalError] testE2E() (gas: 9223372036854754743)
[FAIL. Reason: EvmError: FatalExternalError] testSnpashot() (gas: 9223372036854754743)
Test result: FAILED. 0 passed; 2 failed; finished in 6.18s

Failing tests:
Encountered 1 failing test in src/test/GenericV3ListingEngineTest.t.sol:GenericV3ListingEngineTest
[FAIL. Reason: EvmError: FatalExternalError] testEngine() (gas: 9223372036854754743)

Encountered 2 failing tests in src/test/ProtocolV3Helper.t.sol:ProxyHelpersTest
[FAIL. Reason: EvmError: FatalExternalError] testE2E() (gas: 9223372036854754743)
[FAIL. Reason: EvmError: FatalExternalError] testSnpashot() (gas: 9223372036854754743)

Encountered a total of 3 failing tests, 2 tests succeeded

src/GovHelpers.sol Outdated Show resolved Hide resolved
abstract contract TestWithExecutor is Test {
MockExecutor internal _executor;

function _setUp(address executor) internal {
Copy link
Collaborator

Choose a reason for hiding this comment

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

_setUp seems a little to generic for being in the library - i fear this will create name clashes.
Perhaps better _deployMockExecutor or sth along these lines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_selectPayloadExecutor()? To follow "select" wording of foundry

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay

eboadom and others added 2 commits January 19, 2023 09:47
Co-authored-by: Lukas <lukasstrassel@googlemail.com>
@eboadom eboadom merged commit 3239fa7 into master Jan 19, 2023
sakulstra added a commit that referenced this pull request Jan 19, 2023
@sakulstra sakulstra deleted the feat/gov-execution-util branch July 23, 2024 09:24
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