// Proposers can choose to cancel as long as they haven't already accepted.
Proposers can choose to cancel as long as they haven't already accepted.
Proposers can choose to cancel as long as they haven ' t already accepted .
fn try_cancel(deps: DepsMut, info: MessageInfo) -> Result<Response<ProvenanceMsg>, ContractError> {
    // Validate params.
    if !info.funds.is_empty() {
        return Err(contract_err("no funds should be sent during cancel"));
    }
    // Ensure message sender has not accepted (ie is not already a member).
    let key = info.sender.as_bytes();
    if members_read(deps.storage).may_load(key)?.is_some() {
        return Err(contract_err("membership already accepted"));
    }
    // Lookup join proposal for message sender.
    let proposal = join_proposals_read(deps.storage).load(key)?;
    // Delete join proposal.
    let mut proposals = join_proposals(deps.storage);
    proposals.remove(key);
    // Cancel and destroy the reserve marker.
    let res = Response::new()
        .add_message(cancel_marker(&proposal.denom)?)
        .add_message(destroy_marker(&proposal.denom)?)
        .add_attribute("action", "cancel")
        .add_attribute("join_proposal_id", &proposal.id);
    Ok(res)
}
fn try_cancel ( deps : DepsMut , info : MessageInfo ) -> Result < Response < ProvenanceMsg > , ContractError > { // Validate params. if ! info . funds . is_empty ( ) { return Err ( contract_err ( " " ) ) ; } // Ensure message sender has not accepted (ie is not already a member). let key = info . sender . as_bytes ( ) ; if members_read ( deps . storage ) . may_load ( key ) ? . is_some ( ) { return Err ( contract_err ( " " ) ) ; } // Lookup join proposal for message sender. let proposal = join_proposals_read ( deps . storage ) . load ( key ) ? ; // Delete join proposal. let mut proposals = join_proposals ( deps . storage ) ; proposals . remove ( key ) ; // Cancel and destroy the reserve marker. let res = Response :: new ( ) . add_message ( cancel_marker ( & proposal . denom ) ? ) . add_message ( destroy_marker ( & proposal . denom ) ? ) . add_attribute ( " " , " " ) . add_attribute ( " " , & proposal . id ) ; Ok ( res ) }
Proposers can choose to cancel as long as they haven't already accepted.
Proposers can choose to cancel as long as they haven ' t already accepted .
deps
DepsMut
info
MessageInfo