Closed shayanb closed 9 years ago
To sign a pay-to-script, you need to set p2sh_lookup to a dictionary that has hashes as keys and the corresponding script as values. Take a look at https://github.com/richardkiss/pycoin/blob/master/tests/pay_to_test.py#L151 as an example.
The tx
tool should allow a list of scripts as an input, either from a file or directly on a command line (but it currently doesn't).
I took a first crack at solving this... I added a -p
and -P
option to the tx tool which might even work. If you'd like to try it, use the https://github.com/richardkiss/pycoin/tree/add_p2sh trunk, and pass the pay-to-script script as a hex string after -p
(or put it into a file and pass the path to the file with -P).
I'm trying to write a python code to spend from the generated P2SH address and I've been getting this error: ValueError: p2sh_lookup not set
I then tried running it with the following command (tx script) and got the same error.