Skip to content

Commit 26a42b2

Browse files
author
Zoran Cvetkov
committed
compilation fixes
1 parent 5049ac7 commit 26a42b2

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

runtime/test/src/test.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,17 +477,18 @@ async fn test_ipfs_block() {
477477
// The user_data value we use with calls to ipfs_map
478478
const USER_DATA: &str = "user_data";
479479

480-
fn make_thing(id: &str, value: &str) -> (String, EntityModification) {
481-
const DOCUMENT: &str = " type Thing @entity { id: String!, value: String!, extra: String }";
480+
fn make_thing(id: &str, value: &str, vid: i64) -> (String, EntityModification) {
481+
const DOCUMENT: &str =
482+
" type Thing @entity { id: String!, value: String!, extra: String, vid: Int8 }";
482483
lazy_static! {
483484
static ref SCHEMA: InputSchema = InputSchema::raw(DOCUMENT, "doesntmatter");
484485
static ref THING_TYPE: EntityType = SCHEMA.entity_type("Thing").unwrap();
485486
}
486-
let data = entity! { SCHEMA => id: id, value: value, extra: USER_DATA };
487+
let data = entity! { SCHEMA => id: id, value: value, extra: USER_DATA, vid:vid };
487488
let key = THING_TYPE.parse_key(id).unwrap();
488489
(
489490
format!("{{ \"id\": \"{}\", \"value\": \"{}\"}}", id, value),
490-
EntityModification::insert(key, data, 0),
491+
EntityModification::insert(key, data, 0, vid),
491492
)
492493
}
493494

@@ -553,8 +554,8 @@ async fn test_ipfs_map(api_version: Version, json_error_msg: &str) {
553554
let subgraph_id = "ipfsMap";
554555

555556
// Try it with two valid objects
556-
let (str1, thing1) = make_thing("one", "eins");
557-
let (str2, thing2) = make_thing("two", "zwei");
557+
let (str1, thing1) = make_thing("one", "eins", 0);
558+
let (str2, thing2) = make_thing("two", "zwei", 0);
558559
let ops = run_ipfs_map(
559560
subgraph_id,
560561
format!("{}\n{}", str1, str2),
@@ -1001,8 +1002,8 @@ async fn test_entity_store(api_version: Version) {
10011002

10021003
let schema = store.input_schema(&deployment.hash).unwrap();
10031004

1004-
let alex = entity! { schema => id: "alex", name: "Alex" };
1005-
let steve = entity! { schema => id: "steve", name: "Steve" };
1005+
let alex = entity! { schema => id: "alex", name: "Alex", vid: 0};
1006+
let steve = entity! { schema => id: "steve", name: "Steve", vid: 1};
10061007
let user_type = schema.entity_type("User").unwrap();
10071008
test_store::insert_entities(
10081009
&deployment,

store/test-store/tests/graph/entity_cache.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ fn insert_modifications() {
221221
assert_eq!(
222222
sort_by_entity_key(result.unwrap().modifications),
223223
sort_by_entity_key(vec![
224-
EntityModification::insert(mogwai_key, mogwai_data, 0),
225-
EntityModification::insert(sigurros_key, sigurros_data, 0)
224+
EntityModification::insert(mogwai_key, mogwai_data, 0, 0),
225+
EntityModification::insert(sigurros_key, sigurros_data, 0, 0)
226226
])
227227
);
228228
}
@@ -265,8 +265,8 @@ fn overwrite_modifications() {
265265
assert_eq!(
266266
sort_by_entity_key(result.unwrap().modifications),
267267
sort_by_entity_key(vec![
268-
EntityModification::overwrite(mogwai_key, mogwai_data, 0),
269-
EntityModification::overwrite(sigurros_key, sigurros_data, 0)
268+
EntityModification::overwrite(mogwai_key, mogwai_data, 0, 0),
269+
EntityModification::overwrite(sigurros_key, sigurros_data, 0, 0)
270270
])
271271
);
272272
}
@@ -304,6 +304,7 @@ fn consecutive_modifications() {
304304
sort_by_entity_key(vec![EntityModification::overwrite(
305305
update_key,
306306
entity! { SCHEMA => id: "mogwai", name: "Mogwai", founded: 1995 },
307+
0,
307308
0
308309
)])
309310
);

store/test-store/tests/postgres/relational.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@ fn conflicting_entity() {
891891
data: fred,
892892
block: 2,
893893
end: None,
894+
vid: 0,
894895
},
895896
2,
896897
)

store/test-store/tests/postgres/relational_bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn row_group_update(
8484
let mut group = RowGroup::new(entity_type.clone(), false);
8585
for (key, data) in data {
8686
group
87-
.push(EntityModification::overwrite(key, data, block), block)
87+
.push(EntityModification::overwrite(key, data, block, 0), block)
8888
.unwrap();
8989
}
9090
group
@@ -98,7 +98,7 @@ pub fn row_group_insert(
9898
let mut group = RowGroup::new(entity_type.clone(), false);
9999
for (key, data) in data {
100100
group
101-
.push(EntityModification::insert(key, data, block), block)
101+
.push(EntityModification::insert(key, data, block, 0), block)
102102
.unwrap();
103103
}
104104
group

store/test-store/tests/postgres/store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ fn handle_large_string_with_index() {
15091509

15101510
let key = USER_TYPE.parse_key(id).unwrap();
15111511

1512-
EntityModification::insert(key, data, block)
1512+
EntityModification::insert(key, data, block, 0)
15131513
}
15141514

15151515
run_test(|store, writable, deployment| async move {
@@ -1608,7 +1608,7 @@ fn handle_large_bytea_with_index() {
16081608

16091609
let key = USER_TYPE.parse_key(id).unwrap();
16101610

1611-
EntityModification::insert(key, data, block)
1611+
EntityModification::insert(key, data, block, 0)
16121612
}
16131613

16141614
run_test(|store, writable, deployment| async move {

0 commit comments

Comments
 (0)