-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution Proposed about UI feature #20 #22
Conversation
This is a draft solution to discuss with developer is the Validator solution is a good solution or I'm losing somethings important. If the solution, like at developer I will require the lock on the issue. Commit built by @vincenzopalazzo [email protected]
Hi @vincenzopalazzo, I think you are enjoying with kotlin :-) At 1st review, I would avoid that a mainnet clightning user scans a testnet bitcoin address and the validation pass. |
Hi @lvaccaro,
I little bit 😄
Great, I will make this control |
Just to echo the discussion in #20 :
|
Hi @darosior,
I noted just now this with a test on my java RPC wrapper, anyway I think, that is possible to make a double check before that lamp runs the command. Maybe we can use the RPC error from |
To be honest that seems to be belt and suspenders
-------- Original Message --------
…On Jul 14, 2020, 00:49, Vincenzo Palazzo wrote:
Hi ***@***.***(https://github.com/lvaccaro),
> lightningd's withdraw will not accept such an address and return a nice JSONRPC error.
I noted just now this with a test on my java RPC wrapper, anyway I think, that is possible to make a double check before that lamp runs the command. Maybe we can use the RPC error from withdraw to check any error in my bitcoin address type parser :) Today I will add this check
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](https://github.com/lvaccaro/lamp/pull/22#issuecomment-657884484), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFLK3F27LEQ6HAN4XXGZH5LR3OMR7ANCNFSM4OYGI4FA).
|
This commit contains the structure of the dialog and also contains a couple of comment about the problem that this solution have yet, and also about the possible solutions. Commit built by @vincenzopalazzo [email protected]
I hope that " to be belt and suspenders" have the same mining that has in America :) |
Comment built from @vincenzopalazzo vincenzopalazzo
I made more tests on bitcoin URI validator and I fixed some bugs, also I added the java reference implementation lib to parse the URI. I opted to use a dialog and not a new activity to display the data in the URI but is possible to create an activity and give the possibility to the user to create the withdraw also without URI, such as the withdraw setting. At the moment I the app look like the gif above In this case, the error is caused by the different networks, in fact, I have c-lightning node on testnet and the URI is from mainet. The check is built with If you want test it, you can found my testnet network with the following address This is only a proposed for the bitcoin dialog, but I'm ready also to change it with activity and also, this commit includes the check for the network that we discussed on this PR. The are other work to do on the layout. |
Hi @vincenzopalazzo, adding some notes:
|
Hi @lvaccaro, Thanks for your comment
I agree with you, for the moment I will remove my dialog and we can you your fragment to make a withdraw. If will be necessary somethings a little too complex, e.g: Setting a personal fee. We can thing to migrate these inside a new activity a make the UI a little bit more complex.
I add the answer to the comment above, I agree with you. We can leave the BottomSheetDialogFragment
Yep, I love your refactoring, i think that the class MainActivity is too big 😄
I lose this passage when I read your PR #25, I will come back to read it and understend but I added an comment inside the method Tomorrow I will conclude this PR and you can make the final check if you want marge it. After that I can help you on another task, also I want resolve the problem about the clean app data because sometimes is not possible and I don't understand why |
This is a draft solution to discuss with developer is the Validator solution is a good solution or I'm losing somethings important. If the solution, like at developer I will require the lock on the issue. Commit built by @vincenzopalazzo [email protected]
This commit contains the structure of the dialog and also contains a couple of comment about the problem that this solution have yet, and also about the possible solutions. Commit built by @vincenzopalazzo [email protected]
Comment built from @vincenzopalazzo vincenzopalazzo
This contains a possible solution with the new refactoring of MainActivity. The next and last step is the refactoring and remove the bad&old code inside the app. Commit built by @vincenzopalazzo [email protected]
Hi @lvaccaro, I want to make an update with my work on this PR, I think that this is my first complete proposed that support the following operations
All types of text are validated before to pass at the lightningd command with the In addition, I added a Switch component to support the send all amount inside the withdraw fragment (discussed inside the issue #26), and also I added a little padding inside the I introduced a class called This PR includes another dependence to import the java reference implementation of bip21 I hope this work can help you, and thanks for your time. |
Thanks.. |
Hi @lvaccaro, Absolutely yes I can restore my parsing string logic in a couple of commit before, sorry about this |
thanks, sorry but I starting the code review only now. |
Hi @lvaccaro, I'm sorry I lost the jar particular, is my error :) but with the validator, the change is not very difficult :) |
Hi @lvaccaro, I update the version of code with the last version of the master branch, and I removed the dependence and I add more tests about the URI parser. The Validator should support the bip21 and I remade the UI test about the scanning different types of QR and I received the correct behaviors, but more tests are welcome. Please, if there are some other errors, let me know. |
ack 8bc3d6e |
@lvaccaro I don't push the message sorry. Yep, I change the version inside the travis. Sorry about that. |
No problem, https://github.com/lvaccaro/lamp/pull/31 should fix |
@lvaccaro ops, I create a java file. Sorry about that, I miss to check files extension |
Hi @lvaccaro,
I read the UI feature published by @darosior and I try to implement a solution about the feature described inside the issue #20
This is a draft solution because I never tried before to check a bitcoin url from the camera. For this reason, I don't know if the solution proposed is good or is very stupid, and please if it is very stupid, ignore this PRs and don't lose your time here :)
The solution proposed, try to understand only if the URL has a standard format like a bitcoin address, I don't make the validation of it because we can know if the address is correct from the lightning command result.
So, at the moment, this solution runs in only in two situations (Tested only with the copy from clipboard):
3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX
the command that clightning run islightning-cli withdraw 3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX all
bitcoin:2NFmhFFEbR2ruAboRZ8gxCeDez81c3ByZeV?amount=102.00000000
lightning run the following commandlightning-cli withdraw 2NFmhFFEbR2ruAboRZ8gxCeDez81c3ByZeV 102.00000000
(Maybe in this cases lightning can return an error because the amount has a bad format)My transaction on testnet with lamp to make a small test. tx-status
The next feature to implement inside this solution is the following
Again, this is a draft solution to discuss with the developers is the Validator solution is a good solution or I'm losing something important. If the solution likes it to developers I will require the lock on issue #20.