diff --git a/CHANGELOG.md b/CHANGELOG.md index 1930efaa..d58c81f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.22.17 + +- Add ``eth_defi.broken_provider.set_block_tip_latency()`` to control the default delays + for which we expect the chain tip to stabilise. + # 0.22.16 - Work around ``BadFunctionCallOutput``: Insufficient bytes exception: A special case of eth_call returning an empty result. diff --git a/eth_defi/provider/broken_provider.py b/eth_defi/provider/broken_provider.py index 7d8de0ac..ade05685 100644 --- a/eth_defi/provider/broken_provider.py +++ b/eth_defi/provider/broken_provider.py @@ -1,8 +1,12 @@ -"""Fixes for Ankr and other broken JSON-RPC service providers. +"""Fixes and workaronds for various JSON-RPC service providers. - Mainly to deal with unstable blockchain chain tip -- See also :py:mod:`eth_defi.provider.ankr` +See also + +- :py:mod:`eth_defi.provider.fallback` + +- :py:mod:`eth_defi.provider.ankr` """ from eth_defi.provider.ankr import is_ankr @@ -70,3 +74,14 @@ def get_block_tip_latency(web3: Web3) -> int: return latency_override return get_default_block_tip_latency(web3) + + +def set_block_tip_latency(web3: Web3, block_count: int): + """Override the default block tip latency settings. + + Useful for unit testing, because unit testing assumes stuff + has happened in the latest block you want to read. + + See :py:func:`get_block_tip_latency`. + """ + web3.block_tip_latency = block_count diff --git a/eth_defi/provider/llamanodes.py b/eth_defi/provider/llamanodes.py index d74b0c5e..69279795 100644 --- a/eth_defi/provider/llamanodes.py +++ b/eth_defi/provider/llamanodes.py @@ -1,4 +1,4 @@ -"""Fixes for quirks and features on LlamaNodes. +"""LlamaNodes specific Python code. - `LlamaNodes `__ runs RPC services at ``llamarpc.com``