Open fulldecent opened 5 years ago
You are only seeing this because you are running test cases using avmrule with debug mode on, which can show the exact error in the AVM that causes a failure a transaction. That being said, you are only seeing the assertion error because your test cases are running using AVM(avm.jar) directly. This is a privilege Java gives us for smart contract development. With our avmrule (debugging tooling), it allows users to test and debug their contracts using JUnit tests. User can use breakpoints to find the exact lines in their contracts that are wrong. In addition, with debug mode, users can understand the issue more and find a way to fix it faster.
If you deploy the contract to the real network, your transaction will JUST be rejected and you will only notice a transaction failure.
I understand what you are saying, but I don't see how it applies here.
In programming, every assert()
call should include the name and cell phone number of the programmer who put it there. In the event that assert(false)
is called, the programmer gets called, woken up, and they fix it so that assert(false)
never happens.
If assert
here is being used as a way to point user to an explanation of on error the user made then I recommend an exception, error or other mechanism.
Test case:
./mvnw clean install
Expected
AVM never has an assertion failure no matter what customers of AVM do
Actual
AVM has an assertion error