use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cosmwasm::traits::Storage;
use cosmwasm::types::CanonicalAddr;
use cw_storage::{singleton, singleton_read, ReadonlySingleton, Singleton};
pub static CONFIG_KEY: &[u8] = b"config";
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct State {
pub count: i32,
pub owner: CanonicalAddr,
pub version: i32,
}
pub fn config<S: Storage>(storage: &mut S) -> Singleton<S, State> {
singleton(storage, CONFIG_KEY)
}
pub fn config_read<S: Storage>(storage: &S) -> ReadonlySingleton<S, State> {
singleton_read(storage, CONFIG_KEY)
}