Bump to latest scale-encode/decode/value and fix test running (#1103)

* Bump to latest scale-encode,decode,value and fix test running

* remove patch deps

* update CI to spit out 'substrate-node' binary now

* fmt

* Fix test: compact type ID no longer present so can't re-encode Value in same way

* remove patch

* Fix cargo.lock

* Fix other compact test
This commit is contained in:
James Wilson
2023-08-02 13:55:48 +01:00
committed by GitHub
parent fd853b9b72
commit 2176ec9fa7
10 changed files with 80 additions and 105 deletions
+7 -12
View File
@@ -6,21 +6,16 @@ pub(crate) use crate::{node_runtime, utils::TestNodeProcess};
use subxt::SubstrateConfig;
/// substrate node should be installed on the $PATH
const SUBSTRATE_NODE_PATH: &str = "substrate";
/// `substrate-node` should be installed on the $PATH. We fall back
/// to also checking for an older `substrate` binary.
const SUBSTRATE_NODE_PATHS: &str = "substrate-node,substrate";
pub async fn test_context_with(authority: String) -> TestContext {
let path = std::env::var("SUBSTRATE_NODE_PATH").unwrap_or_else(|_| {
if which::which(SUBSTRATE_NODE_PATH).is_err() {
panic!(
"A substrate binary should be installed on your path for integration tests. \
See https://github.com/paritytech/subxt/tree/master#integration-testing"
)
}
SUBSTRATE_NODE_PATH.to_string()
});
let paths =
std::env::var("SUBSTRATE_NODE_PATH").unwrap_or_else(|_| SUBSTRATE_NODE_PATHS.to_string());
let paths: Vec<_> = paths.split(',').map(|p| p.trim()).collect();
let mut proc = TestContext::build(path.as_str());
let mut proc = TestContext::build(&paths);
proc.with_authority(authority);
proc.spawn::<SubstrateConfig>().await.unwrap()
}