From a9d055d55b310373b17076b9ed079a5a9b878bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Tue, 14 Jun 2022 23:22:16 +0200 Subject: [PATCH] Include the chain specs instead of trying to open them by path (#11625) This makes it possible to run the tests manually, without them expecting to be run in a special folder etc. --- client/beefy/src/tests.rs | 6 +++--- client/finality-grandpa/src/communication/tests.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/beefy/src/tests.rs b/client/beefy/src/tests.rs index 1d035a6a447c2..b5ff27c808908 100644 --- a/client/beefy/src/tests.rs +++ b/client/beefy/src/tests.rs @@ -75,9 +75,9 @@ impl BuildStorage for Genesis { #[test] fn beefy_protocol_name() { - let chain_spec = GenericChainSpec::::from_json_file(std::path::PathBuf::from( - "../chain-spec/res/chain_spec.json", - )) + let chain_spec = GenericChainSpec::::from_json_bytes( + &include_bytes!("../../chain-spec/res/chain_spec.json")[..], + ) .unwrap() .cloned_box(); diff --git a/client/finality-grandpa/src/communication/tests.rs b/client/finality-grandpa/src/communication/tests.rs index e41d21fc0684e..0ec5092a2a047 100644 --- a/client/finality-grandpa/src/communication/tests.rs +++ b/client/finality-grandpa/src/communication/tests.rs @@ -551,9 +551,9 @@ fn local_chain_spec() -> Box { Ok(()) } } - let chain_spec = GenericChainSpec::::from_json_file(std::path::PathBuf::from( - "../chain-spec/res/chain_spec.json", - )) + let chain_spec = GenericChainSpec::::from_json_bytes( + &include_bytes!("../../../chain-spec/res/chain_spec.json")[..], + ) .unwrap(); chain_spec.cloned_box() }