block-for-time script

This commit is contained in:
tim
2024-07-27 00:02:35 -04:00
parent 160344bf0c
commit 11e77c8eac
2 changed files with 6 additions and 5 deletions

5
bin/block-for-time Executable file
View File

@@ -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 "$@"

View File

@@ -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: