diff --git a/protocols/v1/src/methods/client_to_server.rs b/protocols/v1/src/methods/client_to_server.rs index 559c3f61e..0e837db48 100644 --- a/protocols/v1/src/methods/client_to_server.rs +++ b/protocols/v1/src/methods/client_to_server.rs @@ -97,7 +97,7 @@ fn from_to_json_rpc(auth: Authorize) -> bool { /// _mining.extranonce.subscribe()_ /// Indicates to the server that the client supports the mining.set_extranonce method. /// https://en.bitcoin.it/wiki/BIP_0310 -#[derive(Debug)] +#[derive(Debug, Clone, Copy)] pub struct ExtranonceSubscribe(); // mining.get_transactions @@ -339,7 +339,7 @@ impl<'a> TryFrom for Subscribe<'a> { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Configure { extensions: Vec, id: u64, @@ -432,7 +432,7 @@ impl TryFrom for Configure { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum ConfigureExtension { VersionRolling(VersionRollingParams), MinimumDifficulty(u64), @@ -599,7 +599,7 @@ impl From for serde_json::Map { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct VersionRollingParams { mask: Option, min_bit_count: Option, @@ -629,7 +629,7 @@ impl From for serde_json::Map { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct InfoParams { connection_url: Option, #[allow(dead_code)] diff --git a/protocols/v1/src/methods/mod.rs b/protocols/v1/src/methods/mod.rs index 152fb8b1a..b7bde1d4e 100644 --- a/protocols/v1/src/methods/mod.rs +++ b/protocols/v1/src/methods/mod.rs @@ -9,7 +9,7 @@ pub mod server_to_client; use crate::json_rpc::{Message, Response}; /// Errors encountered during conversion between valid json_rpc messages and Sv1 messages. -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum MethodError<'a> { /// If the json_rpc message call a method not defined by Sv1. It contains the called method MethodNotFound(String), @@ -48,7 +48,7 @@ impl From for ParsingMethodError { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum ParsingMethodError { BadU256Convert(Box), HexError(Box), @@ -115,7 +115,7 @@ impl ParsingMethodError { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum Method<'a> { Client2Server(Client2Server<'a>), Server2Client(Server2Client<'a>), @@ -123,7 +123,7 @@ pub enum Method<'a> { ErrorMessage(Message), } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum Client2Server<'a> { SuggestDifficulty(), Subscribe(client_to_server::Subscribe<'a>), @@ -153,7 +153,7 @@ impl<'a> TryFrom for Client2Server<'a> { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum Server2Client<'a> { Notify(server_to_client::Notify<'a>), SetDifficulty(server_to_client::SetDifficulty), @@ -181,7 +181,7 @@ impl<'a> TryFrom for Server2Client<'a> { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum Server2ClientResponse<'a> { Configure(server_to_client::Configure), Subscribe(server_to_client::Subscribe<'a>), diff --git a/protocols/v1/src/methods/server_to_client.rs b/protocols/v1/src/methods/server_to_client.rs index f70c77a56..dc5e6163e 100644 --- a/protocols/v1/src/methods/server_to_client.rs +++ b/protocols/v1/src/methods/server_to_client.rs @@ -235,7 +235,7 @@ impl<'a> TryFrom for SetExtranonce<'a> { } } -#[derive(Debug)] +#[derive(Debug, Clone)] /// Server may arbitrarily adjust version mask pub struct SetVersionMask { version_mask: HexU32Be, @@ -423,7 +423,7 @@ impl<'a> TryFrom<&Response> for Subscribe<'a> { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Configure { pub id: u64, pub version_rolling: Option, @@ -548,7 +548,7 @@ impl TryFrom<&Response> for Configure { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct VersionRollingParams { pub version_rolling: bool, pub version_rolling_mask: HexU32Be, diff --git a/protocols/v2/binary-sv2/no-serde-sv2/codec/src/lib.rs b/protocols/v2/binary-sv2/no-serde-sv2/codec/src/lib.rs index 2afb2b18a..8f7d96e62 100644 --- a/protocols/v2/binary-sv2/no-serde-sv2/codec/src/lib.rs +++ b/protocols/v2/binary-sv2/no-serde-sv2/codec/src/lib.rs @@ -64,7 +64,7 @@ pub mod encodable { #[macro_use] extern crate alloc; -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum Error { OutOfBound, NotABool(u8),