def parse_script(self, x):
     from electrum.transaction import opcodes, push_script
     script = ''
     for word in x.split():
         if word[0:3] == 'OP_':
             assert word in opcodes.lookup
             script += chr(opcodes.lookup[word])
         else:
             script += push_script(word).decode('hex')
     return script
Exemple #2
0
 def parse_script(self, x):
     from electrum.transaction import opcodes, push_script
     script = ''
     for word in x.split():
         if word[0:3] == 'OP_':
             assert word in opcodes.lookup
             script += chr(opcodes.lookup[word])
         else:
             script += push_script(word).decode('hex')
     return script
Exemple #3
0
 def parse_script(self, x):
     script = ''
     for word in x.split():
         if word[0:3] == 'OP_':
             opcode_int = opcodes[word]
             assert opcode_int < 256  # opcode is single-byte
             script += bitcoin.int_to_hex(opcode_int)
         else:
             bfh(word)  # to test it is hex data
             script += push_script(word)
     return script
Exemple #4
0
 def parse_script(self, x):
     script = ''
     for word in x.split():
         if word[0:3] == 'OP_':
             opcode_int = opcodes[word]
             assert opcode_int < 256  # opcode is single-byte
             script += bitcoin.int_to_hex(opcode_int)
         else:
             bfh(word)  # to test it is hex data
             script += push_script(word)
     return script
Exemple #5
0
 def parse_script(self, x):
     from electrum.transaction import opcodes, push_script
     script = ''
     for word in x.split():
         if word[0:3] == 'OP_':
             assert word in opcodes.lookup
             opcode_int = opcodes.lookup[word]
             assert opcode_int < 256  # opcode is single-byte
             script += bitcoin.int_to_hex(opcode_int)
         else:
             bfh(word)  # to test it is hex data
             script += push_script(word)
     return script
Exemple #6
0
 def parse_script(self, x):
     from electrum.transaction import opcodes, push_script
     script = ''
     for word in x.split():
         if word[0:3] == 'OP_':
             assert word in opcodes.lookup
             opcode_int = opcodes.lookup[word]
             assert opcode_int < 256  # opcode is single-byte
             script += bitcoin.int_to_hex(opcode_int)
         else:
             bfh(word)  # to test it is hex data
             script += push_script(word)
     return script