Skip to content

Commit

Permalink
fix: only accept receipt signers with a non-zero balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis committed Oct 18, 2023
1 parent 6f5c89b commit 9e84f5c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions service/src/tap_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl TapManager {
.unwrap_or(false)
{
return Err(QueryError::Other(anyhow::Error::msg(format!(
"Receipt's allocation ID ({}) is not eligible for this indexer",
"Receipt allocation ID `{}` is not eligible for this indexer",
allocation_id
))));
}
Expand All @@ -67,11 +67,15 @@ impl TapManager {
.escrow_accounts
.value()
.await
.map(|accounts| accounts.contains_key(&receipt_signer))
.map(|accounts| {
accounts
.get(&receipt_signer)
.map_or(false, |balance| balance > &U256::zero())
})
.unwrap_or(false)
{
return Err(QueryError::Other(anyhow::Error::msg(format!(
"Receipt's sender ({}) is not eligible for this indexer",
"Receipt sender `{}` is not eligible for this indexer",
receipt_signer
))));
}
Expand Down

0 comments on commit 9e84f5c

Please sign in to comment.