storj / crypto-batch-payment

A high volume ERC20 token payment application.
GNU Affero General Public License v3.0
5 stars 0 forks source link

Fix zkSync payer panic when no receipt is found #7

Closed azdagron closed 9 months ago

azdagron commented 9 months ago

If the receipt is not found, DefaultProvider.GetTransactionReceipt returns nil. The code does not handle this case and panics checking for the receipt status.

This change adjusts the code to consider the status "pending" if no receipt is found (e.g. receipt is nil), "failed" if the receipt is found with a non-successful status, and "success" otherwise.

It also returns the whole receipt instead of just select fields.

azdagron commented 9 months ago

@elek i wasn't sure why only part of the receipt was being returned. Please let me know if there's something I'm overlooking.

elek commented 9 months ago

i wasn't sure why only part of the receipt was being returned

TBH, I have no idea. But your patch sounds good...