mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 19:29:56 +00:00
rustfmt staking-miner and fix typos
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
@@ -41,14 +41,17 @@ where
|
||||
Poll::Ready(v) => {
|
||||
let elapsed = start.elapsed();
|
||||
Poll::Ready((v, elapsed))
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TimedFuture: Sized + Future {
|
||||
fn timed(self) -> Timed<Self> {
|
||||
Timed { inner: self, start: None }
|
||||
Timed {
|
||||
inner: self,
|
||||
start: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,15 +62,15 @@ pub struct RuntimeDispatchInfo {
|
||||
pub weight: Weight,
|
||||
}
|
||||
|
||||
pub fn kill_main_task_if_critical_err(tx: &tokio::sync::mpsc::UnboundedSender<Error>, err::Error) {
|
||||
pub fn kill_main_task_if_critical_err(tx: &tokio::sync::mpsc::UnboundedSender<Error>, err: Error) {
|
||||
match err {
|
||||
Error::AlreadySubmitted |
|
||||
Error::BetterScoreExist |
|
||||
Error::IncorrectPhase |
|
||||
Error::TransactionRejected |
|
||||
Error::JoinError |
|
||||
Error::Feasibility |
|
||||
Error::EmptySnapshot => {},
|
||||
Error::AlreadySubmitted
|
||||
| Error::BetterScoreExist
|
||||
| Error::IncorrectPhase
|
||||
| Error::TransactionRejected
|
||||
| Error::JoinError
|
||||
| Error::Feasibility
|
||||
| Error::EmptySnapshot => {}
|
||||
Error::Subxt(SubxtError::Rpc(rpc_err)) => {
|
||||
log::debug!(target: LOG_TARGET, "rpc error: {:?}", rpc_err);
|
||||
|
||||
@@ -77,10 +80,11 @@ pub fn kill_main_task_if_critical_err(tx: &tokio::sync::mpsc::UnboundedSender<Er
|
||||
Ok(e) => *e,
|
||||
Err(_) => {
|
||||
let _ = tx.send(Error::Other(
|
||||
"Failed to downcast RPC error; this is a bug please file an issue".to_string()
|
||||
"Failed to downcast RPC error; this is a bug please file an issue"
|
||||
.to_string(),
|
||||
));
|
||||
return;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
match jsonrpsee_err {
|
||||
@@ -89,30 +93,30 @@ pub fn kill_main_task_if_critical_err(tx: &tokio::sync::mpsc::UnboundedSender<Er
|
||||
const VERIFICATION_ERROR: i32 = 1002;
|
||||
use jsonrpsee::types::error::ErrorCode;
|
||||
|
||||
if e.code() == BAD_EXTRINSIC_FORMAT ||
|
||||
e.code() == VERIFICATION_ERROR ||
|
||||
e.code() == ErrorCode::MethodNotFound.code()
|
||||
if e.code() == BAD_EXTRINSIC_FORMAT
|
||||
|| e.code() == VERIFICATION_ERROR
|
||||
|| e.code() == ErrorCode::MethodNotFound.code()
|
||||
{
|
||||
let _ = tx.send(Error::Subxt(SubxtError::Rpc(
|
||||
RpcError::ClientError(Box::new(JsonRpseeError::Call(e))),
|
||||
)));
|
||||
}
|
||||
},
|
||||
JsonRpseeError::RequestTimeout => {},
|
||||
}
|
||||
JsonRpseeError::RequestTimeout => {}
|
||||
err => {
|
||||
let _ = tx.send(Error::Subxt(SubxtError::Rpc(RpcError::ClientError(
|
||||
Box::new(err),
|
||||
))));
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
RpcError::SubscriptionDropped => (),
|
||||
_ => (),
|
||||
}
|
||||
},
|
||||
}
|
||||
err => {
|
||||
let _ = tx.send(err);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user