|
| 1 | +use crate::msg; |
| 2 | +use cosmwasm_std::Uint128; |
| 3 | +use cw_storage_plus::Item; |
| 4 | +use serde::{Deserialize, Serialize}; |
1 | 5 |
|
| 6 | +pub const STORE: Item<Store> = Item::new("store"); |
| 7 | + |
| 8 | +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] |
| 9 | +pub struct Store { |
| 10 | + pub owner: String, |
| 11 | + pub limits: StoreLimits, |
| 12 | +} |
| 13 | + |
| 14 | +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] |
| 15 | +pub struct StoreLimits { |
| 16 | + pub max_triple_count: Option<Uint128>, |
| 17 | + pub max_byte_size: Option<Uint128>, |
| 18 | + pub max_triple_byte_size: Option<Uint128>, |
| 19 | + pub max_query_limit: Option<Uint128>, |
| 20 | + pub max_query_variable_count: Option<Uint128>, |
| 21 | + pub max_insert_data_byte_size: Option<Uint128>, |
| 22 | + pub max_insert_data_triple_count: Option<Uint128>, |
| 23 | +} |
| 24 | + |
| 25 | +impl From<msg::StoreLimits> for StoreLimits { |
| 26 | + fn from(value: msg::StoreLimits) -> Self { |
| 27 | + StoreLimits { |
| 28 | + max_triple_count: value.max_triple_count, |
| 29 | + max_byte_size: value.max_byte_size, |
| 30 | + max_triple_byte_size: value.max_triple_byte_size, |
| 31 | + max_query_limit: value.max_query_limit, |
| 32 | + max_query_variable_count: value.max_query_variable_count, |
| 33 | + max_insert_data_byte_size: value.max_insert_data_byte_size, |
| 34 | + max_insert_data_triple_count: value.max_insert_data_triple_count, |
| 35 | + } |
| 36 | + } |
| 37 | +} |
0 commit comments