Skip to content

Commit

Permalink
feat(law): update state with object and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux authored and amimart committed Mar 23, 2023
1 parent 8819c38 commit 314bf4a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions contracts/cw-law-stone/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use cw_storage_plus::Item;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct Law {
/// The `cw-storage` object link to the Prolog program carrying law rules and facts.
pub program: Object,

/// The list of all `cw-storage` dependencies of the law program.
pub dependencies: Vec<String>,
}
use cw_storage_plus::{Item, Map};

/// Represent a link to an Object stored in the `cw-storage` contract.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
Expand All @@ -22,4 +13,6 @@ pub struct Object {
pub storage_address: String,
}

pub const LAW: Item<'_, Law> = Item::new("law");
pub const PROGRAM: Item<'_, Object> = Item::new("program");

pub const DEPENDENCIES: Map<'_, &str, Object> = Map::new("dependencies");

0 comments on commit 314bf4a

Please sign in to comment.