Skip to content

Commit

Permalink
Refactor linea tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayanShiravani committed Oct 16, 2023
1 parent 549a1eb commit 6561f87
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions prizetap/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ def request_random_words_for_linea_raffle(raffle: Raffle):
raffle_client = LineaPrizetapContractClient(raffle)
winners_count = raffle_client.get_raffle_winners_count()
tx_hash = vrf_client.request_random_words(winners_count)
receipt = raffle_client.wait_for_transaction_receipt(tx_hash)
if receipt['status'] == 1:
raffle.vrf_tx_hash = tx_hash
raffle.save()
raffle.vrf_tx_hash = tx_hash
raffle.save()

@shared_task(bind=True)
def draw_expired_linea_raffles(self):
Expand Down Expand Up @@ -149,11 +147,9 @@ def draw_linea_raffle(raffle: Raffle):
),
muon_response['shieldSignature']
)
receipt = raffle_client.wait_for_transaction_receipt(
tx_hash)
if receipt['status'] == 1:
raffle.status = Raffle.Status.CLOSED
raffle.save()
print(tx_hash)
raffle.status = Raffle.Status.CLOSED
raffle.save()


@shared_task(bind=True)
Expand Down

0 comments on commit 6561f87

Please sign in to comment.