diff --git a/contracts/external/cw721-roles/src/contract.rs b/contracts/external/cw721-roles/src/contract.rs index 833007e46..09dfdf757 100644 --- a/contracts/external/cw721-roles/src/contract.rs +++ b/contracts/external/cw721-roles/src/contract.rs @@ -326,7 +326,7 @@ pub fn execute_update_token_role( .add_attribute("action", "update_token_role") .add_attribute("sender", info.sender) .add_attribute("token_id", token_id) - .add_attribute("role", role.unwrap_or_default())) + .add_attribute("role", role.unwrap_or("None".to_string()))) } pub fn execute_update_token_uri( @@ -348,7 +348,7 @@ pub fn execute_update_token_uri( .add_attribute("action", "update_token_uri") .add_attribute("sender", info.sender) .add_attribute("token_id", token_id) - .add_attribute("token_uri", token_uri.unwrap_or_default())) + .add_attribute("token_uri", token_uri.unwrap_or("None".to_string()))) } pub fn execute_update_token_weight( diff --git a/contracts/external/cw721-roles/src/tests.rs b/contracts/external/cw721-roles/src/tests.rs index 005c2e61f..e41247062 100644 --- a/contracts/external/cw721-roles/src/tests.rs +++ b/contracts/external/cw721-roles/src/tests.rs @@ -325,6 +325,20 @@ fn test_update_token_role() { // Token was updated successfully let info: NftInfoResponse = query_token_info(&app, &cw721_addr, "1").unwrap(); assert_eq!(info.extension.role, Some("queen".to_string())); + + // Can set to None + app.execute_contract( + Addr::unchecked(DAO), + cw721_addr.clone(), + &ExecuteMsg::Extension { + msg: ExecuteExt::UpdateTokenRole { + token_id: "1".to_string(), + role: None, + }, + }, + &[], + ) + .unwrap(); } #[test] diff --git a/contracts/proposal/dao-proposal-condorcet/src/contract.rs b/contracts/proposal/dao-proposal-condorcet/src/contract.rs index f6b5406f3..3d3785002 100644 --- a/contracts/proposal/dao-proposal-condorcet/src/contract.rs +++ b/contracts/proposal/dao-proposal-condorcet/src/contract.rs @@ -274,7 +274,10 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result unimplemented!("pre-propose and hooks not yet supported"), } diff --git a/contracts/proposal/dao-proposal-multiple/src/contract.rs b/contracts/proposal/dao-proposal-multiple/src/contract.rs index abe9e73a4..6fc42f899 100644 --- a/contracts/proposal/dao-proposal-multiple/src/contract.rs +++ b/contracts/proposal/dao-proposal-multiple/src/contract.rs @@ -997,7 +997,10 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result { let addr = PROPOSAL_HOOKS.remove_hook_by_index(deps.storage, idx)?; diff --git a/contracts/proposal/dao-proposal-single/src/contract.rs b/contracts/proposal/dao-proposal-single/src/contract.rs index d7d9a2972..1943081d1 100644 --- a/contracts/proposal/dao-proposal-single/src/contract.rs +++ b/contracts/proposal/dao-proposal-single/src/contract.rs @@ -1081,7 +1081,10 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result { let addr = PROPOSAL_HOOKS.remove_hook_by_index(deps.storage, idx)?; diff --git a/contracts/voting/dao-voting-token-staked/src/contract.rs b/contracts/voting/dao-voting-token-staked/src/contract.rs index 058210f44..c79b8afd3 100644 --- a/contracts/voting/dao-voting-token-staked/src/contract.rs +++ b/contracts/voting/dao-voting-token-staked/src/contract.rs @@ -755,7 +755,10 @@ pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result