zcash-android-wallet-sdk icon indicating copy to clipboard operation
zcash-android-wallet-sdk copied to clipboard

WalletTransactionEncoder - createShieldingSpend() - improve implementation

Open HonzaR opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Filling an additional issue to provide a link to the code base TODO occurrence.

We'd like to enhance try/catch in WalletTransactionEncoder#createShieldingSpend to: If this error matches: Insufficient balance (have 0, need 1000 including fee) then consider custom error that says no UTXOs existed to shield

HonzaR avatar Aug 19 '22 09:08 HonzaR

We are now doing this in the new TransactionEncoder.proposeShielding method by returning Proposal?, with null meaning either there were no UTXOs to shield, or the balance to shield was below the shielding threshold. createShieldingSpend will be removed in 2.1.0 as its corresponding Synchronizer method is being deprecated.

str4d avatar Feb 28 '24 00:02 str4d

If this error matches: Insufficient balance (have 0, need 1000 including fee) then consider custom error that says no UTXOs existed to shield.

That is dependent on the pre-ZIP-317 fee amount. In general it is fragile to match on error strings.

daira avatar Mar 08 '24 04:03 daira