Assert that `v` is within `vspan` of `vexp`
(v, vexp, vspan=0.00001)
| 39 | |
| 40 | |
| 41 | def assert_approx(v, vexp, vspan=0.00001): |
| 42 | """Assert that `v` is within `vspan` of `vexp`""" |
| 43 | if v < vexp - vspan: |
| 44 | raise AssertionError("%s < [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) |
| 45 | if v > vexp + vspan: |
| 46 | raise AssertionError("%s > [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) |
| 47 | |
| 48 | |
| 49 | def assert_fee_amount(fee, tx_size, feerate_BTC_kvB): |
no outgoing calls