Пример #1
0
    def got_network_response_chunk_slot(self, response, chunk_index):
        if response.get('error'):
            return self.fail_metadata_info("Download chunk data error!\n%r" %
                                           (response['error'].get('message')))
        raw = response.get('result')

        tx = Transaction(raw)
        self.handle_chunk_tx(tx, chunk_index)
Пример #2
0
    def got_network_response_slot(self):
        self.download_finished = True

        resp = self.json_response
        if resp.get('error'):
            return self.fail_metadata_info("Download metadata error!\n%r" %
                                           (resp['error'].get('message')))
        raw = resp.get('result')

        tx = Transaction(raw)
        self.handle_metadata_tx(tx)
Пример #3
0
 def tx_from_text(self, txt):
     from electrum_zclassic.transaction import tx_from_str
     try:
         txt_tx = tx_from_str(txt)
         tx = Transaction(txt_tx,
                          sign_schnorr=self.wallet.is_schnorr_enabled())
         tx.deserialize()
         return tx
     except:
         traceback.print_exc(file=sys.stdout)
         self.show_critical(
             _("Electron Cash was unable to parse your transaction"))
         return
Пример #4
0
 def on_qr(self, data):
     from electrum_zclassic.bitcoin import base_decode, is_address
     data = data.strip()
     if is_address(data):
         self.set_URI(data)
         return
     if data.startswith('zclassic:'):
         self.set_URI(data)
         return
     # try to decode transaction
     from electrum_zclassic.transaction import Transaction
     from electrum_zclassic.util import bh2u
     try:
         text = bh2u(base_decode(data, None, base=43))
         tx = Transaction(text)
         tx.deserialize()
     except:
         tx = None
     if tx:
         self.tx_dialog(tx)
         return
     # show error
     self.show_error("Unable to decode QR data")