Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv committed Nov 18, 2024
1 parent 3d9e05f commit 9af183d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion graph/src/data/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -913,10 +913,12 @@ impl Entity {
Id::try_from(self.get("id").unwrap().clone()).expect("the id is set to a valid value")
}

// TODO: only for tests!
// TODO: try to use it only for tests!
// #[cfg(debug_assertions)]
pub fn vid(&self) -> i64 {
self.get("vid")
.expect("the vid is set")
// .unwrap_or(&Value::Int8(0))
.as_int8()
.expect("the vid is set to a valid value")
}
Expand Down
8 changes: 4 additions & 4 deletions store/test-store/tests/core/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,11 +1114,11 @@ async fn enums() {
let entities = vec![
(
"Trajectory",
entity! { schema => id: "1", direction: "EAST", meters: 10, vid: 0i64},
entity! { schema => id: "1", direction: "EAST", meters: 10, vid: 0i64 },
),
(
"Trajectory",
entity! { schema => id: "2", direction: "NORTH", meters: 15, vid: 1i64},
entity! { schema => id: "2", direction: "NORTH", meters: 15, vid: 1i64 },
),
];
let query = "query { trajectories { id, direction, meters } }";
Expand Down Expand Up @@ -1365,11 +1365,11 @@ async fn derived_interface_bytes() {
("Pool", entity! { schema => id: b("0xf001"), vid: 0i64 }),
(
"Sell",
entity! { schema => id: b("0xc0"), pool: "0xf001", vid: 0i64},
entity! { schema => id: b("0xc0"), pool: "0xf001", vid: 0i64 },
),
(
"Buy",
entity! { schema => id: b("0xb0"), pool: "0xf001", vid: 0i64},
entity! { schema => id: b("0xb0"), pool: "0xf001", vid: 0i64 },
),
];

Expand Down

0 comments on commit 9af183d

Please sign in to comment.