fix: code review

This commit is contained in:
Richard Ramos 2020-09-21 15:19:05 -04:00 committed by Iuri Matias
parent efac44057a
commit 16468960f7
4 changed files with 22 additions and 20 deletions

View File

@ -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.} =

View File

@ -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 {

View File

@ -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 {

View File

@ -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