Skip to content
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

Add seed phrase validation for keycard and status-go calls #22269

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Parveshdhull
Copy link
Member

@Parveshdhull Parveshdhull commented Mar 10, 2025

Summary

Add seed phrase validation for keycard and status-go calls

related issue: #22209 (comment)

PR don't need to be manually test, as its only adding small validation check for mnemonics. I will test it manually before merging
(done, video 1, video 2)

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Mar 10, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
3cef433 #1 2025-03-10 10:44:09 ~3 min ios 📄log
✔️ 3cef433 #1 2025-03-10 10:45:01 ~4 min tests 📄log
✔️ 3cef433 #1 2025-03-10 10:48:16 ~7 min android-e2e 🤖apk 📲
✔️ 3cef433 #1 2025-03-10 10:49:04 ~8 min android 🤖apk 📲
4646ca8 #2 2025-03-10 14:15:37 ~2 min ios 📄log
✔️ 4646ca8 #2 2025-03-10 14:21:00 ~8 min android 🤖apk 📲
✔️ 4646ca8 #2 2025-03-10 14:21:17 ~8 min android-e2e 🤖apk 📲
✔️ 4646ca8 #2 2025-03-10 14:21:49 ~8 min tests 📄log

Copy link
Member

@flexsurfer flexsurfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, left a few comments

(generateAndLoadKey mnemonic pin)
(then on-success)
(catch on-failure)))
(native-module/validate-mnemonic
Copy link
Member

@flexsurfer flexsurfer Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry i know i suggested that, but it's better to move validation outside, keycard ns shouldn't know about native-module

Copy link
Member Author

@Parveshdhull Parveshdhull Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved validation outside, but out of 4, only 2 functions are being used. So I can only apply validation there. Please let me know, if it looks ok.

@Parveshdhull Parveshdhull force-pushed the fix/add-seed-phrase-validation branch from 3cef433 to 4646ca8 Compare March 10, 2025 14:12
(fn [{:keys [mnemonic on-failure] :as args}]
(-> mnemonic
(native-module/validate-mnemonic)
(promesa/then #(keycard/generate-and-load-key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to add the mnemonic validation directly in the function generate-and-load-key? Otherwise, all devs will need to remember to call it before generate-and-load-key. Or another way to frame the question @Parveshdhull, do you think there's any situation where we shouldn't validate the mnemonic before calling generate-and-load-key?

Same question for the function create-account-from-mnemonic, is there any scenario where we don't want to validate the mnemonic? If the answer is no, then it's better to call native-module/validate-mnemonic inside native-module/create-account-from-mnemonic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @ilmotta, Thank you very much for reviewing the PR.

Wouldn't it be better to add the mnemonic validation directly in the function generate-and-load-key?

This is how I originally implemented validation, please check out #22269 (comment)

@status-im-auto
Copy link
Member

79% of end-end tests have passed

Total executed tests: 14
Failed tests: 3
Expected to fail tests: 0
Passed tests: 11
IDs of failed tests: 741839,702843,741841 

Failed tests (3)

Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 1: ## Creating open community
    Device 1: Find `Button` by `accessibility id`: `new-communities-button`

    Test setup failed: critical/chats/test_public_chat_browsing.py:339: in prepare_devices
        self.home_1.create_community(community_type="open")
    ../views/home_view.py:450: in create_community
        self.plus_community_button.click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `new-communities-button` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Class TestWalletCollectibles:

    1. test_wallet_collectibles_balance, id: 741839

    Device 1: Text is Double Spike
    Device 1: Click system back button

    critical/wallet/test_collectibles.py:94: in test_wallet_collectibles_balance
        self.errors.verify_no_errors()
    base_test_case.py:179: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: BVL image doesn't match expected template
    E    Device 1: Glitch Punks image doesn't match expected template
    



    2. test_wallet_collectible_send_from_expanded_info_view, id: 741841

    Device 1: Find Button by accessibility id: collectibles-tab

    critical/wallet/test_collectibles.py:149: in test_wallet_collectible_send_from_expanded_info_view
        self.wallet_view.collectibles_tab.click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `collectibles-tab` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Passed tests (11)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_swap_flow_mainnet, id: 741555
    2. test_wallet_add_remove_regular_account, id: 727231
    3. test_wallet_balance_mainnet, id: 740490
    4. test_wallet_bridge_flow_mainnet, id: 741612
    5. test_wallet_send_flow_mainnet, id: 741554

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletCollectibles:

    1. test_wallet_send_collectible, id: 741840

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: E2E Tests
    Development

    Successfully merging this pull request may close these issues.

    4 participants