Last active
August 4, 2017 03:34
-
-
Save mhchia/d39d7e0dbbd50c95cf65b98d5c6d597f to your computer and use it in GitHub Desktop.
I fail to use `RLPList` in viper in this case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ethereum.tools import tester as t | |
from ethereum import utils | |
import rlp | |
code = """ | |
def test(a1: bytes <= 1000) -> num: | |
tempa = RLPList(a1, [num]) | |
return tempa[0] | |
""" | |
c = t.Chain() | |
x = c.contract(code, language='viper') | |
a = rlp.encode([10]) | |
print(x.test(a)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue is because you didn't publish the RLP decoder contract to the chain. You want to publish the tx:
Obviously first send a bit of ETH to the sender to pay for gas.