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:
@@ -127,13 +127,14 @@ impl PartialEq for BasicExternalities {
|
||||
self.overlay
|
||||
.changes()
|
||||
.map(|(k, v)| (k, v.value_ref().materialize()))
|
||||
.collect::<BTreeMap<_, _>>() ==
|
||||
other
|
||||
.collect::<BTreeMap<_, _>>()
|
||||
== other
|
||||
.overlay
|
||||
.changes()
|
||||
.map(|(k, v)| (k, v.value_ref().materialize()))
|
||||
.collect::<BTreeMap<_, _>>() &&
|
||||
self.overlay
|
||||
.collect::<BTreeMap<_, _>>()
|
||||
&& self
|
||||
.overlay
|
||||
.children()
|
||||
.map(|(iter, i)| {
|
||||
(
|
||||
@@ -142,8 +143,8 @@ impl PartialEq for BasicExternalities {
|
||||
.collect::<BTreeMap<_, _>>(),
|
||||
)
|
||||
})
|
||||
.collect::<BTreeMap<_, _>>() ==
|
||||
other
|
||||
.collect::<BTreeMap<_, _>>()
|
||||
== other
|
||||
.overlay
|
||||
.children()
|
||||
.map(|(iter, i)| {
|
||||
|
||||
@@ -626,8 +626,9 @@ mod execution {
|
||||
let storage_key = PrefixedStorageKey::new_ref(storage_key);
|
||||
(
|
||||
Some(match ChildType::from_prefixed_key(storage_key) {
|
||||
Some((ChildType::ParentKeyId, storage_key)) =>
|
||||
ChildInfo::new_default(storage_key),
|
||||
Some((ChildType::ParentKeyId, storage_key)) => {
|
||||
ChildInfo::new_default(storage_key)
|
||||
},
|
||||
None => return Err(Box::new("Invalid range start child trie key.")),
|
||||
}),
|
||||
2,
|
||||
@@ -650,8 +651,8 @@ mod execution {
|
||||
while let Some(item) = iter.next() {
|
||||
let (key, value) = item.map_err(|e| Box::new(e) as Box<dyn Error>)?;
|
||||
|
||||
if depth < MAX_NESTED_TRIE_DEPTH &&
|
||||
pezsp_core::storage::well_known_keys::is_child_storage_key(key.as_slice())
|
||||
if depth < MAX_NESTED_TRIE_DEPTH
|
||||
&& pezsp_core::storage::well_known_keys::is_child_storage_key(key.as_slice())
|
||||
{
|
||||
count += 1;
|
||||
// do not add two child trie with same root
|
||||
@@ -1025,8 +1026,9 @@ mod execution {
|
||||
let storage_key = PrefixedStorageKey::new_ref(storage_key);
|
||||
(
|
||||
Some(match ChildType::from_prefixed_key(storage_key) {
|
||||
Some((ChildType::ParentKeyId, storage_key)) =>
|
||||
ChildInfo::new_default(storage_key),
|
||||
Some((ChildType::ParentKeyId, storage_key)) => {
|
||||
ChildInfo::new_default(storage_key)
|
||||
},
|
||||
None => return Err(Box::new("Invalid range start child trie key.")),
|
||||
}),
|
||||
2,
|
||||
@@ -1057,8 +1059,8 @@ mod execution {
|
||||
let (key, value) = item.map_err(|e| Box::new(e) as Box<dyn Error>)?;
|
||||
values.push((key.to_vec(), value.to_vec()));
|
||||
|
||||
if depth < MAX_NESTED_TRIE_DEPTH &&
|
||||
pezsp_core::storage::well_known_keys::is_child_storage_key(key.as_slice())
|
||||
if depth < MAX_NESTED_TRIE_DEPTH
|
||||
&& pezsp_core::storage::well_known_keys::is_child_storage_key(key.as_slice())
|
||||
{
|
||||
// Do not add two chid trie with same root.
|
||||
if !child_roots.contains(value.as_slice()) {
|
||||
|
||||
@@ -654,8 +654,8 @@ impl<K: Ord + Hash + Clone, V> OverlayedMap<K, V> {
|
||||
|
||||
fn close_transaction_offchain(&mut self, rollback: bool) -> Result<(), NoOpenTransaction> {
|
||||
// runtime is not allowed to close transactions started by the client
|
||||
if matches!(self.execution_mode, ExecutionMode::Runtime) &&
|
||||
!self.has_open_runtime_transactions()
|
||||
if matches!(self.execution_mode, ExecutionMode::Runtime)
|
||||
&& !self.has_open_runtime_transactions()
|
||||
{
|
||||
return Err(NoOpenTransaction);
|
||||
}
|
||||
@@ -725,8 +725,8 @@ impl OverlayedChangeSet {
|
||||
|
||||
fn close_transaction(&mut self, rollback: bool) -> Result<(), NoOpenTransaction> {
|
||||
// runtime is not allowed to close transactions started by the client
|
||||
if matches!(self.execution_mode, ExecutionMode::Runtime) &&
|
||||
!self.has_open_runtime_transactions()
|
||||
if matches!(self.execution_mode, ExecutionMode::Runtime)
|
||||
&& !self.has_open_runtime_transactions()
|
||||
{
|
||||
return Err(NoOpenTransaction);
|
||||
}
|
||||
|
||||
@@ -1015,8 +1015,8 @@ pub mod tests {
|
||||
.storage_root(iter::once((&b"new-key"[..], Some(&b"new-value"[..]))), state_version);
|
||||
assert!(!tx.drain().is_empty());
|
||||
assert!(
|
||||
new_root !=
|
||||
test_trie(state_version, None, None)
|
||||
new_root
|
||||
!= test_trie(state_version, None, None)
|
||||
.storage_root(iter::empty(), state_version)
|
||||
.0
|
||||
);
|
||||
|
||||
@@ -128,8 +128,8 @@ where
|
||||
None
|
||||
},
|
||||
Some(Err(error)) => {
|
||||
if matches!(*error, TrieError::IncompleteDatabase(_)) &&
|
||||
self.stop_on_incomplete_database
|
||||
if matches!(*error, TrieError::IncompleteDatabase(_))
|
||||
&& self.stop_on_incomplete_database
|
||||
{
|
||||
self.state = IterState::FinishedIncomplete;
|
||||
None
|
||||
@@ -681,7 +681,7 @@ where
|
||||
self.with_recorder_and_cache_for_storage_root(Some(child_root), |recorder, cache| {
|
||||
let mut eph = Ephemeral::new(self.backend_storage(), &mut write_overlay);
|
||||
match match state_version {
|
||||
StateVersion::V0 =>
|
||||
StateVersion::V0 => {
|
||||
child_delta_trie_root::<pezsp_trie::LayoutV0<H>, _, _, _, _, _, _>(
|
||||
child_info.keyspace(),
|
||||
&mut eph,
|
||||
@@ -689,8 +689,9 @@ where
|
||||
delta,
|
||||
recorder,
|
||||
cache,
|
||||
),
|
||||
StateVersion::V1 =>
|
||||
)
|
||||
},
|
||||
StateVersion::V1 => {
|
||||
child_delta_trie_root::<pezsp_trie::LayoutV1<H>, _, _, _, _, _, _>(
|
||||
child_info.keyspace(),
|
||||
&mut eph,
|
||||
@@ -698,7 +699,8 @@ where
|
||||
delta,
|
||||
recorder,
|
||||
cache,
|
||||
),
|
||||
)
|
||||
},
|
||||
} {
|
||||
Ok(ret) => (Some(ret), ret),
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user