fix(@desktop/wallet): send transaction to address UI is broken
Fixes #4623
This commit is contained in:
parent
e3b349fe51
commit
4341d12efc
|
@ -1,4 +1,4 @@
|
||||||
import os
|
import os, parseutils
|
||||||
import ../ens/utils as ens_utils
|
import ../ens/utils as ens_utils
|
||||||
|
|
||||||
include ../../common/json_utils
|
include ../../common/json_utils
|
||||||
|
@ -8,6 +8,8 @@ include ../../../app/core/tasks/common
|
||||||
# Async lookup ENS contact
|
# Async lookup ENS contact
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
|
const PK_LENGTH_0X_INCLUDED = 132
|
||||||
|
|
||||||
type
|
type
|
||||||
LookupContactTaskArg = ref object of QObjectTaskArg
|
LookupContactTaskArg = ref object of QObjectTaskArg
|
||||||
value: string
|
value: string
|
||||||
|
@ -17,7 +19,14 @@ const lookupContactTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} =
|
||||||
let arg = decode[LookupContactTaskArg](argEncoded)
|
let arg = decode[LookupContactTaskArg](argEncoded)
|
||||||
var pubkey = arg.value
|
var pubkey = arg.value
|
||||||
var address = ""
|
var address = ""
|
||||||
if not pubkey.startsWith("0x"):
|
|
||||||
|
if (pubkey.startsWith("0x")):
|
||||||
|
var num64: int64
|
||||||
|
let parsedChars = parseHex(pubkey, num64)
|
||||||
|
if(parsedChars != PK_LENGTH_0X_INCLUDED):
|
||||||
|
pubkey = ""
|
||||||
|
address = ""
|
||||||
|
else:
|
||||||
# TODO refactor those calls to use the new backend and also do it in a signle call
|
# TODO refactor those calls to use the new backend and also do it in a signle call
|
||||||
pubkey = ens_utils.pubkey(arg.value)
|
pubkey = ens_utils.pubkey(arg.value)
|
||||||
address = ens_utils.address(arg.value)
|
address = ens_utils.address(arg.value)
|
||||||
|
|
|
@ -68,9 +68,10 @@ Item {
|
||||||
Keys.onReleased: {
|
Keys.onReleased: {
|
||||||
successMessage = "";
|
successMessage = "";
|
||||||
searchResults.pubKey = "";
|
searchResults.pubKey = "";
|
||||||
|
root.validationError = "";
|
||||||
|
searchResults.showProfileNotFoundMessage = false;
|
||||||
if (chatKey.text !== "") {
|
if (chatKey.text !== "") {
|
||||||
if (!validate()) {
|
if (!validate()) {
|
||||||
searchResults.showProfileNotFoundMessage = false;
|
|
||||||
noContactsRect.visible = false;
|
noContactsRect.visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue