Skip to content

Commit

Permalink
Typos corrections in dso-token
Browse files Browse the repository at this point in the history
  • Loading branch information
hashedone committed Aug 10, 2021
1 parent ae11c6b commit 9383658
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
36 changes: 15 additions & 21 deletions contracts/dso-token/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
};
Expand Down Expand Up @@ -488,7 +484,7 @@ mod tests {
}
);

let err = router
router
.execute_contract(
Addr::unchecked(NON_MEMBER),
cw20_addr.clone(),
Expand All @@ -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 {})
Expand All @@ -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,
}
Expand Down Expand Up @@ -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)),
}
);

Expand All @@ -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 {})
Expand Down
2 changes: 2 additions & 0 deletions contracts/dso-token/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
Expand Down

0 comments on commit 9383658

Please sign in to comment.