Update to recent Monero project state
This commit is contained in:
parent
a16ae37a94
commit
090ef0c984
|
@ -116,6 +116,10 @@ class JSONRPCWallet(object):
|
||||||
def get_height(self):
|
def get_height(self):
|
||||||
return self.raw_request('getheight')['height']
|
return self.raw_request('getheight')['height']
|
||||||
|
|
||||||
|
def get_spend_key(self):
|
||||||
|
# NOTE: This will fail on 0.11.x, the method was missing
|
||||||
|
return self.raw_request('query_key', {'key_type': 'spend_key'})['key']
|
||||||
|
|
||||||
def get_view_key(self):
|
def get_view_key(self):
|
||||||
return self.raw_request('query_key', {'key_type': 'view_key'})['key']
|
return self.raw_request('query_key', {'key_type': 'view_key'})['key']
|
||||||
|
|
||||||
|
@ -305,11 +309,11 @@ class MethodNotFound(RPCError):
|
||||||
|
|
||||||
_err2exc = {
|
_err2exc = {
|
||||||
-2: exceptions.WrongAddress,
|
-2: exceptions.WrongAddress,
|
||||||
-4: exceptions.NotEnoughUnlockedMoney,
|
|
||||||
-5: exceptions.WrongPaymentId,
|
-5: exceptions.WrongPaymentId,
|
||||||
-8: exceptions.TransactionNotFound,
|
-8: exceptions.TransactionNotFound,
|
||||||
-16: exceptions.TransactionNotPossible,
|
-16: exceptions.TransactionNotPossible,
|
||||||
-17: exceptions.NotEnoughMoney,
|
-17: exceptions.NotEnoughMoney,
|
||||||
-20: exceptions.AmountIsZero,
|
-20: exceptions.AmountIsZero,
|
||||||
|
-37: exceptions.NotEnoughUnlockedMoney, # PR pending: https://github.com/monero-project/monero/pull/3197
|
||||||
-32601: MethodNotFound,
|
-32601: MethodNotFound,
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,12 @@ class Wallet(object):
|
||||||
"""
|
"""
|
||||||
return self._backend.get_height()
|
return self._backend.get_height()
|
||||||
|
|
||||||
|
def get_spend_key(self):
|
||||||
|
"""
|
||||||
|
Returns private spend key.
|
||||||
|
"""
|
||||||
|
return self._backend.get_spend_key()
|
||||||
|
|
||||||
def get_view_key(self):
|
def get_view_key(self):
|
||||||
"""
|
"""
|
||||||
Returns private view key.
|
Returns private view key.
|
||||||
|
|
|
@ -60,10 +60,12 @@ print(
|
||||||
unlocked=w.get_balance(unlocked=True)))
|
unlocked=w.get_balance(unlocked=True)))
|
||||||
print(
|
print(
|
||||||
"Keys:\n" \
|
"Keys:\n" \
|
||||||
|
" private spend: {ssk}\n" \
|
||||||
" private view: {svk}\n" \
|
" private view: {svk}\n" \
|
||||||
" public spend: {psk}\n" \
|
" public spend: {psk}\n" \
|
||||||
" public view: {pvk}\n\n" \
|
" public view: {pvk}\n\n" \
|
||||||
"Seed:\n{seed}".format(
|
"Seed:\n{seed}".format(
|
||||||
|
ssk=w.get_spend_key(),
|
||||||
svk=w.get_view_key(),
|
svk=w.get_view_key(),
|
||||||
psk=masteraddr.get_spend_key(),
|
psk=masteraddr.get_spend_key(),
|
||||||
pvk=masteraddr.get_view_key(),
|
pvk=masteraddr.get_view_key(),
|
||||||
|
|
Loading…
Reference in New Issue