Esempio n. 1
0
 def process_reply(self, reply_ep):
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     if self.ewctrl.check_tx(rtxs, self.etx_spec):
         rtxs.sign(self.etx_spec.my_utxo_list)
         self.ewctrl.publish_tx(rtxs, self.my_offer)
         self.etx_data = rtxs.get_hex_tx_data()
     else:
         raise Exception('P2ptrade reply tx check failed!')
Esempio n. 2
0
 def process_reply(self, reply_ep):
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     if self.ewctrl.check_tx(rtxs, self.etx_spec):
         rtxs.sign(self.etx_spec.my_utxo_list)
         self.ewctrl.publish_tx(rtxs, self.my_offer)
         self.etx_data = rtxs.get_hex_tx_data()
     else:
         raise Exception('P2ptrade reply tx check failed!')
Esempio n. 3
0
 def test_composed(self):
     self.basic.add_target(self.assettarget0)
     self.basic.add_target(self.assettarget1)
     self.basic.add_target(self.assettarget2)
     self.add_coins()
     op = self.transformer.transform(self.basic, 'operational')
     self.assertEqual(op.get_change_addr(self.colordef0), self.addr0)
     self.assertEqual(op.get_change_addr(UNCOLORED_MARKER), self.baddr)
     comp = self.transformer.transform(op, 'composed')
     self.assertTrue(self.transformer.classify_tx_spec(comp), 'composed')
     signed = self.transformer.transform(comp, 'signed')
     self.assertTrue(self.transformer.classify_tx_spec(signed), 'signed')
     self.assertEqual(len(signed.get_hex_txhash()), 64)
     txdata = signed.get_tx_data()
     same = RawTxSpec.from_tx_data(self.model, txdata)
     self.assertEqual(same.get_hex_tx_data(), signed.get_hex_tx_data())
     self.assertRaises(InvalidTransformationError,
                       self.transformer.transform, signed, '')
Esempio n. 4
0
 def test_composed(self):
     self.basic.add_target(self.assettarget0)
     self.basic.add_target(self.assettarget1)
     self.basic.add_target(self.assettarget2)
     self.add_coins()
     op = self.transformer.transform(self.basic, 'operational')
     self.assertEqual(op.get_change_addr(self.colordef0), self.addr0)
     self.assertEqual(op.get_change_addr(UNCOLORED_MARKER), self.baddr)
     comp = self.transformer.transform(op, 'composed')
     self.assertTrue(self.transformer.classify_tx_spec(comp), 'composed')
     signed = self.transformer.transform(comp, 'signed')
     self.assertTrue(self.transformer.classify_tx_spec(signed), 'signed')
     self.assertEqual(len(signed.get_hex_txhash()), 64)
     txdata = signed.get_tx_data()
     same = RawTxSpec.from_tx_data(self.model, txdata)
     self.assertEqual(same.get_hex_tx_data(), signed.get_hex_tx_data())
     self.assertRaises(InvalidTransformationError,
                       self.transformer.transform,
                       signed, '')
Esempio n. 5
0
 def process_reply(self, reply_ep):
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     rtxs.sign(self.etx_spec.my_utxo_list)
     self.ewctrl.publish_tx(rtxs) # TODO: ???
     self.etx_data = rtxs.get_hex_tx_data()
Esempio n. 6
0
 def process_reply(self, reply_ep):
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     self.ewctrl.publish_tx(rtxs) # TODO: ???
Esempio n. 7
0
 def process_reply(self, reply_ep):
     # FIXME how is ever valid to call this function???
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     self.ewctrl.publish_tx(rtxs, self.my_offer) # TODO: ???
Esempio n. 8
0
 def process_reply(self, reply_ep):
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     self.ewctrl.publish_tx(rtxs) # TODO: ???
Esempio n. 9
0
 def process_reply(self, reply_ep):
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     rtxs.sign(self.etx_spec.my_utxo_list)
     self.ewctrl.publish_tx(rtxs) # TODO: ???
     self.etx_data = rtxs.get_hex_tx_data()
Esempio n. 10
0
 def process_reply(self, reply_ep):
     # FIXME how is ever valid to call this function???
     rtxs = RawTxSpec.from_tx_data(self.ewctrl.model,
                                   reply_ep.etx_data.decode('hex'))
     self.ewctrl.publish_tx(rtxs, self.my_offer)  # TODO: ???