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:
@@ -45,8 +45,9 @@ impl KeyValueDB for ParityDbWrapper {
|
||||
fn write(&self, transaction: DBTransaction) -> io::Result<()> {
|
||||
self.0
|
||||
.commit(transaction.ops.iter().map(|op| match op {
|
||||
kvdb::DBOp::Insert { col, key, value } =>
|
||||
(*col as u8, &key[key.len() - 32..], Some(value.to_vec())),
|
||||
kvdb::DBOp::Insert { col, key, value } => {
|
||||
(*col as u8, &key[key.len() - 32..], Some(value.to_vec()))
|
||||
},
|
||||
kvdb::DBOp::Delete { col, key } => (*col as u8, &key[key.len() - 32..], None),
|
||||
kvdb::DBOp::DeletePrefix { col: _, prefix: _ } => unimplemented!(),
|
||||
}))
|
||||
|
||||
@@ -64,17 +64,19 @@ impl BizinikiwiCli for Cli {
|
||||
id: &str,
|
||||
) -> std::result::Result<Box<dyn pezsc_service::ChainSpec>, String> {
|
||||
let spec = match id {
|
||||
"" =>
|
||||
"" => {
|
||||
return Err(
|
||||
"Please specify which chain you want to run, e.g. --dev or --chain=local"
|
||||
.into(),
|
||||
),
|
||||
)
|
||||
},
|
||||
"dev" => Box::new(chain_spec::development_config()),
|
||||
"local" => Box::new(chain_spec::local_testnet_config()),
|
||||
"fir" | "flaming-fir" => Box::new(chain_spec::flaming_fir_config()?),
|
||||
"staging" => Box::new(chain_spec::pezstaging_testnet_config()),
|
||||
path =>
|
||||
Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?),
|
||||
path => {
|
||||
Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?)
|
||||
},
|
||||
};
|
||||
Ok(spec)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(unix)]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(unix)]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(unix)]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(unix)]
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
use nix::sys::signal::Signal::{self, SIGINT, SIGTERM};
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(unix)]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
|
||||
@@ -308,8 +308,8 @@ mod multiplier_tests {
|
||||
// `cargo test congested_chain_simulation -- --nocapture` to get some insight.
|
||||
|
||||
// almost full. The entire quota of normal transactions is taken.
|
||||
let block_weight = BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap() -
|
||||
Weight::from_parts(100, 0);
|
||||
let block_weight = BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap()
|
||||
- Weight::from_parts(100, 0);
|
||||
|
||||
// Default bizinikiwi weight.
|
||||
let tx_weight = pezframe_support::weights::constants::ExtrinsicBaseWeight::get();
|
||||
|
||||
@@ -442,21 +442,21 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
|
||||
ProxyType::Any => true,
|
||||
ProxyType::NonTransfer => !matches!(
|
||||
c,
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::Assets(..) |
|
||||
RuntimeCall::Uniques(..) |
|
||||
RuntimeCall::Nfts(..) |
|
||||
RuntimeCall::Vesting(pezpallet_vesting::Call::vested_transfer { .. }) |
|
||||
RuntimeCall::Indices(pezpallet_indices::Call::transfer { .. })
|
||||
RuntimeCall::Balances(..)
|
||||
| RuntimeCall::Assets(..)
|
||||
| RuntimeCall::Uniques(..)
|
||||
| RuntimeCall::Nfts(..)
|
||||
| RuntimeCall::Vesting(pezpallet_vesting::Call::vested_transfer { .. })
|
||||
| RuntimeCall::Indices(pezpallet_indices::Call::transfer { .. })
|
||||
),
|
||||
ProxyType::Governance => matches!(
|
||||
c,
|
||||
RuntimeCall::Democracy(..) |
|
||||
RuntimeCall::Council(..) |
|
||||
RuntimeCall::Society(..) |
|
||||
RuntimeCall::TechnicalCommittee(..) |
|
||||
RuntimeCall::Elections(..) |
|
||||
RuntimeCall::Treasury(..)
|
||||
RuntimeCall::Democracy(..)
|
||||
| RuntimeCall::Council(..)
|
||||
| RuntimeCall::Society(..)
|
||||
| RuntimeCall::TechnicalCommittee(..)
|
||||
| RuntimeCall::Elections(..)
|
||||
| RuntimeCall::Treasury(..)
|
||||
),
|
||||
ProxyType::Staking => {
|
||||
matches!(c, RuntimeCall::Staking(..) | RuntimeCall::FastUnstake(..))
|
||||
@@ -856,8 +856,8 @@ impl Get<Option<BalancingConfig>> for OffchainRandomBalancing {
|
||||
max => {
|
||||
let seed = pezsp_io::offchain::random_seed();
|
||||
let random = <u32>::decode(&mut TrailingZeroInput::new(&seed))
|
||||
.expect("input is padded with zeroes; qed") %
|
||||
max.saturating_add(1);
|
||||
.expect("input is padded with zeroes; qed")
|
||||
% max.saturating_add(1);
|
||||
random as usize
|
||||
},
|
||||
};
|
||||
|
||||
@@ -306,22 +306,24 @@ impl<'a> Iterator for BlockContentIterator<'a> {
|
||||
tx_ext(0, pez_kitchensink_runtime::ExistentialDeposit::get() + 1),
|
||||
),
|
||||
function: match self.content.block_type {
|
||||
BlockType::RandomTransfersKeepAlive =>
|
||||
BlockType::RandomTransfersKeepAlive => {
|
||||
RuntimeCall::Balances(BalancesCall::transfer_keep_alive {
|
||||
dest: pezsp_runtime::MultiAddress::Id(receiver),
|
||||
value: pez_kitchensink_runtime::ExistentialDeposit::get() + 1,
|
||||
}),
|
||||
})
|
||||
},
|
||||
BlockType::RandomTransfersReaping => {
|
||||
RuntimeCall::Balances(BalancesCall::transfer_allow_death {
|
||||
dest: pezsp_runtime::MultiAddress::Id(receiver),
|
||||
// Transfer so that ending balance would be 1 less than existential
|
||||
// deposit so that we kill the sender account.
|
||||
value: 100 * DOLLARS -
|
||||
(pez_kitchensink_runtime::ExistentialDeposit::get() - 1),
|
||||
value: 100 * DOLLARS
|
||||
- (pez_kitchensink_runtime::ExistentialDeposit::get() - 1),
|
||||
})
|
||||
},
|
||||
BlockType::Noop =>
|
||||
RuntimeCall::System(SystemCall::remark { remark: Vec::new() }),
|
||||
BlockType::Noop => {
|
||||
RuntimeCall::System(SystemCall::remark { remark: Vec::new() })
|
||||
},
|
||||
},
|
||||
},
|
||||
self.runtime_version.spec_version,
|
||||
@@ -602,12 +604,13 @@ impl BenchKeyring {
|
||||
.into()
|
||||
},
|
||||
ExtrinsicFormat::Bare => generic::UncheckedExtrinsic::new_bare(xt.function).into(),
|
||||
ExtrinsicFormat::General(ext_version, tx_ext) =>
|
||||
ExtrinsicFormat::General(ext_version, tx_ext) => {
|
||||
generic::UncheckedExtrinsic::from_parts(
|
||||
xt.function,
|
||||
Preamble::General(ext_version, tx_ext),
|
||||
)
|
||||
.into(),
|
||||
.into()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -343,8 +343,9 @@ fn process_action<T: Serialize + Clone + Sync + 'static>(
|
||||
builder: pezsc_chain_spec::ChainSpecBuilder<T>,
|
||||
) -> Result<String, String> {
|
||||
let builder = match cmd.action {
|
||||
GenesisBuildAction::NamedPreset(NamedPresetCmd { ref preset_name }) =>
|
||||
builder.with_genesis_config_preset_name(&preset_name),
|
||||
GenesisBuildAction::NamedPreset(NamedPresetCmd { ref preset_name }) => {
|
||||
builder.with_genesis_config_preset_name(&preset_name)
|
||||
},
|
||||
GenesisBuildAction::Patch(PatchCmd { ref patch_path }) => {
|
||||
let patch = fs::read(patch_path.as_path())
|
||||
.map_err(|e| format!("patch file {patch_path:?} shall be readable: {e}"))?;
|
||||
|
||||
Reference in New Issue
Block a user