def disable_ecdsa_r_value_grinding(func):
    """Function decorator to run a unit test with ecdsa R-value grinding disabled.
    This is used when we want to pass test vectors that were created without R-value grinding.
    (see https://github.com/bitcoin/bitcoin/pull/13666 )

    NOTE: this is inherently sequential;
    tests running in parallel would break things
    """
    is_grinding = ecc.ENABLE_ECDSA_R_VALUE_GRINDING
    if asyncio.iscoroutinefunction(func):
        async def run_test(*args, **kwargs):
            try:
                ecc.ENABLE_ECDSA_R_VALUE_GRINDING = False
                return await func(*args, **kwargs)
            finally:
                ecc.ENABLE_ECDSA_R_VALUE_GRINDING = is_grinding
    else:
        def run_test(*args, **kwargs):
            try:
                ecc.ENABLE_ECDSA_R_VALUE_GRINDING = False
                return func(*args, **kwargs)
            finally:
                ecc.ENABLE_ECDSA_R_VALUE_GRINDING = is_grinding
    return run_test
Function decorator to run a unit test with ecdsa R-value grinding disabled.
    This is used when we want to pass test vectors that were created without R-value grinding.
    (see https://github.com/bitcoin/bitcoin/pull/13666 )

    NOTE: this is inherently sequential;
    tests running in parallel would break things
    
tests/test_bitcoin.py