mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 10:28:10 +01:00
api: Add validateamount command
This commit is contained in:
@@ -507,7 +507,7 @@ class Test(unittest.TestCase):
|
||||
possible_bids = get_possible_bids(rv_stdout)
|
||||
possible_bids = get_possible_bids(rv_stdout)
|
||||
assert (len(possible_bids) == 1)
|
||||
assert (float(possible_bids[0]['amount_from'] < 20.0))
|
||||
assert (float(possible_bids[0]['amount_from']) < 20.0)
|
||||
|
||||
logging.info('Adding mock data to node1 db for tests')
|
||||
rows = []
|
||||
|
||||
@@ -185,6 +185,15 @@ class Test(BaseTest):
|
||||
rv = read_json_api(1800, 'wallets/part')
|
||||
assert ('locked_utxos' in rv)
|
||||
|
||||
rv = read_json_api(1800, 'validateamount', {'coin': 'part', 'amount': 0.000000015})
|
||||
assert ('Mantissa too long' in rv['error'])
|
||||
|
||||
rv = read_json_api(1800, 'validateamount', {'coin': 'part', 'amount': 0.000000015, 'method': 'roundoff'})
|
||||
assert (rv == '0.00000002')
|
||||
|
||||
rv = read_json_api(1800, 'validateamount', {'coin': 'part', 'amount': 0.000000015, 'method': 'rounddown'})
|
||||
assert (rv == '0.00000001')
|
||||
|
||||
def test_004_validateSwapType(self):
|
||||
logging.info('---------- Test validateSwapType')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user