diff --git a/src/app_service/service/eth/dto/method_dto.nim b/src/app_service/service/eth/dto/method_dto.nim index 3fb380f902..be17974b42 100644 --- a/src/app_service/service/eth/dto/method_dto.nim +++ b/src/app_service/service/eth/dto/method_dto.nim @@ -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 diff --git a/src/app_service/service/transaction/service.nim b/src/app_service/service/transaction/service.nim index 4324da5a52..92e12c776a 100644 --- a/src/app_service/service/transaction/service.nim +++ b/src/app_service/service/transaction/service.nim @@ -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 diff --git a/vendor/status-go b/vendor/status-go index 6691516903..dd86a82a0f 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 66915169030d785dedd8ff43859a0a835101d7d8 +Subproject commit dd86a82a0f34e1170ef2795b4eb4b87358ee3e81