Attempting to send amounts >= max supply crashes the app #3

Closed
opened 1 year ago by duke · 1 comments
duke commented 1 year ago
Owner

This a bug from upstream. It's not urgent but would be nice to fix.

This a bug from upstream. It's not urgent but would be nice to fix.
fekt commented 1 year ago
Collaborator

I think this is a simple fix in the SDK here:
https://git.hush.is/hush/hush-android-wallet-sdk/src/branch/main/sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/Zatoshi.kt#L13

The use of require specifically throws an IllegalArgumentException if the value is false. We can remove or comment it out. It should still validate amount against balance and not allow sending funds in amounts greater than balance, telling you to go back and send no more than x HUSH.

For reference, changing anything in the SDK requires compiling the SDK and publishing to mavenLocal first. Then you compile the app for it to use the updated SDK. I tried publishing the SDK to Jitpack originally, but they are unable to compile Rust. The build fails on their end so I left as local build for now.

I think this is a simple fix in the SDK here: https://git.hush.is/hush/hush-android-wallet-sdk/src/branch/main/sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/Zatoshi.kt#L13 The use of `require` specifically throws an IllegalArgumentException if the value is false. We can remove or comment it out. It should still validate amount against balance and not allow sending funds in amounts greater than balance, telling you to go back and send no more than x HUSH. For reference, changing anything in the SDK requires compiling the SDK and publishing to mavenLocal first. Then you compile the app for it to use the updated SDK. I tried publishing the SDK to Jitpack originally, but they are unable to compile Rust. The build fails on their end so I left as local build for now.
fekt closed this issue 9 months ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.