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

Trust threshold validation #924

Closed
hu55a1n1 opened this issue Jul 7, 2021 · 0 comments · Fixed by #934
Closed

Trust threshold validation #924

hu55a1n1 opened this issue Jul 7, 2021 · 0 comments · Fixed by #934
Labels
enhancement New feature or request
Milestone

Comments

@hu55a1n1
Copy link
Member

hu55a1n1 commented Jul 7, 2021

The TrustThresholdFraction as currently defined can be instantiated with an invalid numerator/denominator combination (see ibc-rs/#1149 and ibc-rs/!1157), so we could enforce validation by making it's internal fields non-public and providing a constructor that always validates.

What's the definition of "done" for this issue?

A TrustThresholdFraction should only be constructible iff all below conditions are satisfied ->

  • denominator != 0
  • numerator * 3 >= denominator
  • numerator < denominator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants