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
1a327cd8
Commit
1a327cd8
authored
5 years ago
by
Bastian Köcher
Committed by
Gavin Wood
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
srml-utility: Store errors as `DispatchError` to make the decodable (#3766)
parent
954e980a
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
substrate/node/runtime/src/lib.rs
+3
-3
3 additions, 3 deletions
substrate/node/runtime/src/lib.rs
substrate/srml/utility/src/lib.rs
+6
-11
6 additions, 11 deletions
substrate/srml/utility/src/lib.rs
with
9 additions
and
14 deletions
substrate/node/runtime/src/lib.rs
+
3
−
3
View file @
1a327cd8
...
...
@@ -84,8 +84,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to equal spec_version. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version
:
17
1
,
impl_version
:
17
1
,
spec_version
:
17
2
,
impl_version
:
17
2
,
apis
:
RUNTIME_API_VERSIONS
,
};
...
...
@@ -497,7 +497,7 @@ construct_runtime!(
UncheckedExtrinsic
=
UncheckedExtrinsic
{
System
:
system
::{
Module
,
Call
,
Storage
,
Config
,
Event
},
Utility
:
utility
::{
Module
,
Call
,
Event
<
T
>
},
Utility
:
utility
::{
Module
,
Call
,
Event
},
Babe
:
babe
::{
Module
,
Call
,
Storage
,
Config
,
Inherent
(
Timestamp
)},
Timestamp
:
timestamp
::{
Module
,
Call
,
Storage
,
Inherent
},
Authorship
:
authorship
::{
Module
,
Call
,
Storage
,
Inherent
},
...
...
This diff is collapsed.
Click to expand it.
substrate/srml/utility/src/lib.rs
+
6
−
11
View file @
1a327cd8
...
...
@@ -23,27 +23,21 @@
use
rstd
::
prelude
::
*
;
use
support
::{
decl_module
,
decl_event
,
Parameter
};
use
system
::
ensure_root
;
use
sr_primitives
::{
traits
::{
Dispatchable
,
DispatchResult
},
weights
::
SimpleDispatchInfo
};
use
sr_primitives
::{
traits
::
Dispatchable
,
weights
::
SimpleDispatchInfo
,
DispatchError
};
/// Configuration trait.
pub
trait
Trait
:
system
::
Trait
{
/// The overarching event type.
type
Event
:
From
<
Event
<
Self
>
>
+
Into
<<
Self
as
system
::
Trait
>
::
Event
>
;
type
Event
:
From
<
Event
>
+
Into
<<
Self
as
system
::
Trait
>
::
Event
>
;
/// The overarching call type.
type
Call
:
Parameter
+
Dispatchable
<
Origin
=
Self
::
Origin
>
;
}
pub
type
DispatchResultOf
<
T
>
=
DispatchResult
<<<
T
as
Trait
>
::
Call
as
Dispatchable
>
::
Error
>
;
decl_event!
(
/// Events type.
pub
enum
Event
<
T
>
where
DispatchResult
=
DispatchResultOf
<
T
>
,
{
BatchExecuted
(
Vec
<
DispatchResult
>
),
pub
enum
Event
{
BatchExecuted
(
Vec
<
Result
<
(),
DispatchError
>>
),
}
);
...
...
@@ -58,8 +52,9 @@ decl_module! {
ensure_root
(
origin
)
?
;
let
results
=
calls
.into_iter
()
.map
(|
call
|
call
.dispatch
(
system
::
RawOrigin
::
Root
.into
()))
.map
(|
res
|
res
.map_err
(
Into
::
into
))
.collect
::
<
Vec
<
_
>>
();
Self
::
deposit_event
(
Raw
Event
::
BatchExecuted
(
results
));
Self
::
deposit_event
(
Event
::
BatchExecuted
(
results
));
}
}
}
...
...
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