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: keep address format the same with ethereum #119

Merged
merged 5 commits into from
Mar 8, 2023
Merged

Conversation

keefel
Copy link
Contributor

@keefel keefel commented Mar 6, 2023

Description

Use the same decode method with Ethereum address, so that we can handle the address case correctly.

Rationale

The previous decode method of address can't handle the case insensitive issues, the address in uppercase and lowercase would be regarded as two different addresses, which is not as expected.

Example

NA

Changes

Notable changes:

  • Fix address format

types/address.go Outdated
@@ -493,7 +494,10 @@ func (ca ConsAddress) Equals(ca2 Address) bool {

// Returns boolean for whether an ConsAddress is empty
func (ca ConsAddress) Empty() bool {
return len(ca) == 0
addrValue := big.NewInt(0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we change to this, then 0x0000000000000000000000000000000000000000 is empty, is this expected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@unclezoro unclezoro merged commit dbc5145 into develop Mar 8, 2023
@unclezoro unclezoro deleted the keefe/fix branch April 18, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants