fix: rename transactionHash to hash due to breaking changes in the api
This commit is contained in:
parent
739f243e8a
commit
e88f4aa170
|
@ -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 =
|
||||
|
|
|
@ -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: ""
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue