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
02f17720
Commit
02f17720
authored
4 years ago
by
Bastian Köcher
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
pallet-sudo: Store `DispatchResult` in `Sudid` event (#5804)
parent
00378d40
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/frame/sudo/src/lib.rs
+4
-11
4 additions, 11 deletions
substrate/frame/sudo/src/lib.rs
with
4 additions
and
11 deletions
substrate/frame/sudo/src/lib.rs
+
4
−
11
View file @
02f17720
...
...
@@ -87,7 +87,7 @@
#![cfg_attr(not(feature
=
"std"
),
no_std)]
use
sp_std
::
prelude
::
*
;
use
sp_runtime
::
traits
::{
StaticLookup
,
Dispatchable
};
use
sp_runtime
::
{
DispatchResult
,
traits
::{
StaticLookup
,
Dispatchable
}
}
;
use
frame_support
::{
Parameter
,
decl_module
,
decl_event
,
decl_storage
,
decl_error
,
ensure
,
...
...
@@ -130,15 +130,8 @@ decl_module! {
let
sender
=
ensure_signed
(
origin
)
?
;
ensure!
(
sender
==
Self
::
key
(),
Error
::
<
T
>
::
RequireSudo
);
let
res
=
match
call
.dispatch
(
frame_system
::
RawOrigin
::
Root
.into
())
{
Ok
(
_
)
=>
true
,
Err
(
e
)
=>
{
sp_runtime
::
print
(
e
);
false
}
};
Self
::
deposit_event
(
RawEvent
::
Sudid
(
res
));
let
res
=
call
.dispatch
(
frame_system
::
RawOrigin
::
Root
.into
());
Self
::
deposit_event
(
RawEvent
::
Sudid
(
res
.map
(|
_
|
())
.map_err
(|
e
|
e
.error
)));
}
/// Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo key.
...
...
@@ -204,7 +197,7 @@ decl_module! {
decl_event!
(
pub
enum
Event
<
T
>
where
AccountId
=
<
T
as
frame_system
::
Trait
>
::
AccountId
{
/// A sudo just took place.
Sudid
(
bool
),
Sudid
(
DispatchResult
),
/// The sudoer just switched identity; the old key is supplied.
KeyChanged
(
AccountId
),
/// A sudo just took place.
...
...
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