File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ impl Downstream {
291291 }
292292 Err ( e) => {
293293 error ! ( "{e}" ) ;
294- Err ( Error :: V1Protocol ( e ) )
294+ Err ( Error :: V1Protocol ( Box :: new ( e ) ) )
295295 }
296296 }
297297 }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ pub async fn start_receive_downstream(
4040 // Message received could not be converted to rpc message
4141 error ! (
4242 "{}" ,
43- Error :: V1Protocol ( sv1_api:: error:: Error :: InvalidJsonRpcMessageKind , )
43+ Error :: V1Protocol ( Box :: new ( sv1_api:: error:: Error :: InvalidJsonRpcMessageKind ) )
4444 ) ;
4545 return ;
4646 }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ pub enum Error<'a> {
88 InvalidExtranonce ( String ) ,
99 /// Errors from `roles_logic_sv2` crate.
1010 RolesSv2Logic ( roles_logic_sv2:: errors:: Error ) ,
11- V1Protocol ( sv1_api:: error:: Error < ' a > ) ,
11+ V1Protocol ( Box < sv1_api:: error:: Error < ' a > > ) ,
1212 // Locking Errors
1313 PoisonLock ,
1414 TranslatorUpstreamMutexPoisoned ,
@@ -78,3 +78,9 @@ impl From<roles_logic_sv2::Error> for Error<'_> {
7878 Self :: RolesSv2Logic ( value)
7979 }
8080}
81+
82+ impl < ' a > From < sv1_api:: error:: Error < ' a > > for Error < ' a > {
83+ fn from ( value : sv1_api:: error:: Error < ' a > ) -> Self {
84+ Self :: V1Protocol ( Box :: new ( value) )
85+ }
86+ }
Original file line number Diff line number Diff line change @@ -351,7 +351,11 @@ impl Bridge {
351351 // regarding version masking see https://github.com/slushpool/stratumprotocol/blob/master/stratum-extensions.mediawiki#changes-in-request-miningsubmit
352352 ( Some ( vb) , Some ( mask) ) => ( last_version & !mask. 0 ) | ( vb. 0 & mask. 0 ) ,
353353 ( None , None ) => last_version,
354- _ => return Err ( Error :: V1Protocol ( sv1_api:: error:: Error :: InvalidSubmission ) ) ,
354+ _ => {
355+ return Err ( Error :: V1Protocol ( Box :: new (
356+ sv1_api:: error:: Error :: InvalidSubmission ,
357+ ) ) )
358+ }
355359 } ;
356360 let mining_device_extranonce: Vec < u8 > = sv1_submit. extra_nonce2 . into ( ) ;
357361 let extranonce2 = mining_device_extranonce;
You can’t perform that action at this time.
0 commit comments