Skip to content

Conversation

@montyly
Copy link
Contributor

@montyly montyly commented Aug 4, 2025

returnBool set to false will make medusa accept properties that don't return a boolean.

This is meant to mimic foundry's behavior, and ease the compatibility between the two tools. See https://getfoundry.sh/forge/advanced-testing/invariant-testing/#conditional-invariants

Copy link
Member

@elopez elopez left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I'm overall confused about the feature though, wouldn't a property that does not return a boolean not be a property? It sounds like it would be something for the assertion testing mode instead.

TestPrefixes []string `json:"testPrefixes"`

// TestReturnBool dictactes if the properties should return a bool or not
TestReturnBool bool `json:"returnBool"`
Copy link
Member

Choose a reason for hiding this comment

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

but maybe it needs to be unified the other way to testReturnBool? it seems JSON options match their Go counterparts.

@montyly
Copy link
Contributor Author

montyly commented Aug 4, 2025

@elopez the way I have seen people using it in foundry setup is basically that the invariant_ functions should not revert.

It would be the same as having require(return_variable)

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