cll-sim
cll-sim copied to clipboard
Checking help
Help for asserting equality of values.
The old approach still works, excepting contract.txs=[(specific),(specific)]
which has to be replaced with contract.check(txsn=2, txs=[(nonspecific),(nonspecific)])
where it doesnt need to specify everything, only the ones given are checked.
Made this from the transaction fork, but that is still WIP so took it out.
I agree with the prefererence of moving away from the assert
way, but I'd rather use pytest
, nosetest
or unittest
compatible assertions over implementing our own. For maintenance, idiomatic and extensibility reasons.
My reason not doing this in the first case was because of the lack of external contract loading and initialization of the contract state, but this can now be resolved (I think). There might still be an issue with the order of the test function execution; that needs further verification (or requires rewriting of a lot of current simulations).
That way we can implement a default EthereumTestCase
which provides a assertTransactions
, assertStorage
and assertStopped
. I believe that this approach would be compatible with the gist of what you are trying to accomplish here.
Okay, you should do what you think is best.
I dont see how there could an issue with the order of execution? The tests dont change any state?
Yeah good point. Previously they did, but that required some redesign. On Mar 31, 2014 5:46 PM, "Jasper den Ouden" [email protected] wrote:
Okay, you should do what you think is best.
I dont see how there could an issue with the order of execution? The tests dont change any state?
Reply to this email directly or view it on GitHubhttps://github.com/jorisbontje/cll-sim/pull/15#issuecomment-39104314 .
To be clear, the checks dont change state, the test_
functions in the simulation are currently stateful. (perhaps they shouldnt be)