diff --git a/crates/relayer-types/src/applications/transfer/msgs/mod.rs b/crates/relayer-types/src/applications/transfer/msgs/mod.rs index 5b07d46f18..c4252593c5 100644 --- a/crates/relayer-types/src/applications/transfer/msgs/mod.rs +++ b/crates/relayer-types/src/applications/transfer/msgs/mod.rs @@ -1,4 +1,5 @@ pub mod send; pub mod transfer; +// TODO: does this need to be updated? pub const ASTRIA_WITHDRAWAL_TYPE_URL: &str = "/astria.sequencer.v1.Ics20Withdrawal"; diff --git a/crates/relayer/src/chain/astria/endpoint.rs b/crates/relayer/src/chain/astria/endpoint.rs index 994327235a..e4bebbde63 100644 --- a/crates/relayer/src/chain/astria/endpoint.rs +++ b/crates/relayer/src/chain/astria/endpoint.rs @@ -243,12 +243,12 @@ impl AstriaEndpoint { TransactionParams, UnsignedTransaction, }, + Protobuf as _, }; use astria_sequencer_client::SequencerClientExt as _; use ibc_relayer_types::applications::transfer::msgs::ASTRIA_WITHDRAWAL_TYPE_URL; use penumbra_ibc::IbcRelay; use penumbra_proto::core::component::ibc::v1::IbcRelay as RawIbcRelay; - use astria_core::Protobuf as _; let msg_len = tracked_msgs.msgs.len(); let mut actions: Vec = Vec::with_capacity(msg_len); @@ -731,12 +731,13 @@ impl ChainEndpoint for AstriaEndpoint { } .into_request(); - let map = req.metadata_mut(); - let height_str: String = match request.height { + let height = match request.height { QueryHeight::Latest => 0.to_string(), QueryHeight::Specific(h) => h.to_string(), }; - map.insert("height", height_str.parse().expect("valid ascii string")); + + req.metadata_mut() + .insert("height", height.parse().expect("valid ascii")); let response = self .block_on(client.client_state(req)) @@ -1114,9 +1115,19 @@ impl ChainEndpoint for AstriaEndpoint { port_id: request.port_id.to_string(), channel_id: request.channel_id.to_string(), sequence: request.sequence.into(), + // TODO: height is ignored }; - let request = tonic::Request::new(req); + let height = match request.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.parse().expect("valid ascii")); + let response = self .block_on(client.packet_commitment(request)) .map_err(|e| Error::grpc_status(e, "query_packet_commitment".to_owned()))? @@ -1176,7 +1187,16 @@ impl ChainEndpoint for AstriaEndpoint { // TODO: height is ignored }; - let request = tonic::Request::new(req); + let height = match request.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.parse().expect("valid ascii")); + let response = self .block_on(client.packet_receipt(request)) .map_err(|e| Error::grpc_status(e, "query_packet_receipt".to_owned()))? @@ -1238,7 +1258,16 @@ impl ChainEndpoint for AstriaEndpoint { // TODO: height is ignored }; - let request = tonic::Request::new(req); + let height = match request.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.parse().expect("valid ascii")); + let response = self .block_on(client.packet_acknowledgement(request)) .map_err(|e| Error::grpc_status(e, "query_packet_acknowledgement".to_owned()))?