fix(@wallet): link to tx hash
This commit is contained in:
parent
87640aafb1
commit
bd8ad854fc
|
@ -89,12 +89,12 @@ proc getEstimateGasData*(self: MethodDto, tx: var TransactionDataDto, procDescri
|
|||
tx.data = self.encodeAbi(procDescriptor)
|
||||
return %*[%tx]
|
||||
|
||||
proc send*(self: MethodDto, tx: var TransactionDataDto, procDescriptor: object, password: string, success: var bool): string =
|
||||
proc send*(self: MethodDto, tx: var TransactionDataDto, procDescriptor: object, password: string, success: var bool): RpcResponse[JsonNode] =
|
||||
tx.data = self.encodeAbi(procDescriptor)
|
||||
# this call should not be part of this file, we need to move it to appropriate place, or this should not be a DTO class.
|
||||
let response = status_eth.sendTransaction($(%tx), password)
|
||||
success = response.error.isNil
|
||||
return $response
|
||||
return response
|
||||
|
||||
proc call[T](self: MethodDto, tx: var TransactionDataDto, procDescriptor: object, success: var bool): T =
|
||||
success = true
|
||||
|
|
|
@ -287,14 +287,10 @@ QtObject:
|
|||
let json: JsonNode = %tx
|
||||
let response = eth.sendTransaction($json, password)
|
||||
|
||||
# only till it is moved to another thred
|
||||
# if response.error != nil:
|
||||
# raise newException(Exception, response.error.message)
|
||||
|
||||
let output = %* { "result": %($response), "success": %(response.error.isNil), "uuid": %uuid }
|
||||
let output = %* { "result": response.result.getStr, "success": %(response.error.isNil), "uuid": %uuid }
|
||||
self.events.emit(SIGNAL_TRANSACTION_SENT, TransactionSentArgs(result: $output))
|
||||
|
||||
self.trackPendingTransaction($response, from_addr, to_addr,
|
||||
self.trackPendingTransaction(response.result.getStr, from_addr, to_addr,
|
||||
$PendingTransactionTypeDto.WalletTransfer, data = "")
|
||||
except Exception as e:
|
||||
error "Error sending eth transfer transaction", msg = e.msg
|
||||
|
@ -323,20 +319,18 @@ QtObject:
|
|||
let networkType = self.settingsService.getCurrentNetwork().toNetworkType()
|
||||
let network = self.networkService.getNetwork(networkType)
|
||||
let token = self.tokenService.findTokenByAddress(network, parseAddress(assetAddress))
|
||||
|
||||
var tx = ens_utils.buildTokenTransaction(parseAddress(from_addr), parseAddress(assetAddress),
|
||||
gas, gasPrice, eip1559Enabled, maxPriorityFeePerGas, maxFeePerGas)
|
||||
|
||||
var success: bool
|
||||
let transfer = Transfer(to: parseAddress(to_addr),
|
||||
value: conversion.eth2Wei(parseFloat(value), token.decimals))
|
||||
let transferproc = ERC20_procS.toTable["transfer"]
|
||||
let response = transferproc.send(tx, transfer, password, success)
|
||||
|
||||
let output = %* { "result": %response, "success": %success, "uuid": %uuid }
|
||||
let txHash = response.result.getStr
|
||||
let output = %* { "result": txHash, "success": %success, "uuid": %uuid }
|
||||
self.events.emit(SIGNAL_TRANSACTION_SENT, TransactionSentArgs(result: $output))
|
||||
|
||||
self.trackPendingTransaction(response, from_addr, to_addr,
|
||||
self.trackPendingTransaction(txHash, from_addr, to_addr,
|
||||
$PendingTransactionTypeDto.WalletTransfer, data = "")
|
||||
except Exception as e:
|
||||
error "Error sending token transfer transaction", msg = e.msg
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 66915169030d785dedd8ff43859a0a835101d7d8
|
||||
Subproject commit dd86a82a0f34e1170ef2795b4eb4b87358ee3e81
|
Loading…
Reference in New Issue