Skip to content

Replace custom Asserting function with built-in asserting keyword#421

Open
jcp19 wants to merge 1 commit into
masterfrom
claude/gifted-shannon-fbqrr0
Open

Replace custom Asserting function with built-in asserting keyword#421
jcp19 wants to merge 1 commit into
masterfrom
claude/gifted-shannon-fbqrr0

Conversation

@jcp19

@jcp19 jcp19 commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR removes the custom Asserting ghost function and replaces its usages with Gobra's built-in asserting keyword, which provides the same functionality with better language integration.

Key Changes

  • Removed the Asserting ghost function definition from verification/utils/definitions/definitions.gobra
  • Replaced three instances of let _ := Asserting(...) with the asserting (...) keyword in pkg/slayers/scion_spec.gobra:
    • Two occurrences in the EqAbsHeader method (lines 423-424)
    • One occurrence in the ValidPktMetaHdr function (line 465)

Implementation Details

The asserting keyword is a built-in Gobra construct that serves the same purpose as the removed Asserting function - it allows assertion of properties within expressions. By using the native keyword instead of a custom wrapper function, the code becomes more idiomatic and reduces unnecessary indirection.

https://claude.ai/code/session_01GeaBhWs7mdKisBuWBRXdt3

Replace all usages of the Asserting helper function with Gobra's new
native asserting expression (viperproject/gobra#1036) and remove the
now-unused Asserting function definition.
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.

2 participants