From c58ec93f08e9e06ea15440a0e5e9062c7edee397 Mon Sep 17 00:00:00 2001 From: hu55a1n1 Date: Wed, 15 Nov 2023 00:55:14 -0800 Subject: [PATCH] Update scripts --- bisenzone-cw-mvp/scripts/deploy-contract.sh | 4 +- bisenzone-cw-mvp/src/helpers.rs | 47 --------------------- 2 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 bisenzone-cw-mvp/src/helpers.rs diff --git a/bisenzone-cw-mvp/scripts/deploy-contract.sh b/bisenzone-cw-mvp/scripts/deploy-contract.sh index ab8db9e..d8bfdab 100755 --- a/bisenzone-cw-mvp/scripts/deploy-contract.sh +++ b/bisenzone-cw-mvp/scripts/deploy-contract.sh @@ -41,10 +41,9 @@ echo "" echo "🚀 Instantiating contract with the following parameters:" echo "--------------------------------------------------------" echo "Label: ${LABEL}" -echo "Count: ${COUNT}" echo "--------------------------------------------------------" -wasmd tx wasm instantiate "$CODE_ID" "{\"count\":${COUNT}}" --from "$USER_ADDR" --label $LABEL $TXFLAG -y --no-admin 2>&1 > /dev/null +wasmd tx wasm instantiate "$CODE_ID" "null" --from "$USER_ADDR" --label $LABEL $TXFLAG -y --no-admin 2>&1 > /dev/null echo "" echo "🕐 Waiting for contract to be queryable..." @@ -57,4 +56,3 @@ echo "🆔 Code ID: ${CODE_ID}" echo "📌 Contract Address: ${CONTRACT}" echo "🔑 Contract Key: ${KEY}" echo "🔖 Contract Label: ${LABEL}" -echo "🏷️ Count: ${COUNT}" diff --git a/bisenzone-cw-mvp/src/helpers.rs b/bisenzone-cw-mvp/src/helpers.rs deleted file mode 100644 index 6d988cc..0000000 --- a/bisenzone-cw-mvp/src/helpers.rs +++ /dev/null @@ -1,47 +0,0 @@ -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; - -use cosmwasm_std::{ - to_json_binary, Addr, CosmosMsg, CustomQuery, Querier, QuerierWrapper, StdResult, WasmMsg, - WasmQuery, -}; - -use crate::msg::{ExecuteMsg, GetCountResponse, QueryMsg}; - -/// CwTemplateContract is a wrapper around Addr that provides a lot of helpers -/// for working with this. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -pub struct CwTemplateContract(pub Addr); - -impl CwTemplateContract { - pub fn addr(&self) -> Addr { - self.0.clone() - } - - pub fn call>(&self, msg: T) -> StdResult { - let msg = to_json_binary(&msg.into())?; - Ok(WasmMsg::Execute { - contract_addr: self.addr().into(), - msg, - funds: vec![], - } - .into()) - } - - /// Get Count - pub fn count(&self, querier: &Q) -> StdResult - where - Q: Querier, - T: Into, - CQ: CustomQuery, - { - let msg = QueryMsg::GetCount {}; - let query = WasmQuery::Smart { - contract_addr: self.addr().into(), - msg: to_json_binary(&msg)?, - } - .into(); - let res: GetCountResponse = QuerierWrapper::::new(querier).query(&query)?; - Ok(res) - } -}