Ejemplo n.º 1
0
    def transfer_from_savings_cancel(self, request_id, account=None):
        """ Cancel a withdrawal from 'savings' account.

            :param str request_id: Identifier for tracking or cancelling
            the withdrawal
            :param str account: (optional) the source account for the transfer
            if not ``default_account``
        """
        if not account:
            account = configStorage.get("default_account")
        if not account:
            raise ValueError("You need to provide an account")

        op = operations.CancelTransferFromSavings(**{
            "from": account,
            "request_id": request_id,
        })
        return self.finalizeOp(op, account, "active")
Ejemplo n.º 2
0
    def test_Cancel_transfer_from_savings(self):
        op = operations.CancelTransferFromSavings(**{
            "from": "tesuser",
            "request_id": 9001,
        })
        ops = [operations.Operation(op)]
        tx = SignedTransaction(ref_block_num=ref_block_num,
                               ref_block_prefix=ref_block_prefix,
                               expiration=expiration,
                               operations=ops)
        tx = tx.sign([wif], chain=self.steem.chain_params)

        tx_wire = hexlify(bytes(tx)).decode("ascii")

        compare = (
            "f68585abf4dce7c8045701220774657375736572292300000001200942474f6723937b8"
            "8e19fb8cade26cc97f68cb626362d0764d134fe837df5262200b5e71bec13a0673995a58"
            "4a47674897e959d8c1f83389505895fb64ceda5")
        self.assertEqual(compare[:-130], tx_wire[:-130])