add channel_list, deprecate channel_list_mine

This commit is contained in:
Jack Robison 2017-11-22 13:50:07 -05:00
parent d98e0e8110
commit 086c843068
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
3 changed files with 25 additions and 8 deletions

View file

@ -18,16 +18,17 @@ at anytime.
* *
### Deprecated ### Deprecated
* * `channel_list_mine`, replaced with `channel_list`
* *
### Changed ### Changed
* Check claim schema in `publish` before trying to make the claim, return better error messages * Check claim schema in `publish` before trying to make the claim, return better error messages
* * Renamed `channel_list_mine` to `channel_list`
* Changed `channel_list` to include channels where the certificate info has been imported but the claim is not in the wallet
### Added ### Added
*
* Added `channel_import` and `channel_export` commands * Added `channel_import` and `channel_export` commands
* Added `is_mine` field to `channel_list` results
### Removed ### Removed
* *

View file

@ -904,7 +904,7 @@ class Wallet(object):
@defer.inlineCallbacks @defer.inlineCallbacks
def channel_list(self): def channel_list(self):
certificates = yield self._get_certificate_claims() certificates = yield self.get_certificates_for_signing()
results = [] results = []
for claim in certificates: for claim in certificates:
formatted = yield self._handle_claim_result(claim) formatted = yield self._handle_claim_result(claim)

View file

@ -1742,9 +1742,27 @@ class Daemon(AuthJSONRPCServer):
@AuthJSONRPCServer.auth_required @AuthJSONRPCServer.auth_required
@defer.inlineCallbacks @defer.inlineCallbacks
def jsonrpc_channel_list(self):
"""
Get certificate claim infos for channels that can be published to
Usage:
channel_list
Returns:
(list) ClaimDict, includes 'is_mine' field to indicate if the certificate claim
is in the wallet.
"""
result = yield self.session.wallet.channel_list()
response = yield self._render_response(result)
defer.returnValue(response)
@AuthJSONRPCServer.deprecated("channel_list")
@AuthJSONRPCServer.auth_required
def jsonrpc_channel_list_mine(self): def jsonrpc_channel_list_mine(self):
""" """
Get my channels Get certificate claim infos for channels that can be published to (deprecated)
Usage: Usage:
channel_list_mine channel_list_mine
@ -1753,9 +1771,7 @@ class Daemon(AuthJSONRPCServer):
(list) ClaimDict (list) ClaimDict
""" """
result = yield self.session.wallet.channel_list() return self.jsonrpc_channel_list()
response = yield self._render_response(result)
defer.returnValue(response)
@AuthJSONRPCServer.auth_required @AuthJSONRPCServer.auth_required
@defer.inlineCallbacks @defer.inlineCallbacks