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

[Bug]aptos-transactional-test-harness doesn't run extended_checks when compiling examples #13297

Closed
brmataptos opened this issue May 16, 2024 · 2 comments · Fixed by #13337
Closed
Assignees
Labels
bug Something isn't working compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale

Comments

@brmataptos
Copy link
Contributor

🐛 Bug

My first attempt to add a simple test that seems to violate a check in extended_checks suggests that extended checks are not being run in aptos-transactional-test-harness compilation, for either V1 or V2:

The following script successfully publishes, although extended checks should reject the &mut signer parameter (at line 215 and 518):

//# init --addresses Alice=0xf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
//#      --private-keys Alice=56a26140eb233750cd14fb168c3eb4bd0782b099cde626ec8aff7f3cceb6364f

//# publish --private-key Alice
module Alice::M {
    #[view]
    fun view(_:&mut signer,value: u64): u64 { value }
}

I added this as aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/bad_parameter.move but it also passes if placed in v2-tests

These tests should be added and made to fail as expected by fixing the test harness code.

@brmataptos brmataptos added bug Something isn't working compiler-v2 labels May 16, 2024
@brmataptos brmataptos self-assigned this May 16, 2024
@rahxephon89
Copy link
Contributor

I think the reason is that aptos-transactional-test-harness relies on the transactional-test framework in third_party, which is not aware of extended_check. cc @brmataptos @wrwg

@brmataptos
Copy link
Contributor Author

Yeah, it needs some plumbing. I'm looking into it now. I just learned that Rust traits don't seem to allow calling a default implementation from a specialized implementation. So some renaming is needed to provide an augmented compile function in the aptos case.

@sausagee sausagee added the stale-exempt Prevents issues from being automatically marked and closed as stale label May 20, 2024
brmataptos added a commit that referenced this issue May 21, 2024
Run extended_checks as part of the aptos-transactional-test-harness.  Fixes #13297.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants