Пример #1
0
def construct_pending_tsx(tx, cd):
    """
    Dummy pending transaction record from real transaction + construction data.
    Tx key is not sent to untrusted wallet.
    Same logic as in wallet2.cpp:sign_tx

    :param tx:
    :param cd:
    :return:
    """
    pending = xmrtypes.PendingTransaction(
        tx=tx,
        dust=0,
        fee=0,
        dust_added_to_fee=False,
        change_dts=cd.change_dts,
        selected_transfers=cd.selected_transfers,
        key_images="",
        tx_key=crypto.identity(True),
        additional_tx_keys=[],
        dests=cd.dests,
        multisig_sigs=[],
        construction_data=cd,
    )
    return pending
Пример #2
0
    async def tx_sign_pending_boost(self, pending_tx, fl=None):
        """
        Signs transaction produced by the wallet-rpc, metadata parser, boost
        :param metadata:
        :param fl:
        :return:
        """
        self.skipTest('HP <= 8 not supported anymore')
        reader = xmrserialize.MemoryReaderWriter(bytearray(pending_tx))
        ar = xmrboost.Archive(reader, False)
        pending = xmrtypes.PendingTransaction()
        await ar.root()
        await ar.message(pending)

        tagent = self.init_agent()
        await self.tx_sign_test(tagent, pending.construction_data, self.get_creds(), self.get_all_creds(), fl, sign_tx=True)