Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: failed transactions are not displayed with the correct state in Activities tab and sort order is enforced correctly for activities/transactions within the same block #2201

Merged
merged 1 commit into from
Oct 10, 2020

Conversation

hboon
Copy link
Member

@hboon hboon commented Oct 9, 2020

Fixes #2192

  • transaction ID should be included as the primary key for EventActivity (the Realm object representing activities)
  • transactions that failed were displayed like they are successful [1]
  • sort order of activities (i.e events) and transactions within the same block was incorrect

This PR contains a database migration.

Before PR -> Error states displayed correctly -> With order corrected

[1]:

The transaction "entity" returned by Etherscan contains the field isError which is "0" when there are no errors. The field we were checking against for errors error, either no longer exists or might have no value even when isError == 1.

{
    "blockNumber": "10999432",
    "timeStamp": "1601950354",
    "hash": "0xdfe89ded2490f6917c6aa83fd4b4d9790ac40521c441b419980f94abf9ae14bc",
    "nonce": "32",
    "blockHash": "0x33cb8281386e9c24aeb4ae080259ce129f259c66d9f310394edb967f8e6cbfed",
    "transactionIndex": "128",
    "from": "0xfcabe3451ac8edfb8fb6b9274c2e095d9ccc8082",
    "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
    "value": "0",
    "gas": "224637",
    "gasPrice": "77000001459",
    "isError": "0",
    "txreceipt_status": "1",
    "input": "0x18cbafe50000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000a15a75f894067e00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000fcabe3451ac8edfb8fb6b9274c2e095d9ccc8082000000000000000000000000000000000000000000000000000000005f7bd70a00000000000000000000000000000000000000000000000000000000000000030000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f9840000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "contractAddress": "",
    "cumulativeGasUsed": "12419473",
    "gasUsed": "186820",
    "confirmations": "14337"
}

@hboon hboon marked this pull request as draft October 9, 2020 05:12
…Activities tab and sort order is enforced correctly for activities/transactions within the same block

Specifically:

* transaction ID should be included EventActivity primary key
* transactions that failed were displayed like they are successful
* sorting of activities (i.e events) and transactions within the same block was incorrectly
@hboon hboon force-pushed the fix-activity-state-and-sort-order branch from 42b8403 to 586d87e Compare October 9, 2020 05:13
@hboon hboon marked this pull request as ready for review October 9, 2020 05:15
@hboon hboon requested a review from bitcoinwarrior1 October 9, 2020 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve activity - order of transactions
2 participants