Closed mortimr closed 7 years ago
This is expected behavior.
What you are seeing is your tests running against an in-memory EVM backed by pyethereum
which is reset at the beginning of each test run. What you can test here is that pm.call().showOwner() == web3.eth.coinbase
which will be the address which deploys the contract.
Also, let me know if you have additional questions and feel free to re-open as well if I haven't actually answered your question.
OS: linux
What was wrong?
Hi, Tried to deploy a very simple contract (divided in two files), with an owner variable (
owner = msg.sender
). Basically I have a contract that has the owner part in it, and the second one inherits from it (like greeter and mortal). The problem is that when I launch some tests, the returned value is not the good one (checked on etherscan for the contract owner and it's good). I created a getter function that just returns anadress
type variable . I am of course returningowner
. The function is calledshowOwner
, and I did this in the test file :and I get another address that I have never seen before :/ . So I was wondering , is returning an address from a contract going to be well interpreted by python (address -> string) ? Or do I have a weird problem here ?
Thanks !