ethereum / serpent

Other
364 stars 108 forks source link

mk_signature is confused by create #119

Open MicahZoltu opened 7 years ago

MicahZoltu commented 7 years ago
from ethereum import tester
import os
import serpent

library = """
def bar():
    ~return(0, 32)
"""

code = """
def foo():
    return(create('garbage.se'))
"""

with open("garbage.se", "w") as file:
    file.write(library)

try:
    state = tester.state()
    state.block.number += 2000000
    print(serpent.mk_signature(code))
finally:
    os.remove("garbage.se")

Output:

extern garbage.se: [bar:[]:]

Notice that the signature is missing a return type.

The same problem occurs if you return(1: uint256) from bar.