style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -79,14 +79,18 @@ pub fn execution_method_from_cli(
|
||||
|
||||
pezsc_service::config::WasmExecutionMethod::Compiled {
|
||||
instantiation_strategy: match instantiation_strategy {
|
||||
WasmtimeInstantiationStrategy::PoolingCopyOnWrite =>
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
|
||||
WasmtimeInstantiationStrategy::RecreateInstanceCopyOnWrite =>
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::RecreateInstanceCopyOnWrite,
|
||||
WasmtimeInstantiationStrategy::Pooling =>
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::Pooling,
|
||||
WasmtimeInstantiationStrategy::RecreateInstance =>
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::RecreateInstance,
|
||||
WasmtimeInstantiationStrategy::PoolingCopyOnWrite => {
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::PoolingCopyOnWrite
|
||||
},
|
||||
WasmtimeInstantiationStrategy::RecreateInstanceCopyOnWrite => {
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::RecreateInstanceCopyOnWrite
|
||||
},
|
||||
WasmtimeInstantiationStrategy::Pooling => {
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::Pooling
|
||||
},
|
||||
WasmtimeInstantiationStrategy::RecreateInstance => {
|
||||
pezsc_service::config::WasmtimeInstantiationStrategy::RecreateInstance
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,10 +106,12 @@ pub enum TrieCacheWarmUpStrategy {
|
||||
impl From<TrieCacheWarmUpStrategy> for pezsc_service::config::TrieCacheWarmUpStrategy {
|
||||
fn from(strategy: TrieCacheWarmUpStrategy) -> Self {
|
||||
match strategy {
|
||||
TrieCacheWarmUpStrategy::NonBlocking =>
|
||||
pezsc_service::config::TrieCacheWarmUpStrategy::NonBlocking,
|
||||
TrieCacheWarmUpStrategy::Blocking =>
|
||||
pezsc_service::config::TrieCacheWarmUpStrategy::Blocking,
|
||||
TrieCacheWarmUpStrategy::NonBlocking => {
|
||||
pezsc_service::config::TrieCacheWarmUpStrategy::NonBlocking
|
||||
},
|
||||
TrieCacheWarmUpStrategy::Blocking => {
|
||||
pezsc_service::config::TrieCacheWarmUpStrategy::Blocking
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,15 +240,16 @@ impl NetworkParams {
|
||||
// Activate if the user explicitly requested local discovery, `--dev` is given or the
|
||||
// chain type is `Local`/`Development`
|
||||
let allow_non_globals_in_dht =
|
||||
self.discover_local ||
|
||||
is_dev || matches!(chain_type, ChainType::Local | ChainType::Development);
|
||||
self.discover_local
|
||||
|| is_dev || matches!(chain_type, ChainType::Local | ChainType::Development);
|
||||
|
||||
let allow_private_ip = match (self.allow_private_ip, self.no_private_ip) {
|
||||
(true, true) => unreachable!("`*_private_ip` flags are mutually exclusive; qed"),
|
||||
(true, false) => true,
|
||||
(false, true) => false,
|
||||
(false, false) =>
|
||||
is_dev || matches!(chain_type, ChainType::Local | ChainType::Development),
|
||||
(false, false) => {
|
||||
is_dev || matches!(chain_type, ChainType::Local | ChainType::Development)
|
||||
},
|
||||
};
|
||||
|
||||
NetworkConfiguration {
|
||||
|
||||
@@ -115,9 +115,9 @@ impl NodeKeyParams {
|
||||
.node_key_file
|
||||
.clone()
|
||||
.unwrap_or_else(|| net_config_dir.join(NODE_KEY_ED25519_FILE));
|
||||
if !self.unsafe_force_node_key_generation &&
|
||||
role.is_authority() &&
|
||||
!is_dev && !key_path.exists()
|
||||
if !self.unsafe_force_node_key_generation
|
||||
&& role.is_authority()
|
||||
&& !is_dev && !key_path.exists()
|
||||
{
|
||||
return Err(Error::NetworkKeyNotFound(key_path));
|
||||
}
|
||||
@@ -169,7 +169,9 @@ mod tests {
|
||||
params.node_key(net_config_dir, Role::Authority, false).and_then(|c| match c {
|
||||
NodeKeyConfig::Ed25519(pezsc_network::config::Secret::Input(ref ski))
|
||||
if node_key_type == NodeKeyType::Ed25519 && &sk[..] == ski.as_ref() =>
|
||||
Ok(()),
|
||||
{
|
||||
Ok(())
|
||||
},
|
||||
_ => Err(error::Error::Input("Unexpected node key config".into())),
|
||||
})
|
||||
})
|
||||
@@ -239,9 +241,11 @@ mod tests {
|
||||
let typ = params.node_key_type;
|
||||
params.node_key(net_config_dir, role, is_dev).and_then(move |c| match c {
|
||||
NodeKeyConfig::Ed25519(pezsc_network::config::Secret::File(ref f))
|
||||
if typ == NodeKeyType::Ed25519 &&
|
||||
f == &dir.join(NODE_KEY_ED25519_FILE) =>
|
||||
Ok(()),
|
||||
if typ == NodeKeyType::Ed25519
|
||||
&& f == &dir.join(NODE_KEY_ED25519_FILE) =>
|
||||
{
|
||||
Ok(())
|
||||
},
|
||||
_ => Err(error::Error::Input("Unexpected node key config".into())),
|
||||
})
|
||||
},
|
||||
|
||||
@@ -224,8 +224,8 @@ impl RpcParams {
|
||||
for endpoint in &self.experimental_rpc_endpoint {
|
||||
// Technically, `0.0.0.0` isn't a public IP address, but it's a way to listen on
|
||||
// all interfaces. Thus, we consider it as a public endpoint and warn about it.
|
||||
if endpoint.rpc_methods == RpcMethods::Unsafe && endpoint.is_global() ||
|
||||
endpoint.listen_addr.ip().is_unspecified()
|
||||
if endpoint.rpc_methods == RpcMethods::Unsafe && endpoint.is_global()
|
||||
|| endpoint.listen_addr.ip().is_unspecified()
|
||||
{
|
||||
eprintln!(
|
||||
"It isn't safe to expose RPC publicly without a proxy server that filters \
|
||||
|
||||
@@ -32,10 +32,12 @@ pub enum TransactionPoolType {
|
||||
impl Into<pezsc_transaction_pool::TransactionPoolType> for TransactionPoolType {
|
||||
fn into(self) -> pezsc_transaction_pool::TransactionPoolType {
|
||||
match self {
|
||||
TransactionPoolType::SingleState =>
|
||||
pezsc_transaction_pool::TransactionPoolType::SingleState,
|
||||
TransactionPoolType::ForkAware =>
|
||||
pezsc_transaction_pool::TransactionPoolType::ForkAware,
|
||||
TransactionPoolType::SingleState => {
|
||||
pezsc_transaction_pool::TransactionPoolType::SingleState
|
||||
},
|
||||
TransactionPoolType::ForkAware => {
|
||||
pezsc_transaction_pool::TransactionPoolType::ForkAware
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user