Remove the ringsize parameter

This commit is contained in:
Michał Sałaban 2018-10-19 01:32:04 +02:00
parent 91c720ecee
commit 9d03995092
5 changed files with 6 additions and 65 deletions

View file

@ -24,14 +24,6 @@ class Account(object):
self.incoming = PaymentManager(index, backend, 'in')
self.outgoing = PaymentManager(index, backend, 'out')
def _check_ringsize(self, ringsize):
if ringsize != 11:
warnings.warn("Requested ring size {rs}. Since protocol v8 hard fork "
"(monero-0.13) the ring size is fixed to 11 (mixin size 10). The ringsize "
"argument will be dropped in version 0.5. Please update accordingly.".format(
rs=ringsize),
DeprecationWarning)
def balances(self):
"""
Returns a tuple of balance and unlocked balance.
@ -74,7 +66,7 @@ class Account(object):
return self._backend.new_address(account=self.index, label=label)
def transfer(self, address, amount,
priority=prio.NORMAL, ringsize=11, payment_id=None, unlock_time=0,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a transfer. Returns a list of resulting transactions.
@ -84,7 +76,6 @@ class Account(object):
:param priority: transaction priority, implies fee. The priority can be a number
from 1 to 4 (unimportant, normal, elevated, priority) or a constant
from `monero.prio`.
:param ringsize: the ring size (deprecated, will be gone in v0.5)
:param payment_id: ID for the payment (must be None if
:class:`IntegratedAddress <monero.address.IntegratedAddress>`
is used as the destination)
@ -94,18 +85,16 @@ class Account(object):
so they might be broadcasted later
:rtype: list of :class:`Transaction <monero.transaction.Transaction>`
"""
self._check_ringsize(ringsize)
return self._backend.transfer(
[(address, amount)],
priority,
ringsize,
payment_id,
unlock_time,
account=self.index,
relay=relay)
def transfer_multiple(self, destinations,
priority=prio.NORMAL, ringsize=11, payment_id=None, unlock_time=0,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a batch of transfers. Returns a list of resulting transactions.
@ -115,7 +104,6 @@ class Account(object):
:param priority: transaction priority, implies fee. The priority can be a number
from 1 to 4 (unimportant, normal, elevated, priority) or a constant
from `monero.prio`.
:param ringsize: the ring size (deprecated, will be gone in v0.5)
:param payment_id: ID for the payment (must be None if
:class:`IntegratedAddress <monero.address.IntegratedAddress>`
is used as the destination)
@ -125,11 +113,9 @@ class Account(object):
so they might be broadcasted later
:rtype: list of :class:`Transaction <monero.transaction.Transaction>`
"""
self._check_ringsize(ringsize)
return self._backend.transfer(
destinations,
priority,
ringsize,
payment_id,
unlock_time,
account=self.index,

View file

@ -287,7 +287,7 @@ class JSONRPCWallet(object):
{'signed_key_images': key_images})
return (_data['height'], from_atomic(_data['spent']), from_atomic(_data['unspent']))
def transfer(self, destinations, priority, ringsize,
def transfer(self, destinations, priority,
payment_id=None, unlock_time=0, account=0,
relay=True):
data = {
@ -295,7 +295,6 @@ class JSONRPCWallet(object):
'destinations': list(map(
lambda dst: {'address': str(address(dst[0])), 'amount': to_atomic(dst[1])},
destinations)),
'mixin': ringsize - 1,
'priority': priority,
'unlock_time': 0,
'get_tx_keys': True,

View file

@ -182,7 +182,7 @@ class Wallet(object):
return self.accounts[0].new_address(label=label)
def transfer(self, address, amount,
priority=prio.NORMAL, ringsize=11, payment_id=None, unlock_time=0,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a transfer from the default account. Returns a list of resulting transactions.
@ -192,7 +192,6 @@ class Wallet(object):
:param priority: transaction priority, implies fee. The priority can be a number
from 1 to 4 (unimportant, normal, elevated, priority) or a constant
from `monero.prio`.
:param ringsize: the ring size (deprecated, will be gone in v0.5)
:param payment_id: ID for the payment (must be None if
:class:`IntegratedAddress <monero.address.IntegratedAddress>`
is used as the destination)
@ -206,13 +205,12 @@ class Wallet(object):
address,
amount,
priority=priority,
ringsize=ringsize,
payment_id=payment_id,
unlock_time=unlock_time,
relay=relay)
def transfer_multiple(self, destinations,
priority=prio.NORMAL, ringsize=11, payment_id=None, unlock_time=0,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a batch of transfers from the default account. Returns a list of resulting
@ -222,7 +220,6 @@ class Wallet(object):
:param priority: transaction priority, implies fee. The priority can be a number
from 1 to 4 (unimportant, normal, elevated, priority) or a constant
from `monero.prio`.
:param ringsize: the ring size (deprecated, will be gone in v0.5)
:param payment_id: ID for the payment (must be None if
:class:`IntegratedAddress <monero.address.IntegratedAddress>`
is used as a destination)
@ -235,7 +232,6 @@ class Wallet(object):
return self.accounts[0].transfer_multiple(
destinations,
priority=priority,
ringsize=ringsize,
payment_id=payment_id,
unlock_time=unlock_time,
relay=relay)