From f52f8e918490a750d07e18456e43b2105dbd5946 Mon Sep 17 00:00:00 2001 From: Ajinkya Kulkarni Date: Thu, 5 Dec 2024 14:49:37 +0100 Subject: [PATCH] WIP --- crates/utils/tcbinfo-updater/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/utils/tcbinfo-updater/src/main.rs b/crates/utils/tcbinfo-updater/src/main.rs index b4a5596..6b11b68 100644 --- a/crates/utils/tcbinfo-updater/src/main.rs +++ b/crates/utils/tcbinfo-updater/src/main.rs @@ -55,10 +55,10 @@ async fn upsert_tcbinfo() -> Result<(), &'static str> { .parse() .expect("failed to parse contract address"); let query_msg = QueryMsg::GetTcbInfo { fmspc: fmspc.clone() }; - let tcbinfo_on_chain: Value = client.query_smart(&contract_address, json!(query_msg)).await.expect("contract query failed"); - println!("{tcbinfo_on_chain:?}"); + let tcbinfo_on_chain_json: Value = client.query_smart(&contract_address, json!(query_msg)).await.expect("contract query failed"); + let tcbinfo_on_chain = &tcbinfo_on_chain_json["data"]["tcb_info"].to_string(); - if tcbinfo_on_chain.to_string() != tcbinfo_from_api { + if *tcbinfo_on_chain != tcbinfo_from_api { println!("updating on-chain TCBInfo for FMSPC: {fmspc}"); let chain_id = tendermint::chain::id::Id::try_from("pion-1").expect("invalid chain id"); let sender = "ajinkya";