Skip to content

Commit

Permalink
chore(voyager): improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
benluelo committed Dec 12, 2024
1 parent 0527843 commit 5bcfa1d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions voyager/modules/proof/ethereum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ use jsonrpsee::{
};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use tracing::instrument;
use tracing::{debug, instrument};
use unionlabs::{
ethereum::ibc_commitment_key, hash::H160, ibc::core::client::height::Height, uint::U256,
ErrorReporter,
};
use voyager_message::{
core::ChainId,
into_value,
module::{ProofModuleInfo, ProofModuleServer},
ProofModule,
};
Expand Down Expand Up @@ -78,7 +79,7 @@ impl Module {

#[async_trait]
impl ProofModuleServer<IbcUnion> for Module {
#[instrument(skip_all, fields(chain_id = %self.chain_id))]
#[instrument(skip_all, fields(chain_id = %self.chain_id, %at, ?path))]
async fn query_ibc_proof(
&self,
_: &Extensions,
Expand All @@ -87,6 +88,11 @@ impl ProofModuleServer<IbcUnion> for Module {
) -> RpcResult<Value> {
let location = ibc_commitment_key(path.key());

debug!(
"querying proof for slot {location} for IBC handler contract {}",
self.ibc_handler_address
);

let execution_height = at.height();

let proof = self
Expand Down Expand Up @@ -122,6 +128,6 @@ impl ProofModuleServer<IbcUnion> for Module {
.collect(),
};

Ok(serde_json::to_value(proof).expect("serialization is infallible; qed;"))
Ok(into_value(proof))
}
}

0 comments on commit 5bcfa1d

Please sign in to comment.