From 972b051e14375dba30dea66cca849b5148dbdcd0 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 27 Jun 2024 17:19:28 +0300 Subject: [PATCH] fix(dapps) fail to process a transaction if missing usual fields Updates: #15189 --- storybook/pages/DAppsWorkflowPage.qml | 2 +- ui/imports/shared/stores/DAppsStore.qml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/storybook/pages/DAppsWorkflowPage.qml b/storybook/pages/DAppsWorkflowPage.qml index 44a7591660..dba088c414 100644 --- a/storybook/pages/DAppsWorkflowPage.qml +++ b/storybook/pages/DAppsWorkflowPage.qml @@ -90,7 +90,7 @@ Item { }) } Layout.fillWidth: true - Layout.preferredHeight: !!text ? 400 : undefined + Layout.preferredHeight: !!text ? 400 : -1 } Rectangle { diff --git a/ui/imports/shared/stores/DAppsStore.qml b/ui/imports/shared/stores/DAppsStore.qml index 41b9055de0..a4d703c638 100644 --- a/ui/imports/shared/stores/DAppsStore.qml +++ b/ui/imports/shared/stores/DAppsStore.qml @@ -49,15 +49,15 @@ QObject { // Strip leading zeros from numbers as expected by status-go function prepareTxForStatusGo(txObj) { - return { - data: txObj.data, - from: txObj.from, - gasLimit: stripLeadingZeros(txObj.gasLimit), - gasPrice: stripLeadingZeros(txObj.gasPrice), - nonce: stripLeadingZeros(txObj.nonce), - to: txObj.to, - value: stripLeadingZeros(txObj.value) - } + let tx = {} + if (txObj.data) { tx.data = txObj.data } + if (txObj.from) { tx.from = txObj.from } + if (txObj.gasLimit) { tx.gasLimit = stripLeadingZeros(txObj.gasLimit) } + if (txObj.gasPrice) { tx.gasPrice = stripLeadingZeros(txObj.gasPrice) } + if (txObj.nonce) { tx.nonce = stripLeadingZeros(txObj.nonce) } + if (txObj.to) { tx.to = txObj.to } + if (txObj.value) { tx.value = stripLeadingZeros(txObj.value) } + return tx } // Returns the hex encoded signature of the transaction or empty string if error function signTransaction(topic, id, address, chainId, password, txObj) {