Skip to content

Commit

Permalink
put full height string
Browse files Browse the repository at this point in the history
  • Loading branch information
noot committed Sep 11, 2024
1 parent 4fbe195 commit 903bac5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions crates/relayer/src/chain/astria/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,12 @@ impl ChainEndpoint for AstriaEndpoint {
.into_request();

let height = match request.height {
QueryHeight::Latest => 0,
QueryHeight::Specific(h) => h.revision_height(),
QueryHeight::Latest => 0.to_string(),
QueryHeight::Specific(h) => h.to_string(),
};

req.metadata_mut()
.insert("height", height.to_string().parse().expect("valid ascii"));
.insert("height", height.parse().expect("valid ascii"));

let response = self
.block_on(client.client_state(req))
Expand Down Expand Up @@ -1177,14 +1178,14 @@ impl ChainEndpoint for AstriaEndpoint {
};

let height = match request.height {
QueryHeight::Latest => 0,
QueryHeight::Specific(h) => h.revision_height(),
QueryHeight::Latest => 0.to_string(),
QueryHeight::Specific(h) => h.to_string(),
};

let mut request = tonic::Request::new(req);
request
.metadata_mut()
.insert("height", height.to_string().parse().expect("valid ascii"));
.insert("height", height.parse().expect("valid ascii"));

let response = self
.block_on(client.packet_receipt(request))
Expand Down Expand Up @@ -1248,14 +1249,14 @@ impl ChainEndpoint for AstriaEndpoint {
};

let height = match request.height {
QueryHeight::Latest => 0,
QueryHeight::Specific(h) => h.revision_height(),
QueryHeight::Latest => 0.to_string(),
QueryHeight::Specific(h) => h.to_string(),
};

let mut request = tonic::Request::new(req);
request
.metadata_mut()
.insert("height", height.to_string().parse().expect("valid ascii"));
.insert("height", height.parse().expect("valid ascii"));

let response = self
.block_on(client.packet_acknowledgement(request))
Expand Down

0 comments on commit 903bac5

Please sign in to comment.