mirror of
https://github.com/basicswap/basicswap.git
synced 2025-05-05 20:32:15 +00:00
parent
15e7a6efda
commit
745d1460e5
2 changed files with 15 additions and 2 deletions
|
@ -452,6 +452,7 @@ def main():
|
||||||
coin_from_data = coins_map[bid_template['coin_from']]
|
coin_from_data = coins_map[bid_template['coin_from']]
|
||||||
coin_to_data = coins_map[bid_template['coin_to']]
|
coin_to_data = coins_map[bid_template['coin_to']]
|
||||||
|
|
||||||
|
page_limit: int = 25
|
||||||
offers_options = {
|
offers_options = {
|
||||||
'active': 'active',
|
'active': 'active',
|
||||||
'include_sent': False,
|
'include_sent': False,
|
||||||
|
@ -460,9 +461,21 @@ def main():
|
||||||
'with_extra_info': True,
|
'with_extra_info': True,
|
||||||
'sort_by': 'rate',
|
'sort_by': 'rate',
|
||||||
'sort_dir': 'asc',
|
'sort_dir': 'asc',
|
||||||
|
'offset': 0,
|
||||||
|
'limit': page_limit,
|
||||||
}
|
}
|
||||||
|
|
||||||
received_offers = read_json_api('offers', offers_options)
|
received_offers = []
|
||||||
|
for i in range(1000000): # for i in itertools.count()
|
||||||
|
page_offers = read_json_api('offers', offers_options)
|
||||||
|
if len(page_offers) < 1:
|
||||||
|
break
|
||||||
|
received_offers += page_offers
|
||||||
|
offers_options['offset'] = offers_options['offset'] + page_limit
|
||||||
|
if i > 100:
|
||||||
|
print(f'Warning: Broke offers loop at: {i}')
|
||||||
|
break
|
||||||
|
|
||||||
if args.debug:
|
if args.debug:
|
||||||
print('Received Offers', received_offers)
|
print('Received Offers', received_offers)
|
||||||
|
|
||||||
|
|
|
@ -633,7 +633,7 @@ class Test(unittest.TestCase):
|
||||||
'name': 'offer should fail',
|
'name': 'offer should fail',
|
||||||
'coin_from': 'Particl',
|
'coin_from': 'Particl',
|
||||||
'coin_to': 'XMR',
|
'coin_to': 'XMR',
|
||||||
'amount': 20,
|
'amount': 200,
|
||||||
'minrate': 0.05,
|
'minrate': 0.05,
|
||||||
'ratetweakpercent': 50000000,
|
'ratetweakpercent': 50000000,
|
||||||
'amount_variable': True,
|
'amount_variable': True,
|
||||||
|
|
Loading…
Reference in a new issue