From 7b1d901ea0f66b29ec046098ee5e229c5d3fdb09 Mon Sep 17 00:00:00 2001 From: rishflab Date: Fri, 12 Mar 2021 11:01:52 +1100 Subject: [PATCH 1/3] Fix incorrectly formatted tag --- swap/tests/testutils/bitcoind.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/tests/testutils/bitcoind.rs b/swap/tests/testutils/bitcoind.rs index 40151537..f6fd5800 100644 --- a/swap/tests/testutils/bitcoind.rs +++ b/swap/tests/testutils/bitcoind.rs @@ -72,7 +72,7 @@ impl Image for Bitcoind { impl Default for Bitcoind { fn default() -> Self { Bitcoind { - tag: "v0.19.1".into(), + tag: "0.19.1".into(), args: BitcoindArgs::default(), entrypoint: Some("/usr/bin/bitcoind".into()), volume: None, From 9f534996ee10f6db56607d8a35b1fb4356b3cc44 Mon Sep 17 00:00:00 2001 From: rishflab Date: Fri, 12 Mar 2021 12:50:42 +1100 Subject: [PATCH 2/3] Remove unused capability to configure bitcoind docker version tag We only use one version of this container --- swap/tests/testutils/bitcoind.rs | 11 +---------- swap/tests/testutils/mod.rs | 4 +--- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/swap/tests/testutils/bitcoind.rs b/swap/tests/testutils/bitcoind.rs index f6fd5800..8f8873e7 100644 --- a/swap/tests/testutils/bitcoind.rs +++ b/swap/tests/testutils/bitcoind.rs @@ -10,7 +10,6 @@ pub const DATADIR: &str = "/home/bdk"; #[derive(Debug)] pub struct Bitcoind { - tag: String, args: BitcoindArgs, entrypoint: Option, volume: Option, @@ -23,7 +22,7 @@ impl Image for Bitcoind { type EntryPoint = str; fn descriptor(&self) -> String { - format!("coblox/bitcoin-core:{}", self.tag) + "coblox/bitcoin-core:0.21.0".to_string() } fn wait_until_ready(&self, container: &Container<'_, D, Self>) { @@ -72,7 +71,6 @@ impl Image for Bitcoind { impl Default for Bitcoind { fn default() -> Self { Bitcoind { - tag: "0.19.1".into(), args: BitcoindArgs::default(), entrypoint: Some("/usr/bin/bitcoind".into()), volume: None, @@ -81,13 +79,6 @@ impl Default for Bitcoind { } impl Bitcoind { - pub fn with_tag(self, tag_str: &str) -> Self { - Bitcoind { - tag: tag_str.to_string(), - ..self - } - } - pub fn with_volume(mut self, volume: String) -> Self { self.volume = Some(volume); self diff --git a/swap/tests/testutils/mod.rs b/swap/tests/testutils/mod.rs index e3d2c744..58efebe3 100644 --- a/swap/tests/testutils/mod.rs +++ b/swap/tests/testutils/mod.rs @@ -468,9 +468,7 @@ async fn init_bitcoind_container( name: String, network: String, ) -> Result<(Container<'_, Cli, bitcoind::Bitcoind>, Url)> { - let image = bitcoind::Bitcoind::default() - .with_volume(volume) - .with_tag("0.19.1"); + let image = bitcoind::Bitcoind::default().with_volume(volume); let run_args = RunArgs::default().with_name(name).with_network(network); From 7cb198aea1d830d4c0adced6fec2757dd8561445 Mon Sep 17 00:00:00 2001 From: rishflab Date: Fri, 12 Mar 2021 12:52:23 +1100 Subject: [PATCH 3/3] Remove pointless todo The container is defined in the tests module indicating it is only suitable for these tests --- swap/tests/testutils/bitcoind.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/swap/tests/testutils/bitcoind.rs b/swap/tests/testutils/bitcoind.rs index 8f8873e7..9f1fcd03 100644 --- a/swap/tests/testutils/bitcoind.rs +++ b/swap/tests/testutils/bitcoind.rs @@ -98,8 +98,6 @@ impl IntoIterator for BitcoindArgs { type Item = String; type IntoIter = ::std::vec::IntoIter; - // todo: these "defaults" are only suitable for our tests and need to be looked - // at fn into_iter(self) -> ::IntoIter { let args = vec![ "-server".to_string(),