Skip to content

Add missing test cases for dispatch coverage #437

Merged
mbenke merged 4 commits into
argotorg:mainfrom
axic:dispatch-tests
Jun 9, 2026
Merged

Add missing test cases for dispatch coverage #437
mbenke merged 4 commits into
argotorg:mainfrom
axic:dispatch-tests

Conversation

@axic

@axic axic commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@axic axic force-pushed the dispatch-tests branch from dffccef to d081e05 Compare June 7, 2026 12:10
@mbenke

mbenke commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Please resolve conflicts

@axic axic force-pushed the dispatch-tests branch from d081e05 to d427c67 Compare June 8, 2026 15:48
claude and others added 4 commits June 8, 2026 17:50
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>
@axic axic force-pushed the dispatch-tests branch from d427c67 to 9a9049e Compare June 8, 2026 15:51
@axic

axic commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@mbenke done

@mbenke mbenke merged commit 8bbf37e into argotorg:main Jun 9, 2026
4 checks passed
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.

3 participants