Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
  • Loading branch information
s-tikhomirov and Ivansete-status authored Jan 30, 2025
1 parent 0194c96 commit 5016555
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions waku/incentivization/eligibility_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ type EligibilityManager* = ref object # FIXME: make web3 private?
proc init*(
T: type EligibilityManager, ethClient: string
): Future[EligibilityManager] {.async.} =
result =
EligibilityManager(web3: await newWeb3(ethClient), seenTxIds: initHashSet[TxHash]())
return EligibilityManager(web3: await newWeb3(ethClient), seenTxIds: initHashSet[TxHash]())
# TODO: handle error if web3 instance is not established

# Clean up the web3 instance
Expand Down Expand Up @@ -66,7 +65,7 @@ proc isEligibleTxId*(
let txHashWasSeen = (txHash in eligibilityManager.seenTxIds)
eligibilityManager.seenTxIds.incl(txHash)
if txHashWasSeen:
return err("TxHash " & $txHash & "was already checked (double-spend attempt)")
return err("TxHash " & $txHash & " was already checked (double-spend attempt)")
try:
let txAndTxReceipt = await eligibilityManager.getTxAndTxReceipt(txHash)
txAndTxReceipt.isOkOr:
Expand Down

0 comments on commit 5016555

Please sign in to comment.