diff --git a/contracts/dso-token/src/contract.rs b/contracts/dso-token/src/contract.rs index e08ab72..af6fb7b 100644 --- a/contracts/dso-token/src/contract.rs +++ b/contracts/dso-token/src/contract.rs @@ -149,19 +149,15 @@ pub fn execute( project, description, marketing, - } => { - verify_sender_on_whitelist(&deps, &info.sender)?; - cw20_base::contract::execute_update_marketing( - deps, - env, - info, - project, - description, - marketing, - ) - } + } => cw20_base::contract::execute_update_marketing( + deps, + env, + info, + project, + description, + marketing, + ), ExecuteMsg::UploadLogo(logo) => { - verify_sender_on_whitelist(&deps, &info.sender)?; cw20_base::contract::execute_upload_logo(deps, env, info, logo) } }; @@ -488,7 +484,7 @@ mod tests { } ); - let err = router + router .execute_contract( Addr::unchecked(NON_MEMBER), cw20_addr.clone(), @@ -501,8 +497,6 @@ mod tests { ) .unwrap_err(); - assert_eq!(err, "Unauthorized".to_owned()); - let marketing: cw20::MarketingInfoResponse = router .wrap() .query_wasm_smart(&cw20_addr, &QueryMsg::MarketingInfo {}) @@ -512,7 +506,7 @@ mod tests { marketing, cw20::MarketingInfoResponse { project: Some("Project".to_owned()), - description: None, + description: Some("Description".to_owned()), marketing: Some(Addr::unchecked(NON_MEMBER)), logo: None, } @@ -558,7 +552,7 @@ mod tests { project: None, description: None, marketing: Some(Addr::unchecked(MEMBER1)), - logo: Some(cw20::LogoInfo::Url(logo_url.clone())), + logo: Some(cw20::LogoInfo::Url(logo_url)), } ); @@ -575,17 +569,17 @@ mod tests { ) .unwrap(); - let err = router + let logo_url = "https://logo.url/updated_logo.svg".to_owned(); + + router .execute_contract( Addr::unchecked(NON_MEMBER), cw20_addr.clone(), - &ExecuteMsg::UploadLogo(cw20::Logo::Url("garbage".to_owned())), + &ExecuteMsg::UploadLogo(cw20::Logo::Url(logo_url.clone())), &[], ) .unwrap_err(); - assert_eq!(err, "Unauthorized".to_owned()); - let marketing: cw20::MarketingInfoResponse = router .wrap() .query_wasm_smart(&cw20_addr, &QueryMsg::MarketingInfo {}) diff --git a/contracts/dso-token/src/msg.rs b/contracts/dso-token/src/msg.rs index d63bfd1..54b0123 100644 --- a/contracts/dso-token/src/msg.rs +++ b/contracts/dso-token/src/msg.rs @@ -2,6 +2,8 @@ use cw20::{Cw20Coin, Logo, MinterResponse}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +// TODO: Get rid of `InstantiateMarketingInfo` and reuse `cw20_base::msg::InstantiateMarketingInfo` +// when it gains all required traits #[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] pub struct InstantiateMarketingInfo { pub project: Option,