cll-sim icon indicating copy to clipboard operation
cll-sim copied to clipboard

Checking help

Open o-jasper opened this issue 10 years ago • 4 comments

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.

o-jasper avatar Mar 30 '14 13:03 o-jasper

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.

jorisbontje avatar Mar 31 '14 09:03 jorisbontje

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?

o-jasper avatar Mar 31 '14 15:03 o-jasper

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 .

jorisbontje avatar Mar 31 '14 16:03 jorisbontje

To be clear, the checks dont change state, the test_ functions in the simulation are currently stateful. (perhaps they shouldnt be)

o-jasper avatar Mar 31 '14 22:03 o-jasper