mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
Cherry-picks from Sale's PRs (#16915)
* fix(swap): after approving spending cap with a keycard the swap transaction fails fixes: #16867 * fix(wallet): cannot sing tx sent from imported key pair if the profile is migrated to keycard fixes: #16901 * chore(wallet): added param to fetchOrGetCachedWalletBalances call to align with statusgo change --------- Co-authored-by: Sale Djenic <aleksandardjenic@status.im>
This commit is contained in:
parent
007f75ad4c
commit
a290c3c5b8
@ -243,7 +243,6 @@ proc signOnKeycard(self: Module) =
|
|||||||
break
|
break
|
||||||
if self.tmpSendTransactionDetails.txHashBeingProcessed.len == 0:
|
if self.tmpSendTransactionDetails.txHashBeingProcessed.len == 0:
|
||||||
self.sendSignedTransactions()
|
self.sendSignedTransactions()
|
||||||
self.clearTmpData()
|
|
||||||
|
|
||||||
proc getRSVFromSignature(self: Module, signature: string): (string, string, string) =
|
proc getRSVFromSignature(self: Module, signature: string): (string, string, string) =
|
||||||
let finalSignature = singletonInstance.utils.removeHexPrefix(signature)
|
let finalSignature = singletonInstance.utils.removeHexPrefix(signature)
|
||||||
@ -270,7 +269,9 @@ method prepareSignaturesForTransactions*(self:Module, txForSigning: RouterTransa
|
|||||||
self.tmpSendTransactionDetails.resolvedSignatures[h] = ("", "", "")
|
self.tmpSendTransactionDetails.resolvedSignatures[h] = ("", "", "")
|
||||||
self.signOnKeycard()
|
self.signOnKeycard()
|
||||||
else:
|
else:
|
||||||
let finalPassword = hashPassword(self.tmpSendTransactionDetails.password)
|
var finalPassword = self.tmpSendTransactionDetails.password
|
||||||
|
if not singletonInstance.userProfile.getIsKeycardUser():
|
||||||
|
finalPassword = hashPassword(self.tmpSendTransactionDetails.password)
|
||||||
for h in txForSigning.signingDetails.hashes:
|
for h in txForSigning.signingDetails.hashes:
|
||||||
self.tmpSendTransactionDetails.resolvedSignatures[h] = ("", "", "")
|
self.tmpSendTransactionDetails.resolvedSignatures[h] = ("", "", "")
|
||||||
var
|
var
|
||||||
@ -299,6 +300,8 @@ method onTransactionSigned*(self: Module, keycardFlowType: string, keycardEvent:
|
|||||||
|
|
||||||
method transactionWasSent*(self: Module, uuid: string, chainId: int = 0, approvalTx: bool = false, txHash: string = "", error: string = "") =
|
method transactionWasSent*(self: Module, uuid: string, chainId: int = 0, approvalTx: bool = false, txHash: string = "", error: string = "") =
|
||||||
self.tmpKeepPinPass = approvalTx # need to automate the swap flow with approval
|
self.tmpKeepPinPass = approvalTx # need to automate the swap flow with approval
|
||||||
|
defer:
|
||||||
|
self.clearTmpData(self.tmpKeepPinPass)
|
||||||
if txHash.len == 0:
|
if txHash.len == 0:
|
||||||
self.view.sendTransactionSentSignal(uuid = self.tmpSendTransactionDetails.uuid, chainId = 0, approvalTx = false, txHash = "", error)
|
self.view.sendTransactionSentSignal(uuid = self.tmpSendTransactionDetails.uuid, chainId = 0, approvalTx = false, txHash = "", error)
|
||||||
return
|
return
|
||||||
@ -408,5 +411,4 @@ method splitAndFormatAddressPrefix*(self: Module, text : string, updateInStore:
|
|||||||
return editedText
|
return editedText
|
||||||
|
|
||||||
method transactionSendingComplete*(self: Module, txHash: string, status: string) =
|
method transactionSendingComplete*(self: Module, txHash: string, status: string) =
|
||||||
self.clearTmpData(self.tmpKeepPinPass)
|
|
||||||
self.view.sendtransactionSendingCompleteSignal(txHash, status)
|
self.view.sendtransactionSendingCompleteSignal(txHash, status)
|
||||||
|
@ -90,7 +90,7 @@ proc prepareTokensTask(argEncoded: string) {.gcsafe, nimcall.} =
|
|||||||
"storeResult": false
|
"storeResult": false
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
let response = backend.fetchOrGetCachedWalletBalances(arg.accounts)
|
let response = backend.fetchOrGetCachedWalletBalances(arg.accounts, false) # TODO: think should we need to use arg.storeResult or not and if yes, is it everywhere set proprely
|
||||||
output["result"] = response.result
|
output["result"] = response.result
|
||||||
output["storeResult"] = %* arg.storeResult
|
output["storeResult"] = %* arg.storeResult
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -132,6 +132,7 @@ rpc(getWalletToken, "wallet"):
|
|||||||
|
|
||||||
rpc(fetchOrGetCachedWalletBalances, "wallet"):
|
rpc(fetchOrGetCachedWalletBalances, "wallet"):
|
||||||
accounts: seq[string]
|
accounts: seq[string]
|
||||||
|
forceRefresh: bool
|
||||||
|
|
||||||
rpc(fetchMarketValues, "wallet"):
|
rpc(fetchMarketValues, "wallet"):
|
||||||
symbols: seq[string]
|
symbols: seq[string]
|
||||||
|
2
vendor/status-go
vendored
2
vendor/status-go
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 233f2f9a2afaf81e459f0025e390a6e58964ea5c
|
Subproject commit 0fa1a0833b1939ba9f119907a6efd3d5bd7c021d
|
Loading…
x
Reference in New Issue
Block a user