Post Byzantium, when I am testing contract functions, some either (1) return a transaction object/receipt with a status field, while others (2) fail and revert.
Checking for 1) transaction object returned
assert(txReceipt.receipt.status === 0)
Checking for 2) error thrown
contract.someMethodThatWillFail(params) .then( () => assert.throw('should not have reached here'), e => assert.isAtLeast(e.message.indexOf('revert'), 0) )
What determines if method will behave as (1) vs. (2)? (other than trial and error)
I've tried violating
require()'s and modifiers on functions, and I don't see a pattern of whether or not that function will result in 1 vs 2.