From 4b716bbcdd671c4bcd81920f58d155470a5ff23a Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 15 Aug 2017 11:36:03 -0400 Subject: [PATCH] fix send_amount_to_address backwards compatibility --- CHANGELOG.md | 2 +- lbrynet/daemon/Daemon.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 913755651..7335fcac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ at anytime. ### Deprecated * The API will no longer be served at the /lbryapi path. It will now be at the root. - * + * Deprecated `send_amount_to_address` in favor of `wallet_send` ### Changed * Renamed `reflect` command to `file_reflect` diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 927eb0660..44da269b9 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -2243,15 +2243,15 @@ class Daemon(AuthJSONRPCServer): @AuthJSONRPCServer.auth_required @defer.inlineCallbacks - def jsonrpc_wallet_send(self, address=None, claim_id=None, amount=None): + def jsonrpc_wallet_send(self, amount, address=None, claim_id=None): """ Send credits. If given an address, send credits to it. If given a claim id, send a tip to the owner of a claim specified by uri. A tip is a claim support where the recipient of the support is the claim address for the claim being supported. Usage: - wallet_send ((
| --address=
) | ( | --claim_id=)) - ( | --amount=) + wallet_send ( | --amount=) + ((
| --address=
) | ( | --claim_id=)) Return: If sending to an address: @@ -2270,8 +2270,10 @@ class Daemon(AuthJSONRPCServer): raise Exception("Given both an address and a claim id") elif not address and not claim_id: raise Exception("Not given an address or a claim id") - if not amount: - raise Exception("Cannot send without an amount") + if amount < 0: + raise NegativeFundsError() + elif not amount: + raise NullFundsError() if address: result = yield self.jsonrpc_send_amount_to_address(amount, address)