Skip to content

Commit

Permalink
functional_tests: add missing sweep_dust parameters, and test it
Browse files Browse the repository at this point in the history
though not a very good test, but we don't have dust handy
  • Loading branch information
moneromooo-monero committed Sep 17, 2019
1 parent b9e0937 commit f23beb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/functional_tests/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def run_test(self):
self.transfer()
self.check_get_bulk_payments()
self.check_double_spend_detection()
self.sweep_dust()
self.sweep_single()
self.check_destinations()

Expand Down Expand Up @@ -583,6 +584,13 @@ def check_double_spend_detection(self):
assert tx.in_pool
assert tx.double_spend_seen

def sweep_dust(self):
print("Sweeping dust")
daemon = Daemon()
self.wallet[0].refresh()
res = self.wallet[0].sweep_dust()
assert not 'tx_hash_list' in res or len(res.tx_hash_list) == 0 # there's just one, but it cannot meet the fee

def sweep_single(self):
daemon = Daemon()

Expand Down
8 changes: 7 additions & 1 deletion utils/python-rpc/framework/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,15 @@ def get_balance(self, account_index = 0, address_indices = [], all_accounts = Fa
}
return self.rpc.send_json_rpc_request(get_balance)

def sweep_dust(self):
def sweep_dust(self, get_tx_keys = True, do_not_relay = False, get_tx_hex = False, get_tx_metadata = False):
sweep_dust = {
'method': 'sweep_dust',
'params': {
'get_tx_keys': get_tx_keys,
'do_not_relay': do_not_relay,
'get_tx_hex': get_tx_hex,
'get_tx_metadata': get_tx_metadata,
},
'jsonrpc': '2.0',
'id': '0'
}
Expand Down

0 comments on commit f23beb8

Please sign in to comment.