question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In OpenZeppelin, we’re considering dropping some of our asserts and changing them to require (see here for some relevant discussion), changing the semantics of assert to ‘shouldn’t ever fail unless the code is buggy’. Because of that, solidity-coverage will report a line with partial coverage on each assert.

Could the requirement of assert failure being covered be dropped, or an option added to disable it (maybe with a huge error flag if the assertion ended up failing)? We’d hate to have our coverage figure drop because of a semantics difference.

Thank you for your time and awesome work!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
paulrbergcommented, Oct 20, 2020

Happy to help.

And yes, SMTChecker is actually useful! Check out this presentation by Leonardo Alt. It uses assert statements to identify bugs in a contract.

0reactions
cgeweckecommented, Oct 20, 2020

@PaulRBerg

Ah ok… I would lean towards making this change without a major version bump since no one thinks these should branch and it’s more like a bug.

Thanks for the SMT link - I didn’t realize these have a working application now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assert.Ignore - NUnit Docs
The Assert.Ignore method provides you with the ability to dynamically cause a test or suite to be ignored at runtime. It may be...
Read more >
Disable assertions while testing - Stack Overflow
I want to test the contract of my API so if, for example, an object is created with some parameter to nil an...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
Source code: Lib/unittest/__init__.py(If you are already familiar with the basic concepts of testing, you might want to skip to the list of assert...
Read more >
How to skip the test cases/assertions if the preceding test case ...
Hi, If say for example, I have 4 test cases. If first works, second doesn't work I want it to skip third (which...
Read more >
Disable assertions? - Google Groups
Disable assertions? 358 views. Skip to first unread message.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found