Skip to content

Commit 314bf4a

Browse files
bdeneuxamimart
authored andcommitted
feat(law): update state with object and dependencies
1 parent 8819c38 commit 314bf4a

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

contracts/cw-law-stone/src/state.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
use schemars::JsonSchema;
22
use serde::{Deserialize, Serialize};
33

4-
use cw_storage_plus::Item;
5-
6-
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
7-
pub struct Law {
8-
/// The `cw-storage` object link to the Prolog program carrying law rules and facts.
9-
pub program: Object,
10-
11-
/// The list of all `cw-storage` dependencies of the law program.
12-
pub dependencies: Vec<String>,
13-
}
4+
use cw_storage_plus::{Item, Map};
145

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

25-
pub const LAW: Item<'_, Law> = Item::new("law");
16+
pub const PROGRAM: Item<'_, Object> = Item::new("program");
17+
18+
pub const DEPENDENCIES: Map<'_, &str, Object> = Map::new("dependencies");

0 commit comments

Comments
 (0)