-
Notifications
You must be signed in to change notification settings - Fork 332
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
WIP Connection queries for Relayer #136
Changes from all commits
7e6e76a
030c4d0
ae792c0
d332fd6
949ad61
107cccb
3aae417
9c2f528
7423376
4db544c
a8ed4d5
f8c0721
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
use serde_derive::{Deserialize, Serialize}; | ||
|
||
use crate::path::Path; | ||
use std::fmt; | ||
use tendermint::merkle::proof::Proof; | ||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
|
@@ -14,7 +15,7 @@ impl CommitmentPath { | |
where | ||
P: Path, | ||
{ | ||
todo!() | ||
CommitmentPath {} | ||
} | ||
} | ||
|
||
|
@@ -31,7 +32,21 @@ impl CommitmentProof { | |
} | ||
*/ | ||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct CommitmentPrefix; | ||
#[derive(Clone, PartialEq, Serialize, Deserialize)] | ||
pub struct CommitmentPrefix(Vec<u8>); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering if we should have a formatter for this. The output of the query shows: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implemented a fmt::Debug trait to properly format the CommitmentPrefix output in this commit |
||
|
||
// TODO: impl CommitPrefix | ||
impl CommitmentPrefix { | ||
pub fn new(content: Vec<u8>) -> Self { | ||
Self { 0: content } | ||
} | ||
} | ||
|
||
impl fmt::Debug for CommitmentPrefix { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
let converted = String::from_utf8(self.clone().0); | ||
match converted { | ||
Ok(s) => write!(f, "{}", s), | ||
Err(_e) => write!(f, "{:?}", &self.0), | ||
} | ||
} | ||
} |
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.
@ancazamfir was not sure this is accurate, please double-check.
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 good.