scripts: Start example offer script.

This commit is contained in:
tecnovert
2023-01-09 00:53:59 +02:00
parent 149616a59f
commit ef71ca7ef4
10 changed files with 224 additions and 52 deletions

View File

@@ -313,7 +313,6 @@ class Test(BaseTest):
self.ensure_balance(self.test_coin_from, 2, 100.0)
js_w2 = read_json_api(1802, 'wallets')
print('[rm] js_w2', js_w2)
post_json = {
'value': float(js_w2['PART']['blind_balance']),
'type_from': 'blind',

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2019-2022 tecnovert
# Copyright (c) 2019-2023 tecnovert
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
@@ -127,12 +127,15 @@ class Test(unittest.TestCase):
'amt_to': '1',
'lockhrs': '24'}
offer_id = post_json_api(12700, 'offers/new', data)
offer_id = post_json_api(12700, 'offers/new', data)['offer_id']
summary = read_json_api(12700)
assert (summary['num_sent_offers'] == 1)
except Exception:
traceback.print_exc()
sentoffers = read_json_api(12700, 'sentoffers', {'active': True})
assert sentoffers[0]['offer_id'] == offer_id
logger.info('Waiting for offer:')
waitForNumOffers(delay_event, 12701, 1)

View File

@@ -788,8 +788,7 @@ class Test(BaseTest):
'coin_to': 6,
'amt_from': 1,
'amt_to': 1,
'lockhrs': 24,
'autoaccept': True}
'lockhrs': 24}
rv = json.loads(post_json_req('http://127.0.0.1:1800/json/offers/new', post_json))
offer_id_hex = rv['offer_id']

View File

@@ -61,7 +61,7 @@ class Test(XmrTestBase):
'amt_from': 1,
'amt_to': 1,
'lockhrs': 24,
'autoaccept': True}
'automation_strat_id': 1}
rv = json.loads(urlopen('http://127.0.0.1:12700/json/offers/new', data=parse.urlencode(offer_data).encode()).read())
offer0_id = rv['offer_id']