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

(Bids 2636) show 0 value internal transactions #2785

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

remoterami
Copy link
Collaborator

based on #2784

copilot:summary

@remoterami remoterami force-pushed the BIDS-2636/show-0-value-internal-transactions branch 2 times, most recently from fd75dd8 to 0704d04 Compare January 17, 2024 12:53
Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

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

Please have a look at my comments.

There is also this issue:

  1. Go to the Internal Transactions tab of a tx that has itx
  2. Activate Advanced
    You can see all itx
  3. Refresh the page
    => Advanced is still active but you can only see the itx as if it wasn't.
    To see all of them again you need to deactivate Advanced and activate it again.

eth1data/eth1data.go Outdated Show resolved Hide resolved
utils/format.go Outdated
Comment on lines 234 to 237
if !strings.HasSuffix(amountStr, ".") {
amountStr += "."
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue: This doesn't make sense to me. What are you trying to do here?
If you now e.g. call this method with:

  • valIf: 100.12345
  • digitsAfterComma: 10

you would get "100.12345.0000"

or with

  • digitsAfterComma: 2

a "100.12." (with a correct tooltip)

Didn't it just work beforehand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not quite, seems like I came across an edge case which isn't handled correctly. Call the method with

  • valIf: 100.00001234
  • digitsAfterComma: 4

result:

  • 10000000

When the number has higher precision than digitsAfterComma, Truncate cuts away all decimal places. We're still adding the missingZeros though, so we'll massively inflate the result 😅

My fix was also wrong of course, thanks for pointing it out; I've adjusted it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, good find.
Seems to work for every case now.

handlers/eth1tx.go Outdated Show resolved Hide resolved
<div id="advanced-itx" class="hide mr-20 float-right">
<div class="float-right">
<span class="text-monospace mr-2">Advanced</span>
<label class="advanced-itx-switch float-right" for="advanced-itx-toggle">
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Unlike Etherscan the advanced-itx-switch is visible and works in both the Overview and Internal Transactions tabs.
When clicked in the Overview tab you only see the number in the Internal Transactions tab change.

Should this be how it works?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah no, this was not intended. I assume you're using firefox, because on chrome it works for me; I adopted the same fix we're using for the tabBarSwitcher, this should fix it. The list of internal transactions in the overview tab should only show non-advanced subcalls at all times.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I am normally using Firefox.
It looks fixed for both Firefox and Chrome now.

@remoterami remoterami force-pushed the BIDS-2636/show-0-value-internal-transactions branch from fece9a3 to 13a8667 Compare January 18, 2024 10:36
Eisei24
Eisei24 previously approved these changes Jan 18, 2024
Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

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

lgtm

When refreshing the page the Advanced switch now resets back to "Off".

@remoterami remoterami force-pushed the BIDS-2636/show-0-value-internal-transactions branch from 13a8667 to dbec987 Compare February 2, 2024 09:38
Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

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

lgtm, only a merge should have happened since the last approved review.

@remoterami remoterami merged commit 5d22576 into master Feb 2, 2024
3 checks passed
@remoterami remoterami deleted the BIDS-2636/show-0-value-internal-transactions branch February 2, 2024 10:17
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.

2 participants