Compare commits

...

2 Commits

Author SHA1 Message Date
Michał Sałaban 3fcab577eb Fix error on missing indices; reformat
2 years ago
Michał Sałaban 021a7ad68e Remove outdated comment
2 years ago

@ -1440,8 +1440,8 @@ class JSONRPCDaemon(object):
""" """
if out_peers_arg < 0: if out_peers_arg < 0:
out_peers_arg = 2 ** 32 - 1 out_peers_arg = 2**32 - 1
elif out_peers_arg > 2 ** 32 - 1: elif out_peers_arg > 2**32 - 1:
raise ValueError('out_peers_arg "{}" is too large'.format(out_peers_arg)) raise ValueError('out_peers_arg "{}" is too large'.format(out_peers_arg))
return self.raw_request("/out_peers", data={"out_peers": int(out_peers_arg)}) return self.raw_request("/out_peers", data={"out_peers": int(out_peers_arg)})
@ -1459,8 +1459,8 @@ class JSONRPCDaemon(object):
""" """
if in_peers_arg < 0: if in_peers_arg < 0:
in_peers_arg = 2 ** 32 - 1 in_peers_arg = 2**32 - 1
elif in_peers_arg > 2 ** 32 - 1: elif in_peers_arg > 2**32 - 1:
raise ValueError('in_peers_arg "{}" is too large'.format(in_peers_arg)) raise ValueError('in_peers_arg "{}" is too large'.format(in_peers_arg))
return self.raw_request("/in_peers", data={"in_peers": int(in_peers_arg)}) return self.raw_request("/in_peers", data={"in_peers": int(in_peers_arg)})
@ -1598,7 +1598,9 @@ class JSONRPCDaemon(object):
timestamp=datetime.fromtimestamp(tx["block_timestamp"]) timestamp=datetime.fromtimestamp(tx["block_timestamp"])
if "block_timestamp" in tx if "block_timestamp" in tx
else None, else None,
output_indices=tx["output_indices"], output_indices=tx["output_indices"]
if "output_indices" in tx
else None,
blob=binascii.unhexlify(tx["as_hex"]) or None, blob=binascii.unhexlify(tx["as_hex"]) or None,
json=as_json, json=as_json,
) )

@ -440,6 +440,6 @@ _err2exc = {
-29: exceptions.WalletIsWatchOnly, -29: exceptions.WalletIsWatchOnly,
-37: exceptions.NotEnoughUnlockedMoney, -37: exceptions.NotEnoughUnlockedMoney,
-38: exceptions.NoDaemonConnection, -38: exceptions.NoDaemonConnection,
-43: exceptions.WalletIsNotDeterministic, # https://github.com/monero-project/monero/pull/4653 -43: exceptions.WalletIsNotDeterministic,
-32601: MethodNotFound, -32601: MethodNotFound,
} }

Loading…
Cancel
Save