-
Notifications
You must be signed in to change notification settings - Fork 113
frontends/tests: add AOPP flow test. #3694
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
base: master
Are you sure you want to change the base?
Conversation
|
Adding @thisconnect mostly for the test logic/ts code and @benma for the aoppserver (vibe-coded with ChatGPT, so please feel free to tear it apart). |
thisconnect
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a small nit about data-testid and a question/comment.
Deferring to @benma for the aopp/server.py test backend
| await test.step('Send RBTC to receive address', async () => { | ||
| await page.waitForTimeout(2000); | ||
| const sendAmount = '10'; | ||
| await sendCoins(recvAdd, sendAmount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is only 1 account the aopp workflow will have one less step (the step with the account selector).
Similarly to this: if the device is not yet connected&unlocked the aopp overlay will close and only show a small single banner "Address request in progress. Please connect your device to continue.
"
... on the waiting view (or if watch-only is active on top of the account-summary). After device unlock the app jumps back into the AOPP workflow.
Both cases sounds like something that could be tested here, but maybe it would make the tests much more complicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are both sensible things to test! I'll definitely add both
3c45cad to
8547a65
Compare
thisconnect
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you 🙏
LGTM
.github/workflows/playwright.yml
Outdated
| sudo apt-get update | ||
| sudo apt-get install -y build-essential libffi-dev libssl-dev libsecp256k1-dev python3-dev | ||
| pip install --upgrade pip | ||
| pip install flask coincurve bech32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these tests be run inside Docker? If so, should we add this to the Dockerfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need something more to be able to run these tests in Docker (for example, I don't think we can run the regtest script inside docker 😅). I think it would be worth trying but out of scope for this PR, wdyt?
| msg = uri[msg_start + 4:] if msg_end == -1 else uri[msg_start + 4:msg_end] | ||
|
|
||
| sig_bytes = proof.signature | ||
| if len(sig_bytes) == 64: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and else? 😄
| import uuid | ||
| import hashlib | ||
| import base64 | ||
| from coincurve import PublicKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using the ecdsa library, it's what we use in most other tooling and is also available in the Docker image already. It has support for the secp256k1 curve.
efb7832 to
8de186f
Compare
|
@benma I did a big refactor of the aopp server, based on your feedback and the fact that it was actually broken 😅 Can you please take another look? thanks! |
Before asking for reviews, here is a check list of the most common things you might need to consider: