Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
f4d079a7
Commit
f4d079a7
authored
2 years ago
by
Sergej Sakac
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Warn if pallet provided to try-state does not exist (#13858)
* Warn if pallet does not exist in try-state * unwrap_or_default
parent
bfd43dbc
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/frame/support/src/traits/try_runtime.rs
+11
-3
11 additions, 3 deletions
substrate/frame/support/src/traits/try_runtime.rs
with
11 additions
and
3 deletions
substrate/frame/support/src/traits/try_runtime.rs
+
11
−
3
View file @
f4d079a7
...
...
@@ -168,11 +168,19 @@ impl<BlockNumber: Clone + sp_std::fmt::Debug + AtLeast32BitUnsigned> TryState<Bl
#
(
(
<
Tuple
as
crate
::
traits
::
PalletInfoAccess
>
::
name
(),
Tuple
::
try_state
)
),
*
)];
let
mut
result
=
Ok
(());
for
(
name
,
try_state_fn
)
in
try_state_fns
{
if
pallet_names
.iter
()
.any
(|
n
|
n
==
name
.as_bytes
())
{
pallet_names
.iter
()
.for_each
(|
pallet_name
|
{
if
let
Some
((
name
,
try_state_fn
))
=
try_state_fns
.iter
()
.find
(|(
name
,
_
)|
name
.as_bytes
()
==
pallet_name
)
{
result
=
result
.and
(
try_state_fn
(
n
.clone
(),
targets
.clone
()));
}
else
{
crate
::
log
::
warn!
(
"Pallet {:?} not found"
,
sp_std
::
str
::
from_utf8
(
pallet_name
)
.unwrap_or_default
()
);
}
}
});
result
},
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment