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 Decimal can be constructed with a negative atomics #1188

Merged
merged 4 commits into from
Jun 27, 2022

Conversation

tien
Copy link
Contributor

@tien tien commented Jun 22, 2022

No description provided.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Nice catch! The atomics string should checked more strictly.

Can you use

    if (!atomics.match(/^[0-9]+$/)) {
      throw new Error("Invalid string format. Only non-negative integers in decimal representation suppored.");
    }

instead?

@tien
Copy link
Contributor Author

tien commented Jun 25, 2022

@webmaster128 sure thing, I have updated the PR accordingly.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Thank you!

Will merge as part of #1195

@webmaster128 webmaster128 merged commit 3175384 into cosmos:main Jun 27, 2022
@webmaster128
Copy link
Member

Shipped as part of CosmJS 0.29.0

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