-
Notifications
You must be signed in to change notification settings - Fork 323
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 for client query subcommands #235
Conversation
Codecov Report
@@ Coverage Diff @@
## master #235 +/- ##
=========================================
+ Coverage 13.6% 37.4% +23.7%
=========================================
Files 69 79 +10
Lines 3752 5680 +1928
Branches 1374 1884 +510
=========================================
+ Hits 513 2127 +1614
- Misses 2618 3344 +726
+ Partials 621 209 -412
Continue to review full report at Codecov.
|
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.
Looks great! Added a few comments and questions.
impl TryFromRaw for AnyClientState { | ||
type RawType = prost_types::Any; | ||
type Error = Error; | ||
|
||
fn try_from(value: Self::RawType) -> Result<Self, Self::Error> { | ||
match value.type_url.as_str() { | ||
"ibc.tendermint.ClientState" => { | ||
let raw = RawTendermintClientState::decode(any.value.as_ref()) | ||
let raw = RawTendermintClientState::decode(value.value.as_ref()) |
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.
Just curious on why you changed from_any
that transforms from a prost type to the try_from
for TryFromRaw
impl. I liked the old version a bit better.
Also value.value.as_ref()
doesn't ready very well :)
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.
It was necessary for AnyClientState
to implement the TryFromRaw
trait, otherwise the call below would fail:
The failure would occur because the function chain.query::<T>
requires the trait bound: T: TryFromRaw
.
Also value.value.as_ref() doesn't ready very well :)
Agree! Didn't notice that, will fix.
Opened issue #245 to track updating the mock consensus state in the proto file. |
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.
Looks great! Thanks Adi!
* Adapted client query subcommands to new query infrastructure (does not compile yet). * Fixes for ClientState -> AnyClientState * Fix for ConsensusState -> AnyConsensusState up to deserialization. * Added impl TryFromRaw for AnyClientState; fixes for Anca's review
Closes: #231
Waiting for #233 to get merged to get this to compile...ready for review!For contributor use:
docs/
) and code commentsFiles changed
in the Github PR explorer