fix: rebase gone wrong
This commit is contained in:
parent
346e98c81a
commit
efac44057a
|
@ -210,7 +210,7 @@ QtObject:
|
||||||
var success: bool
|
var success: bool
|
||||||
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
||||||
try:
|
try:
|
||||||
result = registerUsernameEstimateGas(ensUsername, address, pubKey)
|
result = registerUsernameEstimateGas(ensUsername, address, pubKey, success)
|
||||||
except:
|
except:
|
||||||
result = 380000
|
result = 380000
|
||||||
|
|
||||||
|
@ -219,33 +219,26 @@ QtObject:
|
||||||
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
||||||
let response = registerUsername(username, pubKey, address, gas, gasPrice, password, success)
|
let response = registerUsername(username, pubKey, address, gas, gasPrice, password, success)
|
||||||
result = $(%* { "result": %response, "success": %success })
|
result = $(%* { "result": %response, "success": %success })
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
self.transactionWasSent(response)
|
self.transactionWasSent(response)
|
||||||
|
|
||||||
# TODO: handle transaction failure
|
|
||||||
var ensUsername = formatUsername(username, true)
|
var ensUsername = formatUsername(username, true)
|
||||||
self.pendingUsernames.incl(ensUsername)
|
self.pendingUsernames.incl(ensUsername)
|
||||||
self.add ensUsername
|
self.add ensUsername
|
||||||
|
|
||||||
except RpcException as e:
|
|
||||||
result = $(%* { "error": %* { "message": %e.msg }})
|
|
||||||
|
|
||||||
proc setPubKeyGasEstimate(self: EnsManager, ensUsername: string, address: string): int {.slot.} =
|
proc setPubKeyGasEstimate(self: EnsManager, ensUsername: string, address: string): int {.slot.} =
|
||||||
|
var success: bool
|
||||||
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
||||||
try:
|
result = setPubKeyEstimateGas(ensUsername, address, pubKey, success)
|
||||||
result = setPubKeyEstimateGas(ensUsername, address, pubKey)
|
if not success:
|
||||||
except:
|
|
||||||
result = 80000
|
result = 80000
|
||||||
|
|
||||||
proc setPubKey(self: EnsManager, username: string, address: string, gas: string, gasPrice: string, password: string): string {.slot.} =
|
proc setPubKey(self: EnsManager, username: string, address: string, gas: string, gasPrice: string, password: string): string {.slot.} =
|
||||||
try:
|
var success: bool
|
||||||
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
|
||||||
let response = setPubKey(username, pubKey, address, gas, gasPrice, password)
|
let response = setPubKey(username, pubKey, address, gas, gasPrice, password, success)
|
||||||
result = $(%* { "result": %response })
|
result = $(%* { "result": %response, "success": %success })
|
||||||
|
if success:
|
||||||
self.transactionWasSent(response)
|
self.transactionWasSent(response)
|
||||||
|
|
||||||
# TODO: handle transaction failure
|
|
||||||
self.pendingUsernames.incl(username)
|
self.pendingUsernames.incl(username)
|
||||||
self.add username
|
self.add username
|
||||||
except RpcException as e:
|
|
||||||
result = $(%* { "error": %* { "message": %e.msg }})
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ proc registerUsername*(username, pubKey, address, gas, gasPrice, password: stri
|
||||||
if success:
|
if success:
|
||||||
trackPendingTransaction(result, address, $sntContract.address, PendingTransactionType.RegisterENS, username & domain)
|
trackPendingTransaction(result, address, $sntContract.address, PendingTransactionType.RegisterENS, username & domain)
|
||||||
|
|
||||||
proc setPubKeyEstimateGas*(username: string, address: string, pubKey: string): int =
|
proc setPubKeyEstimateGas*(username: string, address: string, pubKey: string, success: var bool): int =
|
||||||
var hash = namehash(username)
|
var hash = namehash(username)
|
||||||
hash.removePrefix("0x")
|
hash.removePrefix("0x")
|
||||||
|
|
||||||
|
@ -205,12 +205,13 @@ proc setPubKeyEstimateGas*(username: string, address: string, pubKey: string): i
|
||||||
var tx = transactions.buildTokenTransaction(parseAddress(address), parseAddress(resolverAddress), "", "")
|
var tx = transactions.buildTokenTransaction(parseAddress(address), parseAddress(resolverAddress), "", "")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
let response = resolverContract.methods["setPubkey"].estimateGas(tx, setPubkey)
|
let response = resolverContract.methods["setPubkey"].estimateGas(tx, setPubkey, success)
|
||||||
|
if success:
|
||||||
result = fromHex[int](response)
|
result = fromHex[int](response)
|
||||||
except RpcException as e:
|
except RpcException as e:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
proc setPubKey*(username, pubKey, address, gas, gasPrice, password: string): string =
|
proc setPubKey*(username, pubKey, address, gas, gasPrice, password: string, success: var bool): string =
|
||||||
var hash = namehash(username)
|
var hash = namehash(username)
|
||||||
hash.removePrefix("0x")
|
hash.removePrefix("0x")
|
||||||
|
|
||||||
|
@ -225,7 +226,8 @@ proc setPubKey*(username, pubKey, address, gas, gasPrice, password: string): str
|
||||||
var tx = transactions.buildTokenTransaction(parseAddress(address), parseAddress(resolverAddress), gas, gasPrice)
|
var tx = transactions.buildTokenTransaction(parseAddress(address), parseAddress(resolverAddress), gas, gasPrice)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = resolverContract.methods["setPubkey"].send(tx, setPubkey, password)
|
result = resolverContract.methods["setPubkey"].send(tx, setPubkey, password, success)
|
||||||
|
if success:
|
||||||
trackPendingTransaction(result, $address, resolverAddress, PendingTransactionType.SetPubKey, username)
|
trackPendingTransaction(result, $address, resolverAddress, PendingTransactionType.SetPubKey, username)
|
||||||
except RpcException as e:
|
except RpcException as e:
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -21,16 +21,6 @@ ModalPopup {
|
||||||
icon: StandardIcon.Critical
|
icon: StandardIcon.Critical
|
||||||
standardButtons: StandardButton.Ok
|
standardButtons: StandardButton.Ok
|
||||||
}
|
}
|
||||||
property MessageDialog sendingSuccess: MessageDialog {
|
|
||||||
id: sendingSuccess
|
|
||||||
//% "Success sending the transaction"
|
|
||||||
title: qsTrId("success-sending-the-transaction")
|
|
||||||
icon: StandardIcon.NoIcon
|
|
||||||
standardButtons: StandardButton.Ok
|
|
||||||
onAccepted: {
|
|
||||||
root.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClosed: {
|
onClosed: {
|
||||||
stack.reset()
|
stack.reset()
|
||||||
|
@ -56,8 +46,8 @@ ModalPopup {
|
||||||
|
|
||||||
usernameRegistered(username);
|
usernameRegistered(username);
|
||||||
//% "Transaction sent to the blockchain. You can watch the progress on Etherscan: %2%1"
|
//% "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.text = qsTrId("transaction-sent-to-the-blockchain--you-can-watch-the-progress-on-etherscan---2-1").arg(response.result).arg(walletModel.etherscanLink)
|
||||||
sendingSuccess.open()
|
// sendingSuccess.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
TransactionStackView {
|
TransactionStackView {
|
||||||
|
|
|
@ -31,7 +31,7 @@ ModalPopup {
|
||||||
transactionSigner.enteredPassword)
|
transactionSigner.enteredPassword)
|
||||||
let response = JSON.parse(responseStr)
|
let response = JSON.parse(responseStr)
|
||||||
|
|
||||||
if (response.error) {
|
if (!response.success) {
|
||||||
if (response.error.message.includes("could not decrypt key with given password")){
|
if (response.error.message.includes("could not decrypt key with given password")){
|
||||||
transactionSigner.validationError = qsTr("Wrong password")
|
transactionSigner.validationError = qsTr("Wrong password")
|
||||||
return
|
return
|
||||||
|
|
|
@ -12,6 +12,7 @@ Popup {
|
||||||
//% "View on Etherscan"
|
//% "View on Etherscan"
|
||||||
readonly property string defaultLinkText: qsTrId("view-on-etherscan")
|
readonly property string defaultLinkText: qsTrId("view-on-etherscan")
|
||||||
property string link: "https://etherscan.io/"
|
property string link: "https://etherscan.io/"
|
||||||
|
property string linkText: qsTrId("view-on-etherscan")
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
closePolicy: Popup.NoAutoClose
|
closePolicy: Popup.NoAutoClose
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 39456fa3d5b637053b616e50a8350b2b932a1d4c
|
Loading…
Reference in New Issue