Add missing test cases for dispatch coverage #437
Merged
Merged
Conversation
Collaborator
|
Please resolve conflicts |
basic.json never invoked add3, so the nested (uint256,(uint256,uint256)) SigString recursion past depth 1 was untested at runtime. Add an add3 call. Also add an id_bytes32 method + test so the bytes32:SigString and bytes32:ABIEncode/ABIDecode instances are actually exercised end-to-end. Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
No existing fixture returns a tuple from a contract method, so the (a,b):ABIEncode / (a,b):ABIAttribs paths through do_exec are specialized but never observed end-to-end. tupleret returns (uint256, uint256) so the rets-side encoding is exercised. Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
do_exec in std/dispatch.solc only checks head size for incoming calldata; the inline TODO acknowledges that dynamic types are not validated. dyntail exercises the boundary: valid head pointer / length but the dynamic tail is missing from calldata. Today the dispatcher does not revert and abi_decode reads zeros for the missing bytes; the fixture pins that behaviour so a future tail-size check will flag it. Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
The existing 'selector too short' case sends two bytes ('c0de'), so the
cdsz < 4 branch in Contract.exec is hit but the zero-byte shape -- the
one a plain ETH transfer produces -- is never exercised. Add the empty
calldata case to basic so it is pinned alongside the short-selector
case.
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Contributor
Author
|
@mbenke done |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.