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
|
result = $i
|
||||||
if(r > 0): result = fmt"{result}.{d}"
|
if(r > 0): result = fmt"{result}.{d}"
|
||||||
|
|
||||||
proc trackPendingTransaction*(transactionHash: string, fromAddress: string, toAddress: string, trxType: PendingTransactionType, data: string) =
|
proc trackPendingTransaction*(hash: 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}]
|
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)
|
discard callPrivateRPC("wallet_storePendingTransaction", payload)
|
||||||
|
|
||||||
proc getPendingTransactions*(): string =
|
proc getPendingTransactions*(): string =
|
||||||
|
|
|
@ -87,12 +87,12 @@ proc getTransactionReceipt*(self: WalletModel, transactionHash: string): JsonNod
|
||||||
|
|
||||||
proc confirmTransactionStatus(self: WalletModel, pendingTransactions: JsonNode, blockNumber: int) =
|
proc confirmTransactionStatus(self: WalletModel, pendingTransactions: JsonNode, blockNumber: int) =
|
||||||
for trx in pendingTransactions.getElems():
|
for trx in pendingTransactions.getElems():
|
||||||
let transactionReceipt = self.getTransactionReceipt(trx["transactionHash"].getStr)
|
let transactionReceipt = self.getTransactionReceipt(trx["hash"].getStr)
|
||||||
if transactionReceipt.kind != JNull:
|
if transactionReceipt.kind != JNull:
|
||||||
status_wallet.deletePendingTransaction(trx["transactionHash"].getStr)
|
status_wallet.deletePendingTransaction(trx["hash"].getStr)
|
||||||
let ev = TransactionMinedArgs(
|
let ev = TransactionMinedArgs(
|
||||||
data: trx["data"].getStr,
|
data: trx["data"].getStr,
|
||||||
transactionHash: trx["transactionHash"].getStr,
|
transactionHash: trx["hash"].getStr,
|
||||||
success: transactionReceipt{"status"}.getStr == "0x1",
|
success: transactionReceipt{"status"}.getStr == "0x1",
|
||||||
revertReason: ""
|
revertReason: ""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue