fix: rename transactionHash to hash due to breaking changes in the api

This commit is contained in:
Iuri Matias 2021-06-02 16:09:18 -04:00
parent 739f243e8a
commit e88f4aa170
2 changed files with 5 additions and 5 deletions

View File

@ -94,8 +94,8 @@ proc hex2Token*(input: string, decimals: int): string =
result = $i
if(r > 0): result = fmt"{result}.{d}"
proc trackPendingTransaction*(transactionHash: string, fromAddress: string, toAddress: string, trxType: PendingTransactionType, data: string) =
let payload = %* [{"transactionHash": transactionHash, "from": fromAddress, "to": toAddress, "type": $trxType, "additionalData": data, "data": "", "value": 0, "timestamp": 0, "gasPrice": 0, "gasLimit": 0}]
proc trackPendingTransaction*(hash: string, fromAddress: string, toAddress: string, trxType: PendingTransactionType, data: string) =
let payload = %* [{"hash": hash, "from": fromAddress, "to": toAddress, "type": $trxType, "additionalData": data, "data": "", "value": 0, "timestamp": 0, "gasPrice": 0, "gasLimit": 0}]
discard callPrivateRPC("wallet_storePendingTransaction", payload)
proc getPendingTransactions*(): string =

View File

@ -87,12 +87,12 @@ proc getTransactionReceipt*(self: WalletModel, transactionHash: string): JsonNod
proc confirmTransactionStatus(self: WalletModel, pendingTransactions: JsonNode, blockNumber: int) =
for trx in pendingTransactions.getElems():
let transactionReceipt = self.getTransactionReceipt(trx["transactionHash"].getStr)
let transactionReceipt = self.getTransactionReceipt(trx["hash"].getStr)
if transactionReceipt.kind != JNull:
status_wallet.deletePendingTransaction(trx["transactionHash"].getStr)
status_wallet.deletePendingTransaction(trx["hash"].getStr)
let ev = TransactionMinedArgs(
data: trx["data"].getStr,
transactionHash: trx["transactionHash"].getStr,
transactionHash: trx["hash"].getStr,
success: transactionReceipt{"status"}.getStr == "0x1",
revertReason: ""
)