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
|
||||
|
||||
include ../../common/json_utils
|
||||
|
@ -8,6 +8,8 @@ include ../../../app/core/tasks/common
|
|||
# Async lookup ENS contact
|
||||
#################################################
|
||||
|
||||
const PK_LENGTH_0X_INCLUDED = 132
|
||||
|
||||
type
|
||||
LookupContactTaskArg = ref object of QObjectTaskArg
|
||||
value: string
|
||||
|
@ -17,7 +19,14 @@ const lookupContactTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} =
|
|||
let arg = decode[LookupContactTaskArg](argEncoded)
|
||||
var pubkey = arg.value
|
||||
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
|
||||
pubkey = ens_utils.pubkey(arg.value)
|
||||
address = ens_utils.address(arg.value)
|
||||
|
|
|
@ -68,9 +68,10 @@ Item {
|
|||
Keys.onReleased: {
|
||||
successMessage = "";
|
||||
searchResults.pubKey = "";
|
||||
root.validationError = "";
|
||||
searchResults.showProfileNotFoundMessage = false;
|
||||
if (chatKey.text !== "") {
|
||||
if (!validate()) {
|
||||
searchResults.showProfileNotFoundMessage = false;
|
||||
noContactsRect.visible = false;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue