Skip to content
Snippets Groups Projects
Commit 46a74e41 authored by Vincent Texier's avatar Vincent Texier
Browse files

Fix Revoke method missing in core.net.bma

parent fd429695
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ from .. import API, logging ...@@ -20,6 +20,7 @@ from .. import API, logging
logger = logging.getLogger("ucoin/node") logger = logging.getLogger("ucoin/node")
class Node(API): class Node(API):
def __init__(self, connection_handler, module='node'): def __init__(self, connection_handler, module='node'):
super(Node, self).__init__(connection_handler, module) super(Node, self).__init__(connection_handler, module)
...@@ -31,7 +32,6 @@ class Summary(Node): ...@@ -31,7 +32,6 @@ class Summary(Node):
def __init__(self, connection_handler, module='node'): def __init__(self, connection_handler, module='node'):
super(Summary, self).__init__(connection_handler, module) super(Summary, self).__init__(connection_handler, module)
def __get__(self, **kwargs): def __get__(self, **kwargs):
return self.requests_get('/summary', **kwargs).json() return self.requests_get('/summary', **kwargs).json()
...@@ -19,6 +19,7 @@ def timeout(reply, seconds): ...@@ -19,6 +19,7 @@ def timeout(reply, seconds):
logging.debug("Reply aborted because of timeout") logging.debug("Reply aborted because of timeout")
reply.abort() reply.abort()
class ConnectionHandler(object): class ConnectionHandler(object):
"""Helper class used by other API classes to ease passing server connection information.""" """Helper class used by other API classes to ease passing server connection information."""
...@@ -124,7 +125,7 @@ class API(object): ...@@ -124,7 +125,7 @@ class API(object):
logging.debug("POST : {0}".format(kwargs)) logging.debug("POST : {0}".format(kwargs))
post_data = QUrlQuery() post_data = QUrlQuery()
for k,v in kwargs.items(): for k, v in kwargs.items():
post_data.addQueryItem(k.replace("+", "%2b"), v.replace("+", "%2b")) post_data.addQueryItem(k.replace("+", "%2b"), v.replace("+", "%2b"))
url = QUrl(self.reverse_url(path)) url = QUrl(self.reverse_url(path))
url.setQuery(post_data) url.setQuery(post_data)
...@@ -138,4 +139,4 @@ class API(object): ...@@ -138,4 +139,4 @@ class API(object):
asyncio.async(timeout(reply, 15)) asyncio.async(timeout(reply, 15))
return reply return reply
from . import network, blockchain, tx, wot, ud, node from . import network, blockchain, tx, wot, ud, node
\ No newline at end of file
...@@ -20,6 +20,7 @@ from .. import API, logging ...@@ -20,6 +20,7 @@ from .. import API, logging
logger = logging.getLogger("ucoin/node") logger = logging.getLogger("ucoin/node")
class Node(API): class Node(API):
def __init__(self, connection_handler, module='node'): def __init__(self, connection_handler, module='node'):
super(Node, self).__init__(connection_handler, module) super(Node, self).__init__(connection_handler, module)
......
...@@ -37,6 +37,16 @@ class Add(WOT): ...@@ -37,6 +37,16 @@ class Add(WOT):
return self.requests_post('/add', **kwargs) return self.requests_post('/add', **kwargs)
class Revoke(WOT):
"""POST Public key data."""
def __post__(self, **kwargs):
assert 'pubkey' in kwargs
assert 'self_' in kwargs
return self.requests_post('/revoke', **kwargs)
class Lookup(WOT): class Lookup(WOT):
"""GET Public key data.""" """GET Public key data."""
null_value = \ null_value = \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment