Skip to content

Commit 9e84f5c

Browse files
committed
fix: only accept receipt signers with a non-zero balance
1 parent 6f5c89b commit 9e84f5c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

service/src/tap_manager.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl TapManager {
5252
.unwrap_or(false)
5353
{
5454
return Err(QueryError::Other(anyhow::Error::msg(format!(
55-
"Receipt's allocation ID ({}) is not eligible for this indexer",
55+
"Receipt allocation ID `{}` is not eligible for this indexer",
5656
allocation_id
5757
))));
5858
}
@@ -67,11 +67,15 @@ impl TapManager {
6767
.escrow_accounts
6868
.value()
6969
.await
70-
.map(|accounts| accounts.contains_key(&receipt_signer))
70+
.map(|accounts| {
71+
accounts
72+
.get(&receipt_signer)
73+
.map_or(false, |balance| balance > &U256::zero())
74+
})
7175
.unwrap_or(false)
7276
{
7377
return Err(QueryError::Other(anyhow::Error::msg(format!(
74-
"Receipt's sender ({}) is not eligible for this indexer",
78+
"Receipt sender `{}` is not eligible for this indexer",
7579
receipt_signer
7680
))));
7781
}

0 commit comments

Comments
 (0)