-
Notifications
You must be signed in to change notification settings - Fork 4
Add tests to validate return data. #116
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
851495b
Add tests to validate return data.
marian-radu cc4e80c
Add artifacts
pgherveou 9e86b8c
wip
pgherveou afd1abc
Merge branch 'main' into add_tests_for_returndata
marian-radu 177128a
Fix returndata assertions.
marian-radu d69f59c
chore: format code (deno fmt)
marian-radu e8a4463
Enable test:returndata_works for pvm.
marian-radu 4b173b0
Adjust eth_call_deployment_returns_bytecode assertion for pvm.
marian-radu 46183e3
Merge branch 'main' into add_tests_for_returndata
pgherveou eb6813b
rm gen files
pgherveou 58e0590
increase timeout
pgherveou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const ChildAbi = [] as const |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| [ | ||
| { | ||
| "inputs": [], | ||
| "stateMutability": "nonpayable", | ||
| "type": "constructor" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "callStuff", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "uint256", | ||
| "name": "", | ||
| "type": "uint256" | ||
| } | ||
| ], | ||
| "stateMutability": "nonpayable", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "createChildContract", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "uint256", | ||
| "name": "", | ||
| "type": "uint256" | ||
| } | ||
| ], | ||
| "stateMutability": "nonpayable", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "doStuff", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "uint256", | ||
| "name": "", | ||
| "type": "uint256" | ||
| } | ||
| ], | ||
| "stateMutability": "pure", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "getCapturedReturnDataSize", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "uint256", | ||
| "name": "", | ||
| "type": "uint256" | ||
| } | ||
| ], | ||
| "stateMutability": "view", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "otherField", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "uint256", | ||
| "name": "", | ||
| "type": "uint256" | ||
| } | ||
| ], | ||
| "stateMutability": "view", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "returndatasize", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "uint256", | ||
| "name": "", | ||
| "type": "uint256" | ||
| } | ||
| ], | ||
| "stateMutability": "view", | ||
| "type": "function" | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| export const ReturnDataTesterAbi = [ | ||
| { | ||
| 'inputs': [], | ||
| 'stateMutability': 'nonpayable', | ||
| 'type': 'constructor', | ||
| }, | ||
| { | ||
| 'inputs': [], | ||
| 'name': 'callStuff', | ||
| 'outputs': [ | ||
| { | ||
| 'internalType': 'uint256', | ||
| 'name': '', | ||
| 'type': 'uint256', | ||
| }, | ||
| ], | ||
| 'stateMutability': 'nonpayable', | ||
| 'type': 'function', | ||
| }, | ||
| { | ||
| 'inputs': [], | ||
| 'name': 'createChildContract', | ||
| 'outputs': [ | ||
| { | ||
| 'internalType': 'uint256', | ||
| 'name': '', | ||
| 'type': 'uint256', | ||
| }, | ||
| ], | ||
| 'stateMutability': 'nonpayable', | ||
| 'type': 'function', | ||
| }, | ||
| { | ||
| 'inputs': [], | ||
| 'name': 'doStuff', | ||
| 'outputs': [ | ||
| { | ||
| 'internalType': 'uint256', | ||
| 'name': '', | ||
| 'type': 'uint256', | ||
| }, | ||
| ], | ||
| 'stateMutability': 'pure', | ||
| 'type': 'function', | ||
| }, | ||
| { | ||
| 'inputs': [], | ||
| 'name': 'getCapturedReturnDataSize', | ||
| 'outputs': [ | ||
| { | ||
| 'internalType': 'uint256', | ||
| 'name': '', | ||
| 'type': 'uint256', | ||
| }, | ||
| ], | ||
| 'stateMutability': 'view', | ||
| 'type': 'function', | ||
| }, | ||
| { | ||
| 'inputs': [], | ||
| 'name': 'otherField', | ||
| 'outputs': [ | ||
| { | ||
| 'internalType': 'uint256', | ||
| 'name': '', | ||
| 'type': 'uint256', | ||
| }, | ||
| ], | ||
| 'stateMutability': 'view', | ||
| 'type': 'function', | ||
| }, | ||
| { | ||
| 'inputs': [], | ||
| 'name': 'returndatasize', | ||
| 'outputs': [ | ||
| { | ||
| 'internalType': 'uint256', | ||
| 'name': '', | ||
| 'type': 'uint256', | ||
| }, | ||
| ], | ||
| 'stateMutability': 'view', | ||
| 'type': 'function', | ||
| }, | ||
| ] as const |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| // Child contract with dummy state passed through constructor | ||
| contract Child { | ||
| } | ||
|
|
||
| // Parent contract that creates a child and captures return data | ||
| contract ReturnDataTester { | ||
| uint public returndatasize; | ||
|
|
||
| function createChildContract() external { | ||
| new Child(); | ||
| uint size; | ||
| assembly { | ||
| size := returndatasize() | ||
| } | ||
| returndatasize = size; | ||
| } | ||
|
|
||
| // Read-only function to return the captured return data size | ||
| function getCapturedReturnDataSize() external view returns (uint) { | ||
| return returndatasize; | ||
| } | ||
| } |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.