Exemplo n.º 1
0
 def get_origin_tx(self):
     origin = self.requested_claim.get('origin')
     origin = str(origin)
     logger.debug(
         "Wallet Response:origin tx before decode: {}".format(origin), )
     decoded = base58.b58decode(origin[1:])
     tx = forge_protos.Transaction()
     tx.ParseFromString(decoded)
     logger.debug(
         "Wallet Response:origin tx after base58 decode: {}".format(tx), )
     return tx
Exemplo n.º 2
0
def update_tx_signature(tx, signature):
    params = {
        'from': getattr(tx, 'from'),
        'nonce': tx.nonce,
        'signature': signature,
        'chain_id': tx.chain_id,
        'signatures': tx.signatures,
        'itx': tx.itx,
        'pk': tx.pk,
    }
    new_tx = forge_protos.Transaction(**params)
    return new_tx
Exemplo n.º 3
0
def gen_poke_tx(address, pk):
    poke_itx = forge_protos.PokeTx(
            date=str(
                    datetime.now().date()),
            address='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
    )
    itx = forge_utils.encode_to_any('fg:t:poke', poke_itx)
    params = {
        'from': address,
        'chain_id': config.chain_id,
        'nonce': 0,
        'pk': pk,
        'itx': itx
    }
    return forge_protos.Transaction(**params)
Exemplo n.º 4
0
def update_tx_multisig(tx, signer, pk, signature=None, data=None):
    multisig = forge_protos.Multisig(
        signer=signer,
        signature=signature,
        data=data,
        pk=pk,
    )
    params = {
        'from': getattr(tx, 'from'),
        'nonce': tx.nonce,
        'signature': tx.signature,
        'chain_id': tx.chain_id,
        'signatures': [multisig],
        'itx': tx.itx,
        'pk': tx.pk,
    }
    new_tx = forge_protos.Transaction(**params)
    return new_tx