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

client/eth: Tx history recipient bug #2868

Merged
merged 2 commits into from
Aug 12, 2024
Merged

Conversation

martonp
Copy link
Contributor

@martonp martonp commented Jul 15, 2024

The recipient field was being populated with the "to" field of the eth transaction (which may be a contract address) instead of the recipient of a send transaction as in other assets.

The recipient field was being populated with the "to" field of the eth
transaction (which may be a contract address) instead of the recipient
of a send transaction as in other assets.
Comment on lines 5121 to 5125
var recipient *string
if to := tx.To(); to != nil {
s := to.String()
recipient = &s
}
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth doing something like ?

if recipient == nil {
	if to := tx.To(); to != nil {
		s := to.String()
		recipient = &s
	}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You don't think it'll be confusing to have the swap contract address / bond contract address there?

Copy link
Member

@buck54321 buck54321 Jul 15, 2024

Choose a reason for hiding this comment

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

For swaps, we should be specifying the recipient, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the counterparty's address?

Copy link
Member

Choose a reason for hiding this comment

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

I think I'm not fully grasping the intent here. Where's the "bug" exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The recipient field was supposed to show the recipient of a "send". For tokens, this will show the token contract address instead of the address where the tokens were sent.

Copy link
Member

Choose a reason for hiding this comment

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

I guess I don't see a problem with having the contract as the recipient field, especially if we're just leaving it blank otherwise. More data is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK I guess it can't hurt.

@buck54321 buck54321 merged commit a2a6fa2 into decred:master Aug 12, 2024
5 checks passed
buck54321 pushed a commit that referenced this pull request Aug 12, 2024
* client/eth: Tx history recipient bug

The recipient field was being populated with the "to" field of the eth
transaction (which may be a contract address) instead of the recipient
of a send transaction as in other assets.

* Show recipient for all tx types
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.

3 participants