コード例 #1
0
ファイル: protocol_objects.py プロジェクト: F483/ngcccbase
 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!')
コード例 #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!')
コード例 #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, '')
コード例 #4
0
ファイル: test_txcons.py プロジェクト: Andymeows/ngcccbase
 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, '')
コード例 #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()
コード例 #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: ???
コード例 #7
0
ファイル: protocol_objects.py プロジェクト: F483/ngcccbase
 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: ???
コード例 #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: ???
コード例 #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()
コード例 #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: ???