Skip to content

Commit

Permalink
fix admin response in init
Browse files Browse the repository at this point in the history
dirtyshab committed May 30, 2024
1 parent 6d3e886 commit bfa65ae
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 6 additions & 3 deletions cw-minter/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::error::ContractError;
use crate::msg::{AdminResp, ExecuteMsg, InstantiateMsg, QueryMsg, RelayerResp};
use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, RelayerResp};
use crate::state::{MintAttempt, MINT_ATTEMPTS, RELAYER_ASSOCIATED_ADDR, RELAYER_POINTER_ADDR};
use crate::SUPPORTED_DENOM;
use cosmwasm_std::{
@@ -15,14 +15,17 @@ pub fn instantiate(
_env: Env,
info: MessageInfo,
msg: InstantiateMsg,
) -> Result<AdminResp, ContractError> {
) -> Result<Response, ContractError> {
let admin = if let Some(admin) = msg.admin {
deps.api.addr_validate(&admin)?
} else {
info.sender
};
initialize_owner(deps.storage, deps.api, Some(admin.as_str()))?;
Ok(AdminResp { admin })
Ok(Response::new().add_attributes(vec![
("action", "instantiate"),
("admin", &admin.to_string()),
]))
}

#[entry_point]
5 changes: 0 additions & 5 deletions cw-minter/src/msg.rs
Original file line number Diff line number Diff line change
@@ -39,8 +39,3 @@ pub struct RelayerResp {
pub associated_address: Option<Addr>,
pub pointer_address: Option<Addr>,
}

#[cw_serde]
pub struct AdminResp {
pub admin: Addr,
}

0 comments on commit bfa65ae

Please sign in to comment.