ether-camp / ethereum-testing-reference

30 stars 10 forks source link

Adds MultiSig wallet tests #3

Closed kobigurk closed 8 years ago

kobigurk commented 8 years ago

This is a contract similar to the one mist uses. The main difference is the fact that block.number is not included in the operation hash calculation. Bonus - parseEvent function that takes a receipt log and decodes it.

asinyagin commented 8 years ago

@kobigurk why do you use parseEvent instead of web3 filters? It might be tested like here https://github.com/ether-camp/default-ws/blob/master/example-project/test/contract_test.js#L39

And if you need to check some specific event: https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events

Do you think it's more convenient to parse events from receipt logs?

kobigurk commented 8 years ago

My thinking was that I wanted strict control of the event output (wanted to see it came out as a result of the transaction). But I think you're right here and it's cleaner and more convenient. I will update it!

asinyagin commented 8 years ago

@kobigurk can you also please merge the master, remove unused libs and vars, and fix indentation?

kobigurk commented 8 years ago

@asinyagin I rebased, removed unused libs and fixed indentation. I did start migrating to working with filters, but I felt uneasy when doing that because:

  1. If I want to watch for all the events that fire and make sure only those fired, I could not do that easily. Moreover, if I filtered in this way, I still had to parse the event manually.
  2. If I watch for specific events, it seemed more cumbersome.

If you still want me to change it, no prob, let me know.

asinyagin commented 8 years ago

@kobigurk yeah, it seems more convenient to me too. Thanks for the great PR!