Function provwasm_std::delete_distinct_attribute
source · pub fn delete_distinct_attribute<H: Into<Addr>, S: Into<String>, B: Into<Binary>>(
address: H,
name: S,
value: B
) -> StdResult<CosmosMsg<ProvenanceMsg>>
Expand description
Create a message that will delete a distinct attribute with the given name and value from an account.
Example
// Imports required
use cosmwasm_std::{Addr, Response, StdResult, to_binary};
use provwasm_std::{delete_distinct_attribute, ProvenanceMsg};
// Delete the distinct label attribute. NOTE: The name below must resolve to the contract address.
fn try_delete_distinct_label(
address: Addr,
) -> StdResult<Response<ProvenanceMsg>> {
let attr_name = String::from("label.my-contract.sc.pb");
let attr_value = String::from("hello");
let msg = delete_distinct_attribute(address, &attr_name, to_binary(&attr_value)?)?;
let mut res = Response::new().add_message(msg);
Ok(res)
}