ProvableHQ / sdk

A Software Development Kit (SDK) for Zero-Knowledge Transactions
https://provable.tools
GNU General Public License v3.0
584 stars 468 forks source link

[Bug] `findUnspentRecords` should not use request failure to check unspent record #829

Open shresthagrawal opened 8 months ago

shresthagrawal commented 8 months ago

🐛 Bug Report

findUnspentRecords currently calls the getTransactionId API and, upon failure, assumes that the record is unspent. Using an unspecified catch block to handle core logic is an anti-pattern. The API errors can happen for unknown reasons, which would lead to false positives.