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

[#4772] Resolve ENS domains in browser #5708

Merged
merged 1 commit into from
Sep 3, 2018

Conversation

flexsurfer
Copy link
Member

fixes #4772

@flexsurfer flexsurfer self-assigned this Aug 30, 2018
deps.edn Outdated
@@ -10,7 +10,8 @@
com.andrewmcveigh/cljs-time {:mvn/version "0.5.2"}
com.taoensso/timbre {:mvn/version "4.10.0"}
hickory {:mvn/version "0.7.1"}
com.cognitect/transit-cljs {:mvn/version "0.8.248"}}
com.cognitect/transit-cljs {:mvn/version "0.8.248"}
mvxcvi/multihash {:mvn/version "2.0.3"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need a new dependency?

Copy link
Member Author

Choose a reason for hiding this comment

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

to work with multihashes

Copy link
Contributor

Choose a reason for hiding this comment

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

So I take it there is no way to inline that functionality? Every dep increases our attack surface

Copy link
Member Author

Choose a reason for hiding this comment

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

anyway it can't be compiled

Compiling ["index.desktop.js"] from ["components/src" "react-native/src/cljsjs" "react-native/src/desktop" "src" "env/prod"]...
[31mWARNING[0m: Extending an existing JavaScript type - use a different symbol name instead of js/String e.g string at line 246 target/desktop-prod/multihash/core.cljc
Error encountered performing task 'cljsbuild' with profile(s): 'prod'

(def resolver-abi (js* "[{'constant': true, 'inputs': [{'name': 'interfaceID', 'type': 'bytes4'}], 'name': 'supportsInterface', 'outputs': [{'name': '', 'type': 'bool'}], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'contentTypes', 'type': 'uint256'}], 'name': 'ABI', 'outputs': [{'name': 'contentType', 'type': 'uint256'}, {'name': 'data', 'type': 'bytes'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'x', 'type': 'bytes32'}, {'name': 'y', 'type': 'bytes32'}], 'name': 'setPubkey', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'content', 'outputs': [{'name': 'ret', 'type': 'bytes32'}], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'addr', 'outputs': [{'name': 'ret', 'type': 'address'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'contentType', 'type': 'uint256'}, {'name': 'data', 'type': 'bytes'}], 'name': 'setABI', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'name', 'outputs': [{'name': 'ret', 'type': 'string'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'name', 'type': 'string'}], 'name': 'setName', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'hash', 'type': 'bytes32'}], 'name': 'setContent', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'pubkey', 'outputs': [{'name': 'x', 'type': 'bytes32'}, {'name': 'y', 'type': 'bytes32'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'addr', 'type': 'address'}], 'name': 'setAddr', 'outputs': [], 'payable': false, 'type': 'function'}, {'inputs': [{'name': 'ensAddr', 'type': 'address'}], 'payable': false, 'type': 'constructor'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'a', 'type': 'address'}], 'name': 'AddrChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'hash', 'type': 'bytes32'}], 'name': 'ContentChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'name', 'type': 'string'}], 'name': 'NameChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': true, 'name': 'contentType', 'type': 'uint256'}], 'name': 'ABIChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'x', 'type': 'bytes32'}, {'indexed': false, 'name': 'y', 'type': 'bytes32'}], 'name': 'PubkeyChanged', 'type': 'event'}]"))
(def default-address "0x0000000000000000000000000000000000000000")
(def default-hash "0x0000000000000000000000000000000000000000000000000000000000000000")

Copy link
Contributor

Choose a reason for hiding this comment

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

Why this? Can't we do the same way as it's done for others field in the ens namespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's temporary solutions while #5459 not merged

Copy link
Member Author

Choose a reason for hiding this comment

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

oh right if we're going with content field we can use same way

(handlers/register-handler-fx
:browse-link-from-message
(fn [_ [_ link]]
{:browse link}))

(handlers/register-handler-fx
:ens-multihash-resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

So we are supporting multihash?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes but it's stored in content field

(handlers/register-handler-fx
:browse-link-from-message
(fn [_ [_ link]]
{:browse link}))

(handlers/register-handler-fx
:ens-multihash-resolved
[re-frame/trim-v]
Copy link
Contributor

Choose a reason for hiding this comment

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

can you clean up the trim-v co-effect, we are removing them to have a more consistent codebase

(handlers/register-handler-fx
:ens-multihash-resolved
[re-frame/trim-v]
(fn [{:keys [db] :as cofx} [hash]]
Copy link
Contributor

Choose a reason for hiding this comment

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

ideally events should be one-liners that call a function from the models

@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #4

Mobile
Desktop

@asemiankevich asemiankevich self-assigned this Aug 31, 2018
@statustestbot
Copy link

88% of end-end tests have passed

Total executed tests: 58
Failed tests: 7
Passed tests: 51

Failed tests (7)

Click to expand
1. test_logcat_send_transaction_from_daap

Device 1: Tap on SignTransactionButton
Device 1: Wait for ProgressBar

Device 1: 'GotItButton' is not found on the screen, also Unexpected Alert is shown: 'known transaction: a26f612677fdea5a2f5d55538aa96621921fad82f6d0d39702183312341cd5ad'

Device sessions

2. test_token_with_more_than_allowed_decimals

Device 1: Type '0.06150531' to AmountEditBox
Device 1: Looking for an element by text: 'Amount is too precise. Max number of decimals is 7.'

Warning about too precise amount is not shown when requesting a transaction

Device sessions

3. test_resend_message_offline

Device 2: Looking for a message by text: 'test message'
Device 2: Wait for ChatElementByText

Message with text 'test message' is not received

Device sessions

4. test_send_stt_from_wallet

Device 1: Tap on SignTransactionButton
Device 1: Wait for ProgressBar

Device 1: 'GotItButton' is not found on the screen, also Unexpected Alert is shown: 'replacement transaction underpriced'

Device sessions

5. test_send_eth_from_wallet_to_contact

Device 1: Wait for ProgressBar
Device 1: Tap on GotItButton

Expecting value: line 1 column 1 (char 0)

Device sessions

6. test_request_eth_in_wallet

Device 2: Wait for ChatMessageInput
Device 2: Looking for a message by text: '0.0831142639'

Request funds message was not received

Device sessions

7. test_transaction_confirmed_on_recipient_side

Device 2: Wait for ChatMessageInput
Device 2: Looking for a message by text: '0.083114194'

Device 2: Status "Confirmed" is not shown under transaction for the recipient

Device sessions

Passed tests (51)

Click to expand
1. test_create_account
Device sessions

2. test_filters_from_daap
Device sessions

3. test_copy_and_paste_messages
Device sessions

4. test_send_transaction_from_daap
Device sessions

5. test_request_and_receive_tokens_in_1_1_chat
Device sessions

6. test_delete_cut_and_paste_messages
Device sessions

7. test_deploy_contract_from_daap
Device sessions

8. test_public_chat_messaging
Device sessions

9. test_back_forward_buttons_browsing_website
Device sessions

10. test_password_in_logcat_sign_in
Device sessions

11. test_set_profile_picture
Device sessions

12. test_text_message_1_1_chat
Device sessions

13. test_add_to_contacts
Device sessions

14. test_home_view
Device sessions

15. test_send_and_open_links
Device sessions

16. test_transaction_message_sending_from_wallet
Device sessions

17. test_copy_contact_code_and_wallet_address
Device sessions

18. test_logcat_send_transaction_from_wallet
Device sessions

19. test_message_marked_as_sent_and_seen_1_1_chat
Device sessions

20. test_send_token_with_7_decimals
Device sessions

21. test_offline_messaging_1_1_chat
Device sessions

22. test_send_eth_from_wallet_to_address
Device sessions

23. test_send_transaction_details_in_1_1_chat
Device sessions

24. test_request_eth_in_status_test_dapp
Device sessions

25. test_manage_assets
Device sessions

26. test_wallet_set_up
Device sessions

27. test_logcat_send_transaction_in_1_1_chat
Device sessions

28. test_request_and_receive_eth_in_1_1_chat
Device sessions

29. test_swipe_to_delete_public_chat
Device sessions

30. test_send_emoji
Device sessions

31. test_add_contact_by_pasting_public_key
Device sessions

32. test_logcat_recovering_account
Device sessions

33. test_messaging_in_different_networks
Device sessions

34. test_send_tokens_in_1_1_chat
Device sessions

35. test_network_mismatch_for_send_request_commands
Device sessions

36. test_logcat_sign_message_from_daap
Device sessions

37. test_swipe_to_delete_1_1_chat
Device sessions

38. test_send_eth_in_1_1_chat
Device sessions

39. test_login_with_new_account
Device sessions

40. test_add_contact_from_public_chat
Device sessions

41. test_send_request_not_enabled_tokens
Device sessions

42. test_send_message_to_newly_added_contact
Device sessions

43. test_password_in_logcat_creating_account
Device sessions

44. test_backup_recovery_phrase
Device sessions

45. test_transaction_confirmed_on_sender_side
Device sessions

46. test_offline_status
Device sessions

47. test_open_google_com_via_open_dapp
Device sessions

48. test_sign_message_from_daap
Device sessions

49. test_share_contact_code_and_wallet_address
Device sessions

50. test_refresh_button_browsing_app_webview
Device sessions

51. test_recover_account
Device sessions

@asemiankevich
Copy link
Contributor

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
@flexsurfer flexsurfer merged commit c96bc5a into develop Sep 3, 2018
@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #5

Mobile
Desktop

@rasom rasom deleted the feature/browser-ens-support branch September 3, 2018 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Draft] Resolve ENS domains in browser
7 participants