diff --git a/bin/block-for-time b/bin/block-for-time new file mode 100755 index 0000000..e2a1422 --- /dev/null +++ b/bin/block-for-time @@ -0,0 +1,5 @@ +#!/bin/bash + +SCRIPT_DIR="$(dirname -- "$( readlink -f -- "$0"; )";)" + +DEXORDER_RPC_URL=arbitrum_alchemy PYTHONPATH="$SCRIPT_DIR/../src" python -m dexorder.bin.block_for_time "$@" diff --git a/src/dexorder/blocks.py b/src/dexorder/blocks.py index 8908e5e..cf622ba 100644 --- a/src/dexorder/blocks.py +++ b/src/dexorder/blocks.py @@ -53,11 +53,7 @@ async def _fetch(fetch: FetchLock, chain_id: int, block_id: Union[int,bytes]) -> else: found = db.session.get(DbBlock, dict(chain=chain, hash=block_id)) # by-hash is the primary key if found: - log.debug(f'found block: {found}') - try: - return Block(chain_id, found.data) - except AttributeError: - log.exception(f'found was {found}') + return Block(chain_id, found.data) # fetch from RPC try: