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

feat: make fail() virtual #48

Merged
merged 3 commits into from
Feb 24, 2023
Merged

feat: make fail() virtual #48

merged 3 commits into from
Feb 24, 2023

Conversation

0xPhaze
Copy link
Contributor

@0xPhaze 0xPhaze commented Feb 22, 2023

Making fail() virtual allows us to easily plug in other frameworks. This can be useful if we want to change the behavior for an assert(false) statement, which would allow us to easily adapt a given test-setup for use with Echidna or the SMTChecker for formal verification.

@0xPhaze
Copy link
Contributor Author

0xPhaze commented Feb 22, 2023

Discussion:

Old, closed PR:

@d-xo
Copy link
Contributor

d-xo commented Feb 22, 2023

Thanks! can you please rebase on master and then add some unit tests to the new file in src/test.t.sol

Making `fail()` virtual allows us to easily plug in other frameworks.
This can be useful if we want to change the behavior for an `assert(False)` statement, which would allow us to easily adapt a given test-setup for use with Echidna or the SMTChecker for formal verification.
@0xPhaze
Copy link
Contributor Author

0xPhaze commented Feb 24, 2023

Ok. Not sure what kind of test case I should add here, so just added an override to fail(). Or were you thinking of some other test?

Copy link
Contributor

@d-xo d-xo left a comment

Choose a reason for hiding this comment

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

That's great, thanks a lot!

@d-xo d-xo merged commit 6da7dd8 into dapphub:master Feb 24, 2023
bowd added a commit to bowd/ds-test that referenced this pull request May 18, 2023
dapphub#48 marked the fail function as virtual but this isn't supported in Solidity 0.5
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