Skip to content

Commit 9e117db

Browse files
committed
Move TemplateRequest and TemplateRules to appropriate module
1 parent 8b7e587 commit 9e117db

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

client/src/client_sync/mod.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -259,24 +259,3 @@ pub struct WalletCreateFundedPsbtInput {
259259
txid: Txid,
260260
vout: u32,
261261
}
262-
263-
/// Arg for the `getblocktemplate` method.
264-
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
265-
pub struct TemplateRequest {
266-
/// A list of strings.
267-
pub rules: Vec<TemplateRules>,
268-
}
269-
270-
/// Client side supported softfork deployment.
271-
#[derive(Copy, Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
272-
#[serde(rename_all = "lowercase")]
273-
pub enum TemplateRules {
274-
/// SegWit v0 supported.
275-
Segwit,
276-
/// Signet supported.
277-
Signet,
278-
/// CSV supported.
279-
Csv,
280-
/// Taproot supported.
281-
Taproot,
282-
}

client/src/client_sync/v17/mining.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ macro_rules! impl_client_v17__getblocktemplate {
1616
impl Client {
1717
pub fn get_block_template(
1818
&self,
19-
request: &$crate::client_sync::TemplateRequest,
19+
request: &$crate::client_sync::v17::TemplateRequest,
2020
) -> Result<GetBlockTemplate> {
2121
self.call("getblocktemplate", &[into_json(request)?])
2222
}

client/src/client_sync/v17/mod.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,26 @@ impl fmt::Display for AddressType {
149149
fmt::Display::fmt(s, f)
150150
}
151151
}
152+
153+
/// Arg for the `getblocktemplate` method.
154+
///
155+
/// For Core versions 0.17 through to v28. For Core v29 and onwards use `v29::TemplateRequest`.
156+
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
157+
pub struct TemplateRequest {
158+
/// A list of strings.
159+
pub rules: Vec<TemplateRules>,
160+
}
161+
162+
/// Client side supported softfork deployment.
163+
#[derive(Copy, Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
164+
#[serde(rename_all = "lowercase")]
165+
pub enum TemplateRules {
166+
/// SegWit v0 supported.
167+
Segwit,
168+
/// Signet supported.
169+
Signet,
170+
/// CSV supported.
171+
Csv,
172+
/// Taproot supported.
173+
Taproot,
174+
}

integration_test/tests/mining.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use bitcoin::SignedAmount;
88
use integration_test::{Node, NodeExt as _, Wallet};
9-
use node::client::client_sync::{TemplateRequest, TemplateRules};
9+
use node::client::client_sync::v17::{TemplateRequest, TemplateRules};
1010
use node::vtype::*; // All the version specific types.
1111
use node::mtype;
1212

0 commit comments

Comments
 (0)