You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2023. It is now read-only.
Removing the return type of method bar resolves the issue, though it is completely baffling as to why the return type of bar has any influence on what foo returns.
from ethereum import tester
import os
library = """
def bar():
return(1: uint256)
"""
code = """
event Message(a)
def foo():
library = create('garbage.se')
log(type=Message, library)
return(library)
"""
with open("garbage.se", "w") as file:
file.write(library)
try:
state = tester.state()
state.block.number += 2000000
contract = state.abi_contract(code)
print(contract.foo())
finally:
os.remove("garbage.se")
The problem appears to be rooted in serpent.mk_signature(code). In both cases, it is generating an invalid signature like [foo:[]:]. Note the missing return type. Adding an explicit return type to foo via return(library: int256) does not resolve the issue.
I believe the root cause of this is ethereum/serpent#119. Pyethereum should do a better job of failing in this case though, I have probably sunk 2-3 days of effort debugging and troubleshooting this issue, if Pyethereum would have just failed hard on the invalid signature from serpent I would have narrowed down the issue much faster.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Removing the return type of method
bar
resolves the issue, though it is completely baffling as to why the return type ofbar
has any influence on whatfoo
returns.Actual Output:
Expected Output:
The text was updated successfully, but these errors were encountered: