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
|
||||
if self.tmpSendTransactionDetails.txHashBeingProcessed.len == 0:
|
||||
self.sendSignedTransactions()
|
||||
self.clearTmpData()
|
||||
|
||||
proc getRSVFromSignature(self: Module, signature: string): (string, string, string) =
|
||||
let finalSignature = singletonInstance.utils.removeHexPrefix(signature)
|
||||
|
@ -270,7 +269,9 @@ method prepareSignaturesForTransactions*(self:Module, txForSigning: RouterTransa
|
|||
self.tmpSendTransactionDetails.resolvedSignatures[h] = ("", "", "")
|
||||
self.signOnKeycard()
|
||||
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:
|
||||
self.tmpSendTransactionDetails.resolvedSignatures[h] = ("", "", "")
|
||||
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 = "") =
|
||||
self.tmpKeepPinPass = approvalTx # need to automate the swap flow with approval
|
||||
defer:
|
||||
self.clearTmpData(self.tmpKeepPinPass)
|
||||
if txHash.len == 0:
|
||||
self.view.sendTransactionSentSignal(uuid = self.tmpSendTransactionDetails.uuid, chainId = 0, approvalTx = false, txHash = "", error)
|
||||
return
|
||||
|
@ -408,5 +411,4 @@ method splitAndFormatAddressPrefix*(self: Module, text : string, updateInStore:
|
|||
return editedText
|
||||
|
||||
method transactionSendingComplete*(self: Module, txHash: string, status: string) =
|
||||
self.clearTmpData(self.tmpKeepPinPass)
|
||||
self.view.sendtransactionSendingCompleteSignal(txHash, status)
|
||||
|
|
|
@ -90,7 +90,7 @@ proc prepareTokensTask(argEncoded: string) {.gcsafe, nimcall.} =
|
|||
"storeResult": false
|
||||
}
|
||||
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["storeResult"] = %* arg.storeResult
|
||||
except Exception as e:
|
||||
|
|
|
@ -132,6 +132,7 @@ rpc(getWalletToken, "wallet"):
|
|||
|
||||
rpc(fetchOrGetCachedWalletBalances, "wallet"):
|
||||
accounts: seq[string]
|
||||
forceRefresh: bool
|
||||
|
||||
rpc(fetchMarketValues, "wallet"):
|
||||
symbols: seq[string]
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 233f2f9a2afaf81e459f0025e390a6e58964ea5c
|
||||
Subproject commit 0fa1a0833b1939ba9f119907a6efd3d5bd7c021d
|
Loading…
Reference in New Issue