This commit is contained in:
Ajinkya Kulkarni 2024-12-05 15:05:29 +01:00
parent 00d550787b
commit 4ea6528d42

View file

@ -55,9 +55,9 @@ async fn upsert_tcbinfo() -> Result<(), &'static str> {
.expect("failed to parse contract address");
let query_msg = QueryMsg::GetTcbInfo { fmspc: fmspc.clone() };
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();
let tcbinfo_on_chain = strip_dquotes(format!("{}", tcbinfo_on_chain_json["data"]["tcb_info"]).as_ref()).unwrap().to_string();
println!("{tcbinfo_on_chain} \n {tcbinfo_from_api}");
if *tcbinfo_on_chain != 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";