Skip to content

Commit 63cd14c

Browse files
committed
feat: dont wait for confirmations
1 parent 03860a6 commit 63cd14c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

bot/bot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ async def on_auction_take(event: ContractLog) -> None:
144144

145145
@bot.on_(chain.blocks)
146146
async def check_auctions_and_take(block: BlockAPI, context: Annotated[Context, TaskiqDepends()]) -> None:
147+
for auction, taker in auctions():
148+
execute_take(taker, 0)
147149
state = load_state()
148150
if not state:
149151
return

bot/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_signer() -> Any:
1818

1919
try:
2020
account = import_account_from_private_key(ACCOUNT_ALIAS, VERY_SECRET_PASSWORD, private_key)
21-
except ValueError:
21+
except Exception:
2222
account = accounts.load(ACCOUNT_ALIAS)
2323

2424
account.set_autosign(True, passphrase=VERY_SECRET_PASSWORD)
@@ -29,7 +29,7 @@ def get_signer() -> Any:
2929
def execute_take(taker: Any, auction_id: int) -> None:
3030
try:
3131
signer = get_signer()
32-
taker.take(auction_id, sender=signer)
32+
taker.take(auction_id, sender=signer, confirmations_required=0)
3333
except ContractLogicError as e:
3434
print(f"execute_take: {e}")
3535

0 commit comments

Comments
 (0)