openethereum / sol-rs

Solaris - Solidity testing framework in Rust.
GNU General Public License v3.0
54 stars 14 forks source link

msg.sender in contract function != value passed into evm.with_sender #21

Closed snd closed 6 years ago

snd commented 6 years ago

i'm working on making signing work and easy with sol-rs (https://github.com/paritytech/sol-rs/issues/16, https://github.com/paritytech/parity-bridge/tree/solaris-tests). it doesn't work currently. that can have many reasons. i'm in the process of tracking down the reason by looking at every revert in isolation.

while doing that found that if i return msg.sender from a contract function the value differs from the value i passed to evm.with_sender beforehand.

i've added a minimal testcase exposing this potential issue here: https://github.com/paritytech/sol-rs/compare/snd-potential-sender-issue

@tomusdrw any ideas? (it's entirely possible the issue is in my test)

failing test: https://github.com/paritytech/sol-rs/blob/36061c16226c7a8c6b564c5c4c923ecd47152959/tests/tests/test.rs#L17

output: https://travis-ci.org/paritytech/sol-rs/builds/319662624#L1048

snd commented 6 years ago

explanation: https://github.com/paritytech/sol-rs/pull/22/files#diff-aaeafcc6e3475bd3db2d1eec698eb8ddR39

temporary fix: https://github.com/paritytech/sol-rs/pull/22/commits/35487cabfea29b3e9fc4683c1cc39793bceae929#diff-aaeafcc6e3475bd3db2d1eec698eb8ddR39

added todo to: https://github.com/paritytech/sol-rs/issues/6