(exchange, skipped_properties, method, entry, key)
| 329 | |
| 330 | |
| 331 | def check_precision_accuracy(exchange, skipped_properties, method, entry, key): |
| 332 | if key in skipped_properties: |
| 333 | return |
| 334 | if exchange.is_tick_precision(): |
| 335 | # TICK_SIZE should be above zero |
| 336 | assert_greater(exchange, skipped_properties, method, entry, key, '0') |
| 337 | # the below array of integers are inexistent tick-sizes (theoretically technically possible, but not in real-world cases), so in our case, such values probably indicate an incorrectly implemented tick-sizes calculation, so we throw error |
| 338 | decimal_numbers = ['2', '3', '4', '5', '6', '7', '8', '9', '11', '12', '13', '14', '15', '16'] |
| 339 | if key == 'amount' and 'precisionAmountAbnormal' in skipped_properties: |
| 340 | return |
| 341 | for i in range(0, len(decimal_numbers)): |
| 342 | num = decimal_numbers[i] |
| 343 | num_str = num |
| 344 | assert_non_equal(exchange, skipped_properties, method, entry, key, num_str) |
| 345 | else: |
| 346 | # todo: significant-digits return doubles from `this.parseNumber`, so for now can't assert against integer atm |
| 347 | # assertInteger (exchange, skippedProperties, method, entry, key); # should be integer |
| 348 | assert_less_or_equal(exchange, skipped_properties, method, entry, key, '18') # should be under 18 decimals |
| 349 | assert_greater_or_equal(exchange, skipped_properties, method, entry, key, '-8') # in real-world cases, there would not be less than that |
| 350 | |
| 351 | |
| 352 | def fetch_best_bid_ask(exchange, method, symbol): |
nothing calls this directly
no test coverage detected
searching dependent graphs…