Skip to content

Commit ac9237b

Browse files
committed
fix(rad): make runtime-needing tests run into tokio::test runtime
1 parent 951f09c commit ac9237b

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

rad/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description = "RAD component"
1010
rocksdb-backend = ["witnet_data_structures/rocksdb-backend"]
1111

1212
[dev-dependencies]
13-
tokio = "1.44.1"
13+
tokio = { version = "1.44.1", features = ["macros"]}
1414

1515
[dependencies]
1616
anyhow = "1.0.98"

rad/src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,8 +1710,8 @@ mod tests {
17101710
}
17111711

17121712
/// Test try_data_request with a RNG source
1713-
#[test]
1714-
fn test_try_data_request_rng() {
1713+
#[tokio::test]
1714+
async fn test_try_data_request_rng() {
17151715
let request = RADRequest {
17161716
time_lock: 0,
17171717
retrieve: vec![RADRetrieve {
@@ -1747,8 +1747,8 @@ mod tests {
17471747
}
17481748
}
17491749

1750-
#[test]
1751-
fn test_try_data_request_http_post_non_ascii_header_key() {
1750+
#[tokio::test]
1751+
async fn test_try_data_request_http_post_non_ascii_header_key() {
17521752
let script_r = Value::Array(vec![]);
17531753
let packed_script_r = serde_cbor::to_vec(&script_r).unwrap();
17541754
let body = Vec::from(String::from(""));
@@ -1801,8 +1801,8 @@ mod tests {
18011801
);
18021802
}
18031803

1804-
#[test]
1805-
fn test_try_data_request_http_post_non_ascii_header_value() {
1804+
#[tokio::test]
1805+
async fn test_try_data_request_http_post_non_ascii_header_value() {
18061806
let script_r = Value::Array(vec![]);
18071807
let packed_script_r = serde_cbor::to_vec(&script_r).unwrap();
18081808
let body = Vec::from(String::from(""));
@@ -1855,8 +1855,8 @@ mod tests {
18551855
);
18561856
}
18571857

1858-
#[test]
1859-
fn test_try_data_request_http_post_header_colon() {
1858+
#[tokio::test]
1859+
async fn test_try_data_request_http_post_header_colon() {
18601860
let script_r = Value::Array(vec![]);
18611861
let packed_script_r = serde_cbor::to_vec(&script_r).unwrap();
18621862
let body = Vec::from(String::from(""));
@@ -1909,8 +1909,8 @@ mod tests {
19091909
);
19101910
}
19111911

1912-
#[test]
1913-
fn test_try_data_request_http_post_header_value_newline() {
1912+
#[tokio::test]
1913+
async fn test_try_data_request_http_post_header_value_newline() {
19141914
let script_r = Value::Array(vec![]);
19151915
let packed_script_r = serde_cbor::to_vec(&script_r).unwrap();
19161916
let body = Vec::from(String::from(""));
@@ -1964,8 +1964,8 @@ mod tests {
19641964
}
19651965

19661966
/// Ensure that `try_data_request` filters errors before calling `run_aggregation`.
1967-
#[test]
1968-
fn test_try_data_request_filters_aggregation_errors() {
1967+
#[tokio::test]
1968+
async fn test_try_data_request_filters_aggregation_errors() {
19691969
let script = cbor_to_vec(&Value::Array(vec![Value::Integer(
19701970
RadonOpCodes::StringAsInteger as i128,
19711971
)]))

0 commit comments

Comments
 (0)