diff --git a/storybook/pages/ConnectDAppModalPage.qml b/storybook/pages/ConnectDAppModalPage.qml
index 248ebf13ec..ed58d7dbb9 100644
--- a/storybook/pages/ConnectDAppModalPage.qml
+++ b/storybook/pages/ConnectDAppModalPage.qml
@@ -27,42 +27,17 @@ import shared.stores 1.0
Item {
id: root
- function openModal() {
- modal.openWithFilter([1, 42161], JSON.parse(`{
- "metadata": {
- "description": "React App for WalletConnect",
- "icons": [
- "https://avatars.githubusercontent.com/u/37784886"
- ],
- "name": "React App",
- "url": "https://react-app.walletconnect.com",
- "verifyUrl": "https://verify.walletconnect.com"
- },
- "publicKey": "300a6a1df4cb0cd73eb652f11845f35a318541eb18ab369860be85c0c2ada54a"
- }`))
- if (pairedCheckbox.checked) {
- pairedResultTimer.restart()
- }
- }
-
// qml Splitter
SplitView {
anchors.fill: parent
- ColumnLayout {
+ PopupBackground {
SplitView.fillWidth: true
- Component.onCompleted: root.openModal()
-
- StatusButton {
- id: openButton
-
- Layout.alignment: Qt.AlignHCenter
- Layout.margins: 20
-
- text: "Open ConnectDAppModal"
-
- onClicked: root.openModal()
+ Button {
+ text: "Open"
+ onClicked: modal.open()
+ anchors.centerIn: parent
}
ConnectDAppModal {
@@ -70,6 +45,11 @@ Item {
anchors.centerIn: parent
+ modal: false
+ closePolicy: Popup.NoAutoClose
+
+ visible: true
+
spacing: 8
accounts: WalletAccountsModel {}
@@ -78,9 +58,12 @@ Item {
sourceModel: NetworksModel.flatNetworks
filters: ValueFilter { roleName: "isTest"; value: false; }
}
- }
- ColumnLayout {}
+ dAppUrl: dAppUrlField.text
+ dAppName: dAppNameField.text
+ dAppIconUrl: hasIconCheckbox.checked ? "https://avatars.githubusercontent.com/u/37784886" : ""
+ connectionStatus: pairedCheckbox.checked ? pairedStatusCheckbox.checked ? connectionSuccessfulStatus : connectionFailedStatus : notConnectedStatus
+ }
}
ColumnLayout {
@@ -100,6 +83,29 @@ Item {
checked: true
}
+ CheckBox {
+ id: hasIconCheckbox
+
+ text: "Has Icon"
+
+ checked: true
+ }
+ Label {
+ text: "DappName"
+ }
+ TextField {
+ id: dAppNameField
+
+ text: "React App"
+ }
+ Label {
+ text: "DApp URL"
+ }
+ TextField {
+ id: dAppUrlField
+
+ text: "https://react-app.walletconnect.com"
+ }
Item { Layout.fillHeight: true }
}
}
@@ -111,13 +117,7 @@ Item {
running: false
repeat: false
onTriggered: {
- if (pairedCheckbox.checked) {
- if (pairedStatusCheckbox.checked) {
- modal.pairSuccessful(null)
- } else {
- modal.pairFailed(null, "Pairing failed")
- }
- }
+
}
}
}
diff --git a/storybook/pages/ConnectionStatusTagPage.qml b/storybook/pages/ConnectionStatusTagPage.qml
new file mode 100644
index 0000000000..7123df2656
--- /dev/null
+++ b/storybook/pages/ConnectionStatusTagPage.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+
+import shared.popups.walletconnect 1.0
+
+Item {
+ id: root
+
+ ConnectionStatusTag {
+ id: connectionTag
+ anchors.centerIn: parent
+ success: checkbox.checked
+ }
+
+ CheckBox {
+ id: checkbox
+ anchors.bottom: connectionTag.top
+ anchors.horizontalCenter: connectionTag.horizontalCenter
+ text: "success"
+ checked: false
+ }
+}
+
+// category: Components
+// https://www.figma.com/design/HrmZp1y4S77QJezRFRl6ku/dApp-Interactions---Milestone-1?node-id=481-165960&t=oshb3aHNPCiUcQdH-0
\ No newline at end of file
diff --git a/storybook/pages/DAppsWorkflowPage.qml b/storybook/pages/DAppsWorkflowPage.qml
index 63b54f2199..212b79b637 100644
--- a/storybook/pages/DAppsWorkflowPage.qml
+++ b/storybook/pages/DAppsWorkflowPage.qml
@@ -18,6 +18,7 @@ import Models 1.0
import Storybook 1.0
import AppLayouts.Wallet.controls 1.0
+import AppLayouts.Wallet.stores 1.0 as WalletStores
import AppLayouts.Wallet.services.dapps 1.0
import SortFilterProxyModel 0.2
@@ -314,13 +315,18 @@ Item {
}
}
- walletStore: WalletStore {
- property var flatNetworks: SortFilterProxyModel {
+ walletRootStore: WalletStores.RootStore {
+ property string selectedAddress: ""
+ property var filteredFlatModel: SortFilterProxyModel {
sourceModel: NetworksModel.flatNetworks
filters: ValueFilter { roleName: "isTest"; value: settings.testNetworks; }
}
property var accounts: customAccountsModel.count > 0 ? customAccountsModel : defaultAccountsModel
- readonly property ListModel ownAccounts: accounts
+ readonly property ListModel nonWatchAccounts: accounts
+
+ function getNetworkShortNames(chainIds) {
+ return "eth:oeth:arb"
+ }
}
onDisplayToastMessage: (message, isErr) => {
diff --git a/storybook/pages/RoundImageWithBadgePage.qml b/storybook/pages/RoundImageWithBadgePage.qml
new file mode 100644
index 0000000000..0fc24fd9f4
--- /dev/null
+++ b/storybook/pages/RoundImageWithBadgePage.qml
@@ -0,0 +1,52 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.15
+
+import shared.popups.walletconnect 1.0
+
+SplitView {
+ Pane {
+ SplitView.fillWidth: true
+ SplitView.fillHeight: true
+
+ RoundImageWithBadge {
+ id: roundImageWithBadge
+
+ width: parent.width
+ height: width
+ imageUrl: addressField.text
+ badgeIcon: badgeField.text
+ fallbackIcon: fallbackIconField.text
+ }
+ }
+
+ Pane {
+ id: controlsPane
+ SplitView.fillHeight: true
+ SplitView.preferredWidth: 300
+ ColumnLayout {
+ Label { text: "Image url" }
+ TextField {
+ id: addressField
+ text: "https://picsum.photos/200/200"
+ Layout.fillWidth: true
+ }
+ Label { text: "Badge name" }
+ TextField {
+ id: badgeField
+ text: "walletConnect"
+ Layout.fillWidth: true
+ }
+ Label { text: "Fallback icon name" }
+ TextField {
+ id: fallbackIconField
+ text: "dapp"
+ Layout.fillWidth: true
+ }
+ }
+ }
+}
+
+// category: Components
+
+// https://www.figma.com/design/HrmZp1y4S77QJezRFRl6ku/dApp-Interactions---Milestone-1?node-id=481-160233&t=xyix3QX5I3jxrDir-0
\ No newline at end of file
diff --git a/storybook/qmlTests/tests/tst_ConnectDAppModal.qml b/storybook/qmlTests/tests/tst_ConnectDAppModal.qml
new file mode 100644
index 0000000000..4affea393c
--- /dev/null
+++ b/storybook/qmlTests/tests/tst_ConnectDAppModal.qml
@@ -0,0 +1,319 @@
+import QtQuick 2.15
+import QtTest 1.15
+
+import shared.popups.walletconnect 1.0
+
+import Models 1.0
+
+Item {
+ id: root
+ width: 600
+ height: 800
+
+ Component {
+ id: accountsModelComponent
+ WalletAccountsModel {}
+ }
+
+ Component {
+ id: componentUnderTest
+ ConnectDAppModal {
+ id: controlUnderTest
+ modal: false
+ anchors.centerIn: parent
+ accounts: WalletAccountsModel {}
+ flatNetworks: NetworksModel.flatNetworks
+ }
+ }
+
+ TestCase {
+ id: testConnectDappModal
+ name: "ConnectDappModalTest"
+ when: windowShown
+
+ SignalSpy {
+ id: connectSignalSpy
+ target: testConnectDappModal.dappModal
+ signalName: "connect"
+ }
+
+ SignalSpy {
+ id: declineSignalSpy
+ target: testConnectDappModal.dappModal
+ signalName: "decline"
+ }
+
+ SignalSpy {
+ id: disconnectSignalSpy
+ target: testConnectDappModal.dappModal
+ signalName: "disconnect"
+ }
+
+ property ConnectDAppModal dappModal: null
+
+ function cleanup() {
+ connectSignalSpy.clear()
+ declineSignalSpy.clear()
+ disconnectSignalSpy.clear()
+ }
+
+ function test_initialState() {
+ dappModal = createTemporaryObject(componentUnderTest, root, {visible: true})
+
+ verify(dappModal.visible, "ConnectDAppModal should be visible")
+ verify(dappModal.accounts, "ConnectDAppModal should have accounts")
+ verify(dappModal.flatNetworks, "ConnectDAppModal should have networks")
+
+ compare(dappModal.width, 480)
+ compare(dappModal.height, 633)
+ compare(dappModal.dAppName, "")
+ compare(dappModal.dAppUrl, "")
+ compare(dappModal.dAppIconUrl, "")
+ compare(dappModal.connectionStatus, dappModal.notConnectedStatus)
+ }
+
+ function test_notConnectedState() {
+ dappModal = createTemporaryObject(componentUnderTest, root, {visible: true})
+
+ compare(dappModal.connectionStatus, dappModal.notConnectedStatus)
+
+ // Reject button should be enabled
+ const rejectButton = findChild(dappModal, "rejectButton")
+ verify(rejectButton, "Reject button should be present")
+ compare(rejectButton.text, "Reject")
+ compare(rejectButton.enabled, true)
+ mouseClick(rejectButton)
+ compare(declineSignalSpy.count, 1)
+
+ // Connect button should be enabled
+ const connectButton = findChild(dappModal, "primaryActionButton")
+ verify(connectButton, "Connect button should be present")
+ compare(connectButton.text, "Connect")
+ compare(connectButton.enabled, true)
+ mouseClick(connectButton)
+ compare(connectSignalSpy.count, 1)
+
+ // Disconnect button should be disabled
+ const disconnectButton = findChild(dappModal, "disconnectButton")
+ verify(disconnectButton, "Disconnect button should be present")
+ compare(disconnectButton.text, "Disconnect")
+ compare(disconnectButton.visible, false)
+ mouseClick(disconnectButton)
+ compare(disconnectSignalSpy.count, 0)
+
+ // Account selector should be enabled and user should be able to select an account
+ const accountSelector = findChild(dappModal, "accountSelector")
+ verify(accountSelector, "Account selector should be present")
+ compare(accountSelector.enabled, true)
+ compare(accountSelector.currentIndex, 0)
+ mouseClick(accountSelector)
+ compare(accountSelector.popup.visible, true)
+
+ waitForItemPolished(accountSelector.popup.contentItem)
+
+ const accountsList = findChild(accountSelector, "accountSelectorList")
+ verify(accountsList, "Accounts list should be present")
+ const selectAddress = accountsList.itemAtIndex(1).address
+ mouseClick(accountsList.itemAtIndex(1))
+ compare(dappModal.selectedAccountAddress, accountSelector.currentAccountAddress)
+ compare(dappModal.selectedAccountAddress, selectAddress)
+
+ // Chain selector is enabled, all common chains preselected
+ const chainSelector = findChild(dappModal, "networkFilter")
+ verify(chainSelector, "Chain selector should be present")
+ compare(chainSelector.enabled, true)
+ compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
+ compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count)
+
+ // User should be able to deselect a chain
+ mouseClick(chainSelector)
+ waitForItemPolished(chainSelector)
+ const networkSelectorList = findChild(chainSelector, "networkSelectorList")
+ verify(networkSelectorList, "Network selector list should be present")
+ mouseClick(networkSelectorList.itemAtIndex(0))
+ compare(chainSelector.selection.length, NetworksModel.flatNetworks.count - 1)
+ compare(chainSelector.selection[0], NetworksModel.flatNetworks.get(1).chainId)
+ compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count - 1)
+ compare(dappModal.selectedChains[0], NetworksModel.flatNetworks.get(1).chainId)
+ }
+
+ function test_connectedState() {
+ dappModal = createTemporaryObject(componentUnderTest, root, {visible: true})
+ dappModal.pairSuccessful()
+ compare(dappModal.connectionStatus, dappModal.connectionSuccessfulStatus)
+
+ // Reject button should not be visible
+ const rejectButton = findChild(dappModal, "rejectButton")
+ verify(rejectButton, "Reject button should be present")
+ compare(rejectButton.visible, false)
+ mouseClick(rejectButton)
+ compare(declineSignalSpy.count, 0)
+
+ // Close button should be enabled
+ const closeButton = findChild(dappModal, "primaryActionButton")
+ verify(closeButton, "Close button should be present")
+ compare(closeButton.text, "Close")
+ compare(closeButton.enabled, true)
+ compare(closeButton.visible, true)
+ mouseClick(closeButton)
+ compare(dappModal.opened, false)
+ dappModal.open()
+
+ // Disconnect button should be enabled
+ const disconnectButton = findChild(dappModal, "disconnectButton")
+ verify(disconnectButton, "Disconnect button should be present")
+ compare(disconnectButton.text, "Disconnect")
+ compare(disconnectButton.visible, true)
+ compare(disconnectButton.enabled, true)
+ mouseClick(disconnectButton)
+ compare(disconnectSignalSpy.count, 1)
+
+ // Account selector should be disabled
+ const accountSelector = findChild(dappModal, "accountSelector")
+ verify(accountSelector, "Account selector should be present")
+ compare(accountSelector.currentIndex, 0)
+ mouseClick(accountSelector)
+ compare(accountSelector.popup.visible, false)
+
+ // Chain selector is disabled
+ const chainSelector = findChild(dappModal, "networkFilter")
+ verify(chainSelector, "Chain selector should be present")
+ compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
+
+ // User should not be able to deselect a chain
+ mouseClick(chainSelector)
+ waitForItemPolished(chainSelector)
+ const networkSelectorList = findChild(chainSelector, "networkSelectorList")
+ verify(networkSelectorList, "Network selector list should be present")
+ mouseClick(networkSelectorList.itemAtIndex(0))
+ compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
+ compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count)
+
+ const connectionTag = findChild(dappModal, "connectionStatusTag")
+ compare(connectionTag.visible, true)
+ compare(connectionTag.success, true)
+ }
+
+ function test_connectionFailedState() {
+ dappModal = createTemporaryObject(componentUnderTest, root, {visible: true})
+ dappModal.pairFailed()
+ compare(dappModal.connectionStatus, dappModal.connectionFailedStatus)
+
+ // Reject button should not be visible
+ const rejectButton = findChild(dappModal, "rejectButton")
+ verify(rejectButton, "Reject button should be present")
+ compare(rejectButton.visible, false)
+ mouseClick(rejectButton)
+ compare(declineSignalSpy.count, 0)
+
+ // Close button should be enabled
+ const closeButton = findChild(dappModal, "primaryActionButton")
+ verify(closeButton, "Close button should be present")
+ compare(closeButton.text, "Close")
+ compare(closeButton.enabled, true)
+ compare(closeButton.visible, true)
+ mouseClick(closeButton)
+ compare(dappModal.opened, false)
+ dappModal.open()
+
+ // Disconnect button should not be visible
+ const disconnectButton = findChild(dappModal, "disconnectButton")
+ verify(disconnectButton, "Disconnect button should be present")
+ compare(disconnectButton.text, "Disconnect")
+ compare(disconnectButton.visible, false)
+ mouseClick(disconnectButton)
+ compare(disconnectSignalSpy.count, 0)
+
+ // Account selector should be disabled
+ const accountSelector = findChild(dappModal, "accountSelector")
+ verify(accountSelector, "Account selector should be present")
+ compare(accountSelector.currentIndex, 0)
+ mouseClick(accountSelector)
+ compare(accountSelector.popup.visible, false)
+
+ // Chain selector is disabled
+ const chainSelector = findChild(dappModal, "networkFilter")
+ verify(chainSelector, "Chain selector should be present")
+ compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
+
+ // User should not be able to deselect a chain
+ mouseClick(chainSelector)
+ waitForItemPolished(chainSelector)
+ const networkSelectorList = findChild(chainSelector, "networkSelectorList")
+ verify(networkSelectorList, "Network selector list should be present")
+ mouseClick(networkSelectorList.itemAtIndex(0))
+ compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
+ compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count)
+
+ const connectionTag = findChild(dappModal, "connectionStatusTag")
+ compare(connectionTag.visible, true)
+ compare(connectionTag.success, false)
+ }
+
+ function test_selectingAccount() {
+ dappModal = createTemporaryObject(componentUnderTest, root, {visible: true, dAppChains: [1, 11155111]})
+
+ const accountSelector = findChild(dappModal, "accountSelector")
+ verify(accountSelector, "Account selector should be present")
+ compare(accountSelector.currentIndex, 0)
+ mouseClick(accountSelector)
+ compare(accountSelector.popup.visible, true)
+
+ waitForItemPolished(accountSelector.popup.contentItem)
+
+ const accountsList = findChild(accountSelector, "accountSelectorList")
+ verify(accountsList, "Accounts list should be present")
+ compare(accountsList.count, dappModal.accounts.count)
+
+ const selectAddress = accountsList.itemAtIndex(1).address
+ mouseClick(accountsList.itemAtIndex(1))
+ compare(dappModal.selectedAccountAddress, accountSelector.currentAccountAddress)
+ compare(dappModal.selectedAccountAddress, selectAddress)
+
+ const preselectedAddress = accountSelector.currentAccountAddress
+
+ mouseClick(accountSelector)
+ compare(accountSelector.popup.visible, true)
+
+ waitForItemPolished(accountSelector.popup.contentItem)
+ const selectAddress1 = accountsList.itemAtIndex(0).address
+ mouseClick(accountsList.itemAtIndex(0))
+ compare(dappModal.selectedAccountAddress, accountSelector.currentAccountAddress)
+ compare(dappModal.selectedAccountAddress, selectAddress1)
+
+ // Use preselected address
+ dappModal.selectedAccountAddress = preselectedAddress
+ compare(accountSelector.currentAccountAddress, preselectedAddress)
+ }
+
+ function test_chainSelection() {
+ dappModal = createTemporaryObject(componentUnderTest, root, {visible: true})
+
+ const chainSelector = findChild(dappModal, "networkFilter")
+ verify(chainSelector, "Chain selector should be present")
+ // All selected
+ compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
+ compare(chainSelector.selection[0], NetworksModel.flatNetworks.get(0).chainId)
+ compare(chainSelector.selection[1], NetworksModel.flatNetworks.get(1).chainId)
+
+ // User should be able to deselect a chain
+ mouseClick(chainSelector)
+ waitForItemPolished(chainSelector)
+ const networkSelectorList = findChild(chainSelector, "networkSelectorList")
+ verify(networkSelectorList, "Network selector list should be present")
+ mouseClick(networkSelectorList.itemAtIndex(0))
+ compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count - 1)
+ compare(dappModal.selectedChains[0], NetworksModel.flatNetworks.get(1).chainId)
+
+ waitForItemPolished(networkSelectorList)
+ mouseClick(networkSelectorList.itemAtIndex(1))
+ compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count - 2)
+ compare(dappModal.selectedChains[0], NetworksModel.flatNetworks.get(2).chainId)
+
+ const connectButton = findChild(dappModal, "primaryActionButton")
+ verify(!!connectButton, "Connect button should be present")
+ compare(connectButton.visible, true)
+ compare(connectButton.enabled, true)
+ }
+ }
+}
\ No newline at end of file
diff --git a/storybook/qmlTests/tests/tst_DAppsWorkflow.qml b/storybook/qmlTests/tests/tst_DAppsWorkflow.qml
index 025e364b2c..763588ae55 100644
--- a/storybook/qmlTests/tests/tst_DAppsWorkflow.qml
+++ b/storybook/qmlTests/tests/tst_DAppsWorkflow.qml
@@ -14,6 +14,7 @@ import AppLayouts.Wallet.services.dapps 1.0
import AppLayouts.Wallet.services.dapps.types 1.0
import AppLayouts.Profile.stores 1.0
import AppLayouts.Wallet.panels 1.0
+import AppLayouts.Wallet.stores 1.0 as WalletStores
import shared.stores 1.0
@@ -115,8 +116,9 @@ Item {
Component {
id: walletStoreComponent
- WalletStore {
- readonly property ListModel flatNetworks: ListModel {
+ WalletStores.RootStore {
+ property string selectedAddress: ""
+ readonly property ListModel filteredFlatModel: ListModel {
ListElement { chainId: 1 }
ListElement {
chainId: 2
@@ -125,7 +127,7 @@ Item {
}
}
- readonly property ListModel accounts: ListModel {
+ readonly property ListModel nonWatchAccounts: ListModel {
ListElement {address: "0x1"}
ListElement {
address: "0x2"
@@ -135,9 +137,9 @@ Item {
}
ListElement { address: "0x3a" }
}
- readonly property ListModel ownAccounts: accounts
-
-
+ function getNetworkShortNames(chainIds) {
+ return "eth:oeth:arb"
+ }
}
}
@@ -167,7 +169,12 @@ Item {
verify(!!sdk)
let store = createTemporaryObject(dappsStoreComponent, root)
verify(!!store)
- handler = createTemporaryObject(dappsRequestHandlerComponent, root, {sdk: sdk, store: store, walletStore: walletStore})
+ handler = createTemporaryObject(dappsRequestHandlerComponent, root, {
+ sdk: sdk,
+ store: store,
+ accountsModel: walletStore.nonWatchAccounts,
+ networksModel: walletStore.filteredFlatModel
+ })
verify(!!handler)
}
@@ -176,7 +183,7 @@ Item {
}
function test_TestAuthentication() {
- let td = mockSessionRequestEvent(this, handler.sdk, handler.walletStore)
+ let td = mockSessionRequestEvent(this, handler.sdk, handler.accountsModel, handler.networksModel)
handler.authenticate(td.request)
compare(handler.store.authenticateUserCalls.length, 1, "expected a call to store.authenticateUser")
@@ -239,7 +246,7 @@ Item {
verify(!!sdk)
let store = createTemporaryObject(dappsStoreComponent, root)
verify(!!store)
- service = createTemporaryObject(serviceComponent, root, {wcSDK: sdk, store: store, walletStore: walletStore})
+ service = createTemporaryObject(serviceComponent, root, {wcSDK: sdk, store: store, walletRootStore: walletStore})
verify(!!service)
}
@@ -251,7 +258,7 @@ Item {
function test_TestPairing() {
// All calls to SDK are expected as events to be made by the wallet connect SDK
let sdk = service.wcSDK
- let walletStore = service.walletStore
+ let walletStore = service.walletRootStore
let store = service.store
service.pair("wc:12ab@1?bridge=https%3A%2F%2Fbridge.walletconnect.org&key=12ab")
@@ -262,12 +269,12 @@ Item {
var args = sdk.buildApprovedNamespacesCalls[0]
verify(!!args.supportedNamespaces, "expected supportedNamespaces to be set")
let chainsForApproval = args.supportedNamespaces.eip155.chains
- let networksArray = ModelUtils.modelToArray(walletStore.flatNetworks).map(entry => entry.chainId)
+ let networksArray = ModelUtils.modelToArray(walletStore.filteredFlatModel).map(entry => entry.chainId)
verify(networksArray.every(chainId => chainsForApproval.some(eip155Chain => eip155Chain === `eip155:${chainId}`)),
"expect all the networks to be present")
// We test here all accounts for one chain only, we have separate tests to validate that all accounts are present
let allAccountsForApproval = args.supportedNamespaces.eip155.accounts
- let accountsArray = ModelUtils.modelToArray(walletStore.accounts).map(entry => entry.address)
+ let accountsArray = ModelUtils.modelToArray(walletStore.nonWatchAccounts).map(entry => entry.address)
verify(accountsArray.every(address => allAccountsForApproval.some(eip155Address => eip155Address === `eip155:${networksArray[0]}:${address}`)),
"expect at least all accounts for the first chain to be present"
)
@@ -276,11 +283,11 @@ Item {
sdk.buildApprovedNamespacesResult(allApprovedNamespaces, "")
compare(connectDAppSpy.count, 1, "expected a call to service.connectDApp")
let connectArgs = connectDAppSpy.signalArguments[0]
- compare(connectArgs[connectDAppSpy.argPos.dappChains], networksArray, "expected all provided networks (walletStore.flatNetworks) for the dappChains")
+ compare(connectArgs[connectDAppSpy.argPos.dappChains], networksArray, "expected all provided networks (walletStore.filteredFlatModel) for the dappChains")
verify(!!connectArgs[connectDAppSpy.argPos.sessionProposalJson], "expected sessionProposalJson to be set")
verify(!!connectArgs[connectDAppSpy.argPos.availableNamespaces], "expected availableNamespaces to be set")
- let selectedAccount = walletStore.accounts.get(1)
+ let selectedAccount = walletStore.nonWatchAccounts.get(1)
service.approvePairSession(connectArgs[connectDAppSpy.argPos.sessionProposalJson], connectArgs[connectDAppSpy.argPos.dappChains], selectedAccount)
compare(sdk.buildApprovedNamespacesCalls.length, 2, "expected a call to sdk.buildApprovedNamespaces")
args = sdk.buildApprovedNamespacesCalls[1]
@@ -314,7 +321,7 @@ Item {
function test_SessionRequestMainFlow() {
// All calls to SDK are expected as events to be made by the wallet connect SDK
let sdk = service.wcSDK
- let walletStore = service.walletStore
+ let walletStore = service.walletRootStore
let store = service.store
let testAddress = "0x3a"
@@ -519,7 +526,7 @@ Item {
verify(!!sdk)
let store = createTemporaryObject(dappsStoreComponent, root)
verify(!!store)
- let service = createTemporaryObject(serviceComponent, root, {wcSDK: sdk, store: store, walletStore: walletStore})
+ let service = createTemporaryObject(serviceComponent, root, {wcSDK: sdk, store: store, walletRootStore: walletStore})
verify(!!service)
controlUnderTest = createTemporaryObject(componentUnderTest, root, {wcService: service})
verify(!!controlUnderTest)
@@ -581,7 +588,7 @@ Item {
waitForRendering(controlUnderTest)
let service = controlUnderTest.wcService
- let td = mockSessionRequestEvent(this, service.wcSDK, service.walletStore)
+ let td = mockSessionRequestEvent(this, service.wcSDK, service.walletRootStore.nonWatchAccounts, service.walletRootStore.filteredFlatModel)
waitForRendering(controlUnderTest)
let popup = findChild(controlUnderTest, "dappsRequestModal")
@@ -604,7 +611,7 @@ Item {
waitForRendering(controlUnderTest)
let service = controlUnderTest.wcService
- let td = mockSessionRequestEvent(this, service.wcSDK, service.walletStore)
+ let td = mockSessionRequestEvent(this, service.wcSDK, service.walletRootStore.nonWatchAccounts, service.walletRootStore.filteredFlatModel)
waitForRendering(controlUnderTest)
let popup = findChild(controlUnderTest, "dappsRequestModal")
@@ -625,9 +632,9 @@ Item {
}
}
- function mockSessionRequestEvent(tc, sdk, walletStore) {
- let account = walletStore.accounts.get(1)
- let network = walletStore.flatNetworks.get(1)
+ function mockSessionRequestEvent(tc, sdk, accountsModel, networksMdodel) {
+ let account = accountsModel.get(1)
+ let network = networksMdodel.get(1)
let method = "personal_sign"
let message = "hello world"
let params = [Helpers.strToHex(message), account.address]
diff --git a/storybook/stubs/AppLayouts/Wallet/stores/RootStore.qml b/storybook/stubs/AppLayouts/Wallet/stores/RootStore.qml
new file mode 100644
index 0000000000..c80bf1275e
--- /dev/null
+++ b/storybook/stubs/AppLayouts/Wallet/stores/RootStore.qml
@@ -0,0 +1,5 @@
+import QtQml 2.15
+
+QtObject {
+ id: root
+}
diff --git a/storybook/stubs/AppLayouts/Wallet/stores/qmldir b/storybook/stubs/AppLayouts/Wallet/stores/qmldir
index 9be18ea7ec..2ef284383d 100644
--- a/storybook/stubs/AppLayouts/Wallet/stores/qmldir
+++ b/storybook/stubs/AppLayouts/Wallet/stores/qmldir
@@ -1,5 +1,6 @@
-CollectiblesStore 1.0 CollectiblesStore.qml
-WalletAssetsStore 1.0 WalletAssetsStore.qml
-TokensStore 1.0 TokensStore.qml
ActivityFiltersStore 1.0 ActivityFiltersStore.qml
+CollectiblesStore 1.0 CollectiblesStore.qml
+RootStore 1.0 RootStore.qml
SwapStore 1.0 SwapStore.qml
+TokensStore 1.0 TokensStore.qml
+WalletAssetsStore 1.0 WalletAssetsStore.qml
diff --git a/ui/StatusQ/src/assets.qrc b/ui/StatusQ/src/assets.qrc
index d0b6dc3f0b..af5b276c17 100644
--- a/ui/StatusQ/src/assets.qrc
+++ b/ui/StatusQ/src/assets.qrc
@@ -322,6 +322,7 @@
assets/img/icons/username.svg
assets/img/icons/view.svg
assets/img/icons/wallet.svg
+ assets/img/icons/walletConnect.svg
assets/img/icons/warning.svg
assets/img/icons/youtube.svg
assets/img/status-logo-icon.png
diff --git a/ui/StatusQ/src/assets/img/icons/dapp.svg b/ui/StatusQ/src/assets/img/icons/dapp.svg
index 3649100f22..76455146c3 100644
--- a/ui/StatusQ/src/assets/img/icons/dapp.svg
+++ b/ui/StatusQ/src/assets/img/icons/dapp.svg
@@ -1,4 +1,4 @@
-