-
Notifications
You must be signed in to change notification settings - Fork 224
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
Simplify some light client types and testing #132
Conversation
31e0f00
to
046cf86
Compare
f2fd6fe
to
19331b9
Compare
} | ||
} | ||
|
||
// TODO: should this go in the central place all impls live instead? (currently lite_impl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to keep types.rs
purely abstract / generic only? If so this should go into a different file/module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it should go with the impls since it's a pretty generic thing, but maybe in its own module file in lite
cf28563
to
585255c
Compare
Codecov Report
@@ Coverage Diff @@
## master #132 +/- ##
=========================================
+ Coverage 32.96% 36.9% +3.93%
=========================================
Files 92 90 -2
Lines 3009 3127 +118
Branches 430 463 +33
=========================================
+ Hits 992 1154 +162
+ Misses 1816 1718 -98
- Partials 201 255 +54
Continue to review full report at Codecov.
|
- use same names as in current spec
…dHeader - as a result of parametrarizing `TrustedState<C, H>` and `SignedHeader<C, H>` (instead of trait with assoc. types) a few things have to be (re)parametrarized and other can be completely deleted as they are redundant and consumers can use the param structs instead of the trait impls: - parametrarize Store<C, H> too - delete mocks: MockSignedHeader, MockState - delete impl for block::signed_header::SignedHeader - delete impl for lite::TrustedState in JSON tests - remove `State` and state.rs module from implementation completely - adapt params in verifier to match generic params of TrustedState & SignedHeader - remove dep on block::Height by making lite::Height a u64 alias
- remove `DefaultTrustLevel` from tests - remove TrustThresholdOneThird and TrustThresholdTwoThirds from tendermint-lite (the latter was not used and the first duplicates the default impl) - use TrustThresholdFraction::default() instead
- rename `validate_untrusted` -> `validate` which calls the new method on Commit - simplify tests (`Option`s are not longer needed) - move length matches check to impl of `validate`
…instead - use MemStore of light crate in tests as a Mock
e85d832
to
cf24fc0
Compare
db6c64a
to
418cd04
Compare
…le in the super module) - mocks can be used in both types.rs and verifier.rs without decreasing codecov
- rename _verify_and_update_bisection -> verify_and_update_bisection_inner
91f1674
to
31550c3
Compare
…e spec - verify_and_update_single -> verify_single - verify_and_update_bisection -> verify_bisection - remove store from public facing functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful work! Left a bunch of questions and minor nits but they can be followed up on.
} | ||
} | ||
|
||
// TODO: should this go in the central place all impls live instead? (currently lite_impl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it should go with the impls since it's a pretty generic thing, but maybe in its own module file in lite
Main change: make
TrustedState
andSignedHeader
structs (instead of traits with assoc. types):as a result of parametrarizing
TrustedState<C, H>
andSignedHeader<C, H>
(instead of trait with assoc. types) a few things have to be (re)parametrarized and
others can be deleted as they are redundant and consumers can use the
param. structs instead of the trait impls (which duplicated code):
State
and state.rs module from implementation completelyMore (minor) changes / improvements:
block::Height
by makinglite::Height
au64
type aliasverify_commit_
(trusting
vsfull
)votes_len
fromCommit
verify_update_single
instead ofverify_single
in tests (unexport the latter) (f2fd6fe)rename:
remove store from public facing functions