From d727072e40a9eaf4aca41409e8efa89010014f6a Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Thu, 7 Nov 2024 00:12:27 +0400 Subject: [PATCH] Fix merge --- crates/utils/cw-client/src/grpc.rs | 62 ------------------------------ 1 file changed, 62 deletions(-) diff --git a/crates/utils/cw-client/src/grpc.rs b/crates/utils/cw-client/src/grpc.rs index abe37440..5dae43c3 100644 --- a/crates/utils/cw-client/src/grpc.rs +++ b/crates/utils/cw-client/src/grpc.rs @@ -215,65 +215,3 @@ pub async fn send_tx( let tx_response = client.broadcast_tx(request).await?; Ok(tx_response.into_inner()) } - -#[cfg(test)] -mod tests { - use std::error::Error; - - use serde_json::json; - use transfers_contract::msg::{execute::Request, QueryMsg::GetRequests}; - - use crate::{grpc::GrpcClient, CwClient}; - - #[tokio::test] - #[ignore] - async fn test_query() -> Result<(), Box> { - let sk = hex::decode("ffc4d3c9119e9e8263de08c0f6e2368ac5c2dacecfeb393f6813da7d178873d2") - .unwrap() - .as_slice() - .try_into() - .unwrap(); - let url = "https://grpc-falcron.pion-1.ntrn.tech:80".parse().unwrap(); - let contract = "neutron15ruzx9wvrupt9cffzsp6868uad2svhfym2nsgxm2skpeqr3qrd4q4uwk83" - .parse() - .unwrap(); - - let cw_client = GrpcClient::new(sk, url); - let resp: Vec = cw_client - .query_smart(&contract, json!(GetRequests {})) - .await?; - println!("{resp:?}"); - - Ok(()) - } - - #[tokio::test] - #[ignore] - async fn test_execute() -> Result<(), Box> { - let sk = hex::decode("ffc4d3c9119e9e8263de08c0f6e2368ac5c2dacecfeb393f6813da7d178873d2") - .unwrap() - .as_slice() - .try_into() - .unwrap(); - let url = "https://grpc-falcron.pion-1.ntrn.tech:80".parse().unwrap(); - let contract = "neutron15ruzx9wvrupt9cffzsp6868uad2svhfym2nsgxm2skpeqr3qrd4q4uwk83" - .parse() - .unwrap(); - let chain_id = "pion-1".parse().unwrap(); - - let cw_client = GrpcClient::new(sk, url); - let tx_hash = cw_client - .tx_execute( - &contract, - &chain_id, - 2000000, - "/* unused since we're getting the account from the sk */", - json!([]), - "0untrn", - ) - .await?; - println!("{}", tx_hash); - - Ok(()) - } -}