Skip to content

fix: cross module assert#154

Merged
andrii-a8c merged 6 commits intomainfrom
missing-assert
Dec 10, 2025
Merged

fix: cross module assert#154
andrii-a8c merged 6 commits intomainfrom
missing-assert

Conversation

@d3mage
Copy link
Copy Markdown
Contributor

@d3mage d3mage commented Aug 18, 2025

Fixes #147


Note

Adds tests verifying cross-module asserts succeed in targeted specs and that asserts in scenario specs produce the expected error.

  • Tests:
    • Cross-module assert (success): Add tests/inputs/assert.ok.move targeting 0x42::foo::foo from 0x43::bar::foo_spec; snapshot snapshots/assert.ok.move.snap expects "Verification successful".
    • Scenario spec (failure): Add tests/inputs/assert.scenario.fail.move with scenario_spec using asserts; snapshot snapshots/assert.scenario.fail.move.snap expects bytecode transformation error about scenario specs and asserts.

Written by Cursor Bugbot for commit b5c8fb2. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings August 18, 2025 13:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue with cross-module assert handling in the Move prover by ensuring assert functions are properly processed when called from different modules.

  • Adds a new condition to handle asserts calls in Default translation style
  • Updates test case to verify cross-module assert functionality works correctly
  • Includes a minor formatting adjustment to improve code readability

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/sui-prover/tests/inputs/assert.ok.move Adds test case demonstrating cross-module assert usage with prover spec
crates/sui-prover/tests/snapshots/assert.ok.move.snap Expected test output snapshot showing successful verification
crates/move-prover-boogie-backend/src/boogie_backend/bytecode_translator.rs Fixes assert processing logic and minor formatting cleanup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread crates/move-prover-boogie-backend/src/boogie_backend/bytecode_translator.rs Outdated
Comment thread crates/sui-prover/tests/inputs/assert.ok.move
Comment thread crates/move-prover-boogie-backend/src/boogie_backend/bytecode_translator.rs Outdated
@andreistefanescu
Copy link
Copy Markdown
Contributor

@d3mage let's update this to include #351, which throws an error is there are asserts in a scenario spec

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread crates/move-prover-boogie-backend/src/boogie_backend/bytecode_translator.rs Outdated
@andreistefanescu
Copy link
Copy Markdown
Contributor

@andrii-a8c I think we can revert the code change, just keep the tests

Copy link
Copy Markdown
Contributor

@andreistefanescu andreistefanescu left a comment

Choose a reason for hiding this comment

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

👍

@andrii-a8c andrii-a8c merged commit 9bc34b5 into main Dec 10, 2025
10 of 11 checks passed
@andrii-a8c andrii-a8c deleted the missing-assert branch December 10, 2025 17:53
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.

Internal Error When Spec Lacks Target Attribute and Contains Asserts

5 participants