We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
use cosmwasm_std::{ Response, StdError, StdResult, Addr, Storage }; use cw_storage_plus::Map;const HOSPITALS: Map<&Addr, Hospital> = Map::new("hospitals");pub fn execute_hospital_register( store: &mut dyn Storage, hospital: &Hospital ) -> Result<Response, ContractError> { let save_result = HOSPITALS.save(store, &hospital.address, hospital); if save_result.is_err() { return Err(ContractError::SaveError {}); } return Ok(Response::default()); } fn query_hospital(deps: Deps, wallet_address: &Addr) -> StdResult<Binary> { let hospital = HOSPITALS.load(deps.storage, wallet_address); let resp = match hospital {Ok(data) => HospitalResponse { hospital: data.clone(), }, Err(err) => { return Err(err); } };
2.2K Point(s)
1.2K Point(s)
313 Point(s)
178 Point(s)
138 Point(s)
Input your email to receive reset password link, or if you remember your password, you can click