AlphaWallet / AlphaWallet/alpha-wallet-ios

Transactions tab displaying failed transactions on xDai chain as completed

未關閉
#2,088 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
Bug
主要語言
Swift
星號
631
分支
384
PR 合併指標
30 天內沒有已合併 PR

描述

2 examples at https://blockscout.com/poa/xdai/address/0xbbce83173d5c1D122AE64856b4Af0D5AE07Fa362/transactions

Hashes:

* 0x957d7586dd00d94cfa829b061f001e0ccb06c3d5106fad227e7c99c2c75fb020
* 0x6736cb2742e1ea1e965715d26dfaad706f8394f3a02ecfd035c7721840a4fb47

The Blockscout output is like this:

```
{
"message": "OK",
"result": [{
"blockHash": "0x2942fa727db6397fe3b741ea20da3e39a5d720f9779e849a4b2c8452033a6bd5",
"blockNumber": "11288761",
"confirmations": "313",
"contractAddress": "",
"cumulativeGasUsed": "233517",
"from": "0xbbce83173d5c1d122ae64856b4af0d5ae07fa362",
"gas": "1000000",
"gasPrice": "1000000000",
"gasUsed": "27161",
"hash": "0x6736cb2742e1ea1e965715d26dfaad706f8394f3a02ecfd035c7721840a4fb47",
"input": "0x",
"isError": "1",
"nonce": "0",
"timeStamp": "1596441760",
"to": "0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6",
"transactionIndex": "1",
"txreceipt_status": "0",
"value": "1000000000000000"
}, {
"blockHash": "0xb950375c6c8e36d5176b39ab8ff3a745f5832939936e9086bead9314ff4ec0d4",
"blockNumber": "11288797",
"confirmations": "277",
"contractAddress": "",
"cumulativeGasUsed": "71066",
"from": "0xbbce83173d5c1d122ae64856b4af0d5ae07fa362",
"gas": "1000000",
"gasPrice": "1000000000",
"gasUsed": "27161",
"hash": "0x957d7586dd00d94cfa829b061f001e0ccb06c3d5106fad227e7c99c2c75fb020",
"input": "0x",
"isError": "1",
"nonce": "1",
"timeStamp": "1596441940",
"to": "0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6",
"transactionIndex": "1",
"txreceipt_status": "0",
"value": "100000000000000"
}],
"status": "1"
}
```

At https://github.com/AlphaWallet/alpha-wallet-ios/blob/master/AlphaWallet/EtherClient/TrustClient/Models/RawTransaction.swift#L57, we have a check for the "error" field. I haven't checked if Etherscan always returns a non-empty "error" field when the transaction has failed, but maybe we just need to check this to also check for `isError`?

```
let state: TransactionState = {
if transaction.error?.isEmpty == false {
return .error
}
return .completed
}()
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。