Skip to content

Commit 7f8e28d

Browse files
committed
tests: Fix warnings from clippy::assertions_on_constants
1 parent 6fe5d47 commit 7f8e28d

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

chain/common/tests/test-acme.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn required_ok() {
6363
!f.required,
6464
"Transaction.events field should NOT be required!"
6565
),
66-
_ => assert!(false, "Unexpected message field [{}]!", f.name),
66+
_ => panic!("Unexpected message field [{}]!", f.name),
6767
};
6868
});
6969
}

graph/src/util/jobs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ mod tests {
142142
break;
143143
}
144144
if start.elapsed() > Duration::from_secs(2) {
145-
assert!(false, "Counting to 10 took longer than 2 seconds");
145+
panic!("Counting to 10 took longer than 2 seconds");
146146
}
147147
}
148148

runtime/test/src/test.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ async fn test_entity_store(api_version: Version) {
10811081
assert_eq!(Some(&Value::from("steve")), data.get("id"));
10821082
assert_eq!(Some(&Value::from("Steve-O")), data.get("name"));
10831083
}
1084-
_ => assert!(false, "expected Overwrite modification"),
1084+
_ => panic!("expected Overwrite modification"),
10851085
}
10861086

10871087
// Load, set, save cycle for a new entity with fulltext API
@@ -1104,7 +1104,7 @@ async fn test_entity_store(api_version: Version) {
11041104
assert_eq!(Some(&Value::from("herobrine")), data.get("id"));
11051105
assert_eq!(Some(&Value::from("Brine-O")), data.get("name"));
11061106
}
1107-
_ => assert!(false, "expected Insert modification"),
1107+
_ => panic!("expected Insert modification"),
11081108
};
11091109
}
11101110

@@ -1123,20 +1123,16 @@ fn test_detect_contract_calls(api_version: Version) {
11231123
&wasm_file_path("abi_store_value.wasm", api_version.clone()),
11241124
api_version.clone(),
11251125
);
1126-
assert!(
1127-
!data_source_without_calls
1128-
.mapping
1129-
.requires_archive()
1130-
.unwrap()
1131-
);
1126+
assert!(!data_source_without_calls
1127+
.mapping
1128+
.requires_archive()
1129+
.unwrap());
11321130

11331131
let data_source_with_calls = mock_data_source(
11341132
&wasm_file_path("contract_calls.wasm", api_version.clone()),
11351133
api_version,
11361134
);
1137-
assert!(
1138-
data_source_with_calls.mapping.requires_archive().unwrap()
1139-
);
1135+
assert!(data_source_with_calls.mapping.requires_archive().unwrap());
11401136
}
11411137

11421138
#[graph::test]

0 commit comments

Comments
 (0)