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

[v2] eth address as account id #1053

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

[v2] eth address as account id #1053

wants to merge 7 commits into from

Conversation

hopeyen
Copy link
Contributor

@hopeyen hopeyen commented Dec 20, 2024

Why are these changes needed?

just for investigating account behaviors

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@hopeyen hopeyen requested a review from ian-shim December 21, 2024 00:40
@hopeyen hopeyen marked this pull request as ready for review December 21, 2024 00:40
@hopeyen hopeyen changed the title temp: eth address as account id [v2] eth address as account id Dec 21, 2024
accountId := header.PaymentMetadata.AccountID
pubKey := crypto.PubkeyToAddress(*sigPublicKeyECDSA).Hex()

if pubKey != accountId {
Copy link
Contributor

@ian-shim ian-shim Dec 21, 2024

Choose a reason for hiding this comment

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

Here we're comparing strings, but this will fail if accountID isn't checksummed string.
I think it's safer to convert accountID to common.Address (common.HexToAddress()) and compare bytearrays using Address.Cmp()

Do we have a test capturing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use address type.

We have auth_test that check for authenticating the requests, but not as specific as whether it is checksum or not.

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