DefiHackathon-2022/contracts/counter/src/state.rs
Array in a Matrix 253a8939aa
Revert "Alex payup (#1)" (#2)
This reverts commit c2e75206df.
2022-03-27 09:38:24 -04:00

32 lines
751 B
Rust

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cosmwasm_std::Addr;
use cw_storage_plus::{Item, Map}; //import map and figure out how to use it
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct State {
pub count: i32,
pub owner: Addr,
}
pub struct User {
pub name: String,
pub address: Addr,
}
pub const STATE: Item<State> = Item::new("state");
pub const CUSTOMERS: Map<&str, User> = Map::new("customers");
/*
add states:
1 - the bill(s) / item
2 - the customers /map
3 - Need to figure out a way to store money that we've taken from users. Third state is item again?
1 - how to use map and item to store customers or any state
2 - how to display bill to user
Hello
*/