dedis / popstellar

Proof-of-personhood System
GNU Affero General Public License v3.0
35 stars 8 forks source link

Need for a Scanning Action to Send Coins #1866

Open Kaz-ookid opened 5 months ago

Kaz-ookid commented 5 months ago

Description (Actual behavior)

In the LAO/Digital Cash tab, there is a feature where you can produce a QR code for other people to scan and send you coins. But no way to scan is yet provided.

Expected behavior

Have a button in the Digital Cash tab to be able to scan a peer's QR code for receiving coins. Actual UI for now: image

Proposed solution

Check ScanningAction enum, where you should create a scanning action following the examples of other implementations. Please, use string resources, and put them at the same place as others (for titles and hints), with the same name format.

in QrScannerFragment, your input will be sent in onResult. Don't forget to handle manual input. You will probably have to create a redefinition of scanningViewModel.handleData(data). There are plenty of other scanning actions that will help understand how to implement all this.

Please make sure to create some simple tests, especially with the manual input. Once again, check how other scanning actions are being tested!

Workaround

We can manually select the peer's token to send to.

Impact

User experience only. Coins are not even used that much yet, so this is not an urgent issue. It just makes more sense that we can actually scan QR codes if we are given one.