-
-
Notifications
You must be signed in to change notification settings - Fork 829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling constant functions that use msg.sender in non-constant functions fails #315
Comments
I believe that |
@fubuloubu Great catch! I'll help with this, off the top of my head I'm guessing it's an issue with how function contexts are being made. |
I narrowed it down to a test case that we can use to debug. I'll create a pull request for that, and then maybe you can help me debug the issue further. |
Created #320 Further collaboration on that please. |
I was testing some updates I was making with one of my example contracts and I think I may have stumbled upon a bug, or at least something I don't understand why it should fail (and it's not very clear why)
To summarize, I have a contract that contains a constant method to return the balance of some map (address -> record) for the address associated with the message sender. I decided to use this function in my other functions so I didn't duplicate this access in multiple spots, basically assuming that if I called this
@constant
function, themsg.sender
attribute would be passed to that@constant
function. However, when I do this I get theTransactionFailed
exception from pyethereum.Here's an example:
Please let me know if I am misunderstanding how the
@constant
is supposed to be used (I am assuming you should be allowed to call@constant
functions from other functions) (I am also assuming that implicit values such asmsg.sender
are passed to@constant
functions as well).Not totally certain what the problem is...
The text was updated successfully, but these errors were encountered: