def cancel(self, orderid, account=None): """ Cancels an order you have placed in a given market. :param int orderid: the 32bit orderid :param str account: (optional) the source account for the transfer if not ``default_account`` """ if not account: if "default_account" in config: account = config["default_account"] if not account: raise ValueError("You need to provide an account") op = operations.LimitOrderCancel(**{ "owner": account, "orderid": orderid, }) return self.steemd.commit.finalizeOp(op, account, "active")
def test_order_cancel(self): op = operations.LimitOrderCancel(**{ "owner": "", "orderid": 2141244, }) 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 = ("f68585abf4dce7c804570106003cac20000001206c9888d0c2c3" "1dba1302566f524dfac01a15760b93a8726241a7ae6ba00edfd" "e5b83edaf94a4bd35c2957ded6023576dcbe936338fb9d340e2" "1b5dad6f0028f6") self.assertEqual(compare[:-130], tx_wire[:-130])