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

Add transaction state changes feature #5944

Merged
merged 2 commits into from
Nov 1, 2022

Conversation

sl1depengwyn
Copy link
Collaborator

@sl1depengwyn sl1depengwyn commented Aug 17, 2022

#5583
#6288

Changelog

Add tab with state changes to transaction page that show how balances changed. Some examlpes below:

  • tx
    image
  • tx
    image
    In case of multiple transfers of unique tokens of the same contranct all of them diaplayed in one change
  • tx
    image
    Here balance of contract(0x09C131) is unknown, so it isn't displayed

Checklist for your Pull Request (PR)

Comment on lines -12 to -14
import Ecto.Changeset
import Ecto.Query, only: [from: 2]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are imported by use Explorer.Schema

defmacro __using__(_opts) do
quote do
use Ecto.Schema
import Ecto.{Changeset, Query}
@timestamps_opts [type: :utc_datetime_usec]
end
end

@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 5 times, most recently from a4c2142 to 3555c30 Compare August 21, 2022 05:47
@sl1depengwyn sl1depengwyn marked this pull request as ready for review August 21, 2022 06:16
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 2 times, most recently from e89eb6c to b7fc5ee Compare August 25, 2022 17:41
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sl1depengwyn when I click to any tx's tab except State changes scroll jumps to tab's content. It would be awesome to keep the same behaviour for State changes tab as well.

@vbaranov
Copy link
Member

@sl1depengwyn also, what is the order of state changes?

@vbaranov
Copy link
Member

@sl1depengwyn tx failed, but state change asserting transfer of the coin value, what is incorrect:

scrnli_29_08_2022_23-33-58

@sl1depengwyn
Copy link
Collaborator Author

@sl1depengwyn also, what is the order of state changes?

first 3 entries are coin from, to and miner and then all token transfers changes, token transfers changes unordered since stored in Map, but grouped by address

@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 2 times, most recently from 5284458 to 8950feb Compare August 31, 2022 09:46
@sl1depengwyn
Copy link
Collaborator Author

sl1depengwyn commented Aug 31, 2022

@sl1depengwyn when I click to any tx's tab except State changes scroll jumps to tab's content. It would be awesome to keep the same behaviour for State changes tab as well.

fixed

@sl1depengwyn
Copy link
Collaborator Author

@sl1depengwyn tx failed, but state change asserting transfer of the coin value, what is incorrect:

scrnli_29_08_2022_23-33-58

fixed

@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch from 8950feb to 28c9562 Compare August 31, 2022 10:49
@vbaranov vbaranov self-requested a review August 31, 2022 13:21
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sl1depengwyn 1 test failed:

1) test GET index/3 returns fetched state changes for the transaction with token transfer (BlockScoutWeb.TransactionStateControllerTest)
Error:      test/block_scout_web/controllers/transaction_state_controller_test.exs:33
     Expected truthy, got false
     code: assert String.contains?(full_text, format_wei_value(%Wei{value: Decimal.new(1, 2, 18)}, :ether))
     arguments:

@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 2 times, most recently from 55c5e20 to 0fdcb9f Compare August 31, 2022 19:34
@nikitosing nikitosing self-requested a review September 2, 2022 13:14
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 2 times, most recently from 308aa86 to 2805de6 Compare September 3, 2022 06:28
@nikitosing nikitosing changed the title Mf show balances changes in transaction view Add transaction state changes feature Sep 3, 2022
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch from 2805de6 to d306fb9 Compare September 5, 2022 14:54
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch from d306fb9 to 5be00aa Compare September 5, 2022 14:57
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch from 5be00aa to 197c744 Compare September 9, 2022 07:46
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 4 times, most recently from c9a42dc to 9614c38 Compare September 13, 2022 13:24
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 2 times, most recently from 6323f0a to 60f97d0 Compare September 17, 2022 05:48
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch 4 times, most recently from 50dab80 to 1938e28 Compare October 6, 2022 14:15
@vbaranov vbaranov force-pushed the mf-show-balances-changes-in-transaction-view branch from 1938e28 to 94aa545 Compare October 24, 2022 10:16
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch from 94aa545 to 476ad76 Compare November 1, 2022 12:15
vbaranov and others added 2 commits November 1, 2022 15:24
Refactor

Add scrolling

Fix displaying txs with errors

Fix nikitosings review

Update gettext

Fix tests after accounts merge

Fix after accounts merge
- Fix displaying same entries (i.e. when sender or receiver of tx is a miner of this tx itself)
- Sort entries to group it by address
@sl1depengwyn sl1depengwyn force-pushed the mf-show-balances-changes-in-transaction-view branch from 476ad76 to ab13f77 Compare November 1, 2022 12:24
@vbaranov vbaranov self-requested a review November 1, 2022 13:46
@vbaranov vbaranov merged commit ecf3c98 into master Nov 1, 2022
@vbaranov vbaranov deleted the mf-show-balances-changes-in-transaction-view branch November 1, 2022 13:47
fx0x55 pushed a commit to FunctionX/blockscout that referenced this pull request Feb 9, 2023
* Show balance changes in transaction page

Refactor

Add scrolling

Fix displaying txs with errors

Fix nikitosings review

Update gettext

Fix tests after accounts merge

Fix after accounts merge

* Fix review issues

- Fix displaying same entries (i.e. when sender or receiver of tx is a miner of this tx itself)
- Sort entries to group it by address

Co-authored-by: Viktor Baranov <baranov.viktor.27@gmail.com>
(cherry picked from commit ecf3c98)
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.

None yet

3 participants