fix(@desktop/browser): Unable to sign message from simepledapp.eth
This commit is contained in:
parent
6dec2eaaf1
commit
d2663d30a5
|
@ -9,15 +9,9 @@ type
|
|||
const postMessageTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} =
|
||||
let arg = decode[PostMessageTaskArg](argEncoded)
|
||||
|
||||
let jsonMessage = arg.message.parseJson
|
||||
let password = jsonMessage{"payload"}{"password"}.getStr
|
||||
if password != "":
|
||||
let hashedPassword = hashPassword(password)
|
||||
jsonMessage["payload"]["password"] = newJString(hashedPassword)
|
||||
|
||||
let result = status_go_provider.providerRequest(arg.requestType, $jsonMessage).result
|
||||
let result = status_go_provider.providerRequest(arg.requestType, arg.message).result
|
||||
let responseJson = %* {
|
||||
"payloadMethod": arg.payloadMethod,
|
||||
"result": $result,
|
||||
}
|
||||
arg.finish(responseJson)
|
||||
arg.finish(responseJson)
|
||||
|
|
|
@ -45,15 +45,10 @@ QtObject {
|
|||
}
|
||||
|
||||
} catch (e) {
|
||||
if (Utils.isInvalidPasswordMessage(e.message)){
|
||||
//% "Wrong password"
|
||||
sendDialog.transactionSigner.validationError = qsTrId("wrong-password")
|
||||
return
|
||||
}
|
||||
if (isTx) {
|
||||
showSendingError(e.message)
|
||||
} else if (isSign) {
|
||||
showSigningError(e.message)
|
||||
showSigningError(e.message.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -724,15 +724,16 @@ QtObject {
|
|||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
// Leave this function at the bottom of the file as QT Creator messes up the code color after this
|
||||
function isPunct(c) {
|
||||
return /(!|\@|#|\$|%|\^|&|\*|\(|\)|_|\+|\||-|=|\\|{|}|[|]|"|;|'|<|>|\?|,|\.|\/)/.test(c)
|
||||
}
|
||||
|
||||
function isInvalidPasswordMessage(msg) {
|
||||
return (
|
||||
msg.includes("could not decrypt key with given password") ||
|
||||
msg.includes("invalid password")
|
||||
);
|
||||
}
|
||||
|
||||
// Leave this function at the bottom of the file as QT Creator messes up the code color after this
|
||||
function isPunct(c) {
|
||||
return /(!|\@|#|\$|%|\^|&|\*|\(|\)|_|\+|\||-|=|\\|{|}|[|]|"|;|'|<|>|\?|,|\.|\/)/.test(c)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue