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

bech32: Add DecodeUnsafe for bypassing checksum validation #1

Merged
merged 1 commit into from
Sep 19, 2021

Conversation

conr2d
Copy link
Collaborator

@conr2d conr2d commented Sep 12, 2021

@conr2d conr2d requested a review from ValarDragon September 15, 2021 15:02
func Decode(bech string) (string, []byte, error) {
// The maximum allowed length for a bech32 string is 90.
if len(bech) > 90 {
func Decode(bech string, limit int) (string, []byte, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change is the same as the enigma change which the SDK already uses IIRC, so not API breaking for the cosmos SDK

@conr2d conr2d merged commit 128578b into cosmos:master Sep 19, 2021
@conr2d conr2d deleted the conr2d/bech32-decode-unsafe branch September 19, 2021 07:19
Copy link
Collaborator

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM!

@tac0turtle
Copy link
Member

Hey, thanks for opening this PR. IN the future lets get reviews prior to merging. Seems tests arent passing now

@conr2d
Copy link
Collaborator Author

conr2d commented Sep 22, 2021

@marbar3778 I'm sorry for merging PR before getting review. I thought that ValarDragon's comment meant LGTM, but he had forgotten approving PR. I checked whether all unit tests pass, but missed linting things. (gofmt) There is no functional issue.

@ValarDragon Thank you for reviewing this.

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.

perf: bech32 library, implement a decode algorithm that doesn't check the checksum
3 participants