Split up the db classes used by the different hub services #43
2 changed files with 4 additions and 10 deletions
|
@ -347,14 +347,9 @@ INVALID_ARGS = -32602
|
||||||
|
|
||||||
|
|
||||||
class CodeMessageError(Exception):
|
class CodeMessageError(Exception):
|
||||||
|
def __init__(self, code: int, message: str):
|
||||||
@property
|
self.code = code
|
||||||
def code(self):
|
self.message = message
|
||||||
return self.args[0]
|
|
||||||
|
|
||||||
@property
|
|
||||||
def message(self):
|
|
||||||
return self.args[1]
|
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return (isinstance(other, self.__class__) and
|
return (isinstance(other, self.__class__) and
|
||||||
|
@ -382,7 +377,6 @@ class RPCError(CodeMessageError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DaemonError(Exception):
|
class DaemonError(Exception):
|
||||||
"""Raised when the daemon returns an error in its results."""
|
"""Raised when the daemon returns an error in its results."""
|
||||||
|
|
||||||
|
|
|
@ -1750,7 +1750,7 @@ class LBRYElectrumX(asyncio.Protocol):
|
||||||
if not verbose:
|
if not verbose:
|
||||||
return raw_tx.hex()
|
return raw_tx.hex()
|
||||||
return self.coin.transaction(raw_tx).as_dict(self.coin)
|
return self.coin.transaction(raw_tx).as_dict(self.coin)
|
||||||
return RPCError("No such mempool or blockchain transaction.")
|
return RPCError(BAD_REQUEST, "No such mempool or blockchain transaction.")
|
||||||
|
|
||||||
def _get_merkle_branch(self, tx_hashes, tx_pos):
|
def _get_merkle_branch(self, tx_hashes, tx_pos):
|
||||||
"""Return a merkle branch to a transaction.
|
"""Return a merkle branch to a transaction.
|
||||||
|
|
Loading…
Reference in a new issue