Bugfixing: mixin vs ringsize, get_addresses() in wallet
This commit is contained in:
parent
a1849cab8d
commit
1be5d0b063
|
@ -36,23 +36,23 @@ class Account(object):
|
||||||
def get_transactions_out(self):
|
def get_transactions_out(self):
|
||||||
return self._backend.get_transactions_out(account=self.index)
|
return self._backend.get_transactions_out(account=self.index)
|
||||||
|
|
||||||
def transfer(self, address, amount, priority=prio.NORMAL, mixin=5, payment_id=None, unlock_time=0):
|
def transfer(self, address, amount, priority=prio.NORMAL, ringsize=5, payment_id=None, unlock_time=0):
|
||||||
return self._backend.transfer(
|
return self._backend.transfer(
|
||||||
[(address, amount)],
|
[(address, amount)],
|
||||||
priority,
|
priority,
|
||||||
mixin,
|
ringsize,
|
||||||
payment_id,
|
payment_id,
|
||||||
unlock_time,
|
unlock_time,
|
||||||
account=self.index)
|
account=self.index)
|
||||||
|
|
||||||
def transfer_multiple(self, destinations, priority=prio.NORMAL, mixin=5, payment_id=None, unlock_time=0):
|
def transfer_multiple(self, destinations, priority=prio.NORMAL, ringsize=5, payment_id=None, unlock_time=0):
|
||||||
"""
|
"""
|
||||||
destinations = [(address, amount), ...]
|
destinations = [(address, amount), ...]
|
||||||
"""
|
"""
|
||||||
return self._backend.transfer(
|
return self._backend.transfer(
|
||||||
destinations,
|
destinations,
|
||||||
priority,
|
priority,
|
||||||
mixin,
|
ringsize,
|
||||||
payment_id,
|
payment_id,
|
||||||
unlock_time,
|
unlock_time,
|
||||||
account=self.index)
|
account=self.index)
|
||||||
|
|
|
@ -115,13 +115,13 @@ class JSONRPCWallet(object):
|
||||||
'blob': tx.get('blob', None),
|
'blob': tx.get('blob', None),
|
||||||
}
|
}
|
||||||
|
|
||||||
def transfer(self, destinations, priority, mixin, payment_id=None, unlock_time=0, account=0):
|
def transfer(self, destinations, priority, ringsize, payment_id=None, unlock_time=0, account=0):
|
||||||
data = {
|
data = {
|
||||||
'account_index': account,
|
'account_index': account,
|
||||||
'destinations': list(map(
|
'destinations': list(map(
|
||||||
lambda dst: {'address': str(address(dst[0])), 'amount': to_atomic(dst[1])},
|
lambda dst: {'address': str(address(dst[0])), 'amount': to_atomic(dst[1])},
|
||||||
destinations)),
|
destinations)),
|
||||||
'mixin': mixin,
|
'mixin': ringsize - 1,
|
||||||
'priority': priority,
|
'priority': priority,
|
||||||
'unlock_time': 0,
|
'unlock_time': 0,
|
||||||
'get_tx_keys': True,
|
'get_tx_keys': True,
|
||||||
|
|
|
@ -34,9 +34,12 @@ class Wallet(object):
|
||||||
def get_balance(self, unlocked=False):
|
def get_balance(self, unlocked=False):
|
||||||
return self.accounts[0].get_balance(unlocked=unlocked)
|
return self.accounts[0].get_balance(unlocked=unlocked)
|
||||||
|
|
||||||
def get_address(self, index=0):
|
def get_address(self):
|
||||||
return self.accounts[0].get_addresses()[0]
|
return self.accounts[0].get_addresses()[0]
|
||||||
|
|
||||||
|
def get_addresses(self):
|
||||||
|
return self.accounts[0].get_addresses()
|
||||||
|
|
||||||
def new_address(self, label=None):
|
def new_address(self, label=None):
|
||||||
return self.accounts[0].new_address(label=label)
|
return self.accounts[0].new_address(label=label)
|
||||||
|
|
||||||
|
@ -49,22 +52,22 @@ class Wallet(object):
|
||||||
def get_transactions_out(self):
|
def get_transactions_out(self):
|
||||||
return self.accounts[0].get_transactions_out()
|
return self.accounts[0].get_transactions_out()
|
||||||
|
|
||||||
def transfer(self, address, amount, priority=prio.NORMAL, mixin=5, payment_id=None, unlock_time=0):
|
def transfer(self, address, amount, priority=prio.NORMAL, ringsize=5, payment_id=None, unlock_time=0):
|
||||||
return self.accounts[0].transfer(
|
return self.accounts[0].transfer(
|
||||||
address,
|
address,
|
||||||
amount,
|
amount,
|
||||||
priority=priority,
|
priority=priority,
|
||||||
mixin=mixin,
|
ringsize=ringsize,
|
||||||
payment_id=None,
|
payment_id=None,
|
||||||
unlock_time=unlock_time)
|
unlock_time=unlock_time)
|
||||||
|
|
||||||
def transfer_multiple(self, destinations, priority=prio.NORMAL, mixin=5, payment_id=None, unlock_time=0):
|
def transfer_multiple(self, destinations, priority=prio.NORMAL, ringsize=5, payment_id=None, unlock_time=0):
|
||||||
"""
|
"""
|
||||||
destinations = [(address, amount), ...]
|
destinations = [(address, amount), ...]
|
||||||
"""
|
"""
|
||||||
return self.accounts[0].transfer_multiple(
|
return self.accounts[0].transfer_multiple(
|
||||||
destinations,
|
destinations,
|
||||||
priority=priority,
|
priority=priority,
|
||||||
mixin=mixin,
|
ringsize=ringsize,
|
||||||
payment_id=None,
|
payment_id=None,
|
||||||
unlock_time=unlock_time)
|
unlock_time=unlock_time)
|
||||||
|
|
Loading…
Reference in New Issue