Skip to content

Commit dd872d6

Browse files
committed
Make response types Clone
.. as it's convenient.
1 parent 5ecb26f commit dd872d6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/types.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ where
161161
}
162162

163163
/// Response to a [`script_get_history`](../client/struct.Client.html#method.script_get_history) request.
164-
#[derive(Debug, Deserialize)]
164+
#[derive(Clone, Debug, Deserialize)]
165165
pub struct GetHistoryRes {
166166
/// Confirmation height of the transaction. 0 if unconfirmed, -1 if unconfirmed while some of
167167
/// its inputs are unconfirmed too.
@@ -173,7 +173,7 @@ pub struct GetHistoryRes {
173173
}
174174

175175
/// Response to a [`script_list_unspent`](../client/struct.Client.html#method.script_list_unspent) request.
176-
#[derive(Debug, Deserialize)]
176+
#[derive(Clone, Debug, Deserialize)]
177177
pub struct ListUnspentRes {
178178
/// Confirmation height of the transaction that created this output.
179179
pub height: usize,
@@ -186,7 +186,7 @@ pub struct ListUnspentRes {
186186
}
187187

188188
/// Response to a [`server_features`](../client/struct.Client.html#method.server_features) request.
189-
#[derive(Debug, Deserialize)]
189+
#[derive(Clone, Debug, Deserialize)]
190190
pub struct ServerFeaturesRes {
191191
/// Server version reported.
192192
pub server_version: String,
@@ -204,7 +204,7 @@ pub struct ServerFeaturesRes {
204204
}
205205

206206
/// Response to a [`server_features`](../client/struct.Client.html#method.server_features) request.
207-
#[derive(Debug, Deserialize)]
207+
#[derive(Clone, Debug, Deserialize)]
208208
pub struct GetHeadersRes {
209209
/// Maximum number of headers returned in a single response.
210210
pub max: usize,
@@ -219,7 +219,7 @@ pub struct GetHeadersRes {
219219
}
220220

221221
/// Response to a [`script_get_balance`](../client/struct.Client.html#method.script_get_balance) request.
222-
#[derive(Debug, Deserialize)]
222+
#[derive(Clone, Debug, Deserialize)]
223223
pub struct GetBalanceRes {
224224
/// Confirmed balance in Satoshis for the address.
225225
pub confirmed: u64,
@@ -230,7 +230,7 @@ pub struct GetBalanceRes {
230230
}
231231

232232
/// Response to a [`transaction_get_merkle`](../client/struct.Client.html#method.transaction_get_merkle) request.
233-
#[derive(Debug, Deserialize)]
233+
#[derive(Clone, Debug, Deserialize)]
234234
pub struct GetMerkleRes {
235235
/// Height of the block that confirmed the transaction
236236
pub block_height: usize,
@@ -242,7 +242,7 @@ pub struct GetMerkleRes {
242242
}
243243

244244
/// Notification of a new block header
245-
#[derive(Debug, Deserialize)]
245+
#[derive(Clone, Debug, Deserialize)]
246246
pub struct HeaderNotification {
247247
/// New block height.
248248
pub height: usize,
@@ -252,7 +252,7 @@ pub struct HeaderNotification {
252252
}
253253

254254
/// Notification of a new block header with the header encoded as raw bytes
255-
#[derive(Debug, Deserialize)]
255+
#[derive(Clone, Debug, Deserialize)]
256256
pub struct RawHeaderNotification {
257257
/// New block height.
258258
pub height: usize,
@@ -273,7 +273,7 @@ impl TryFrom<RawHeaderNotification> for HeaderNotification {
273273
}
274274

275275
/// Notification of the new status of a script
276-
#[derive(Debug, Deserialize)]
276+
#[derive(Clone, Debug, Deserialize)]
277277
pub struct ScriptNotification {
278278
/// Address that generated this notification.
279279
pub scripthash: ScriptHash,

0 commit comments

Comments
 (0)