mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-02 09:46:38 +00:00
fix: code review
This commit is contained in:
parent
efac44057a
commit
16468960f7
@ -209,9 +209,8 @@ QtObject:
|
||||
proc registerENSGasEstimate(self: EnsManager, ensUsername: string, address: string): int {.slot.} =
|
||||
var success: bool
|
||||
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
||||
try:
|
||||
result = registerUsernameEstimateGas(ensUsername, address, pubKey, success)
|
||||
except:
|
||||
result = registerUsernameEstimateGas(ensUsername, address, pubKey, success)
|
||||
if not success:
|
||||
result = 380000
|
||||
|
||||
proc registerENS*(self: EnsManager, username: string, address: string, gas: string, gasPrice: string, password: string): string {.slot.} =
|
||||
|
@ -45,9 +45,6 @@ ModalPopup {
|
||||
}
|
||||
|
||||
usernameRegistered(username);
|
||||
//% "Transaction sent to the blockchain. You can watch the progress on Etherscan: %2%1"
|
||||
// sendingSuccess.text = qsTrId("transaction-sent-to-the-blockchain--you-can-watch-the-progress-on-etherscan---2-1").arg(response.result).arg(walletModel.etherscanLink)
|
||||
// sendingSuccess.open()
|
||||
}
|
||||
|
||||
TransactionStackView {
|
||||
|
@ -24,23 +24,29 @@ ModalPopup {
|
||||
}
|
||||
|
||||
function sendTransaction() {
|
||||
let responseStr = profileModel.ens.setPubKey(root.ensUsername,
|
||||
selectFromAccount.selectedAccount.address,
|
||||
gasSelector.selectedGasLimit,
|
||||
gasSelector.selectedGasPrice,
|
||||
transactionSigner.enteredPassword)
|
||||
let response = JSON.parse(responseStr)
|
||||
try {
|
||||
let responseStr = profileModel.ens.setPubKey(root.ensUsername,
|
||||
selectFromAccount.selectedAccount.address,
|
||||
gasSelector.selectedGasLimit,
|
||||
gasSelector.selectedGasPrice,
|
||||
transactionSigner.enteredPassword)
|
||||
let response = JSON.parse(responseStr)
|
||||
|
||||
if (!response.success) {
|
||||
if (response.error.message.includes("could not decrypt key with given password")){
|
||||
transactionSigner.validationError = qsTr("Wrong password")
|
||||
return
|
||||
if (!response.success) {
|
||||
if (response.error.message.includes("could not decrypt key with given password")){
|
||||
transactionSigner.validationError = qsTr("Wrong password")
|
||||
return
|
||||
}
|
||||
sendingError.text = response.error.message
|
||||
return sendingError.open()
|
||||
}
|
||||
sendingError.text = response.error.message
|
||||
|
||||
usernameUpdated(root.ensUsername);
|
||||
} catch (e) {
|
||||
console.error('Error sending the transaction', e)
|
||||
sendingError.text = "Error sending the transaction: " + e.message;
|
||||
return sendingError.open()
|
||||
}
|
||||
|
||||
usernameUpdated(root.ensUsername);
|
||||
}
|
||||
|
||||
TransactionStackView {
|
||||
|
@ -12,7 +12,7 @@ Popup {
|
||||
//% "View on Etherscan"
|
||||
readonly property string defaultLinkText: qsTrId("view-on-etherscan")
|
||||
property string link: "https://etherscan.io/"
|
||||
property string linkText: qsTrId("view-on-etherscan")
|
||||
property string linkText: defaultLinkText
|
||||
|
||||
id: root
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
Loading…
x
Reference in New Issue
Block a user