Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
substrate
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
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
Denis_P
substrate
Commits
b95c8227
Commit
b95c8227
authored
4 years ago
by
zeke
Browse files
Options
Downloads
Patches
Plain Diff
setup initial mock structure
parent
876654af
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frame/sudo/src/mock.rs
+35
-4
35 additions, 4 deletions
frame/sudo/src/mock.rs
frame/sudo/src/tests.rs
+0
-0
0 additions, 0 deletions
frame/sudo/src/tests.rs
with
35 additions
and
4 deletions
frame/sudo/src/mock.rs
+
35
−
4
View file @
b95c8227
...
@@ -18,7 +18,38 @@
...
@@ -18,7 +18,38 @@
use
super
::
*
;
use
super
::
*
;
#[cfg(test)]
use
frame_support
::{
mod
tests
{
impl_outer_origin
,
impl_outer_dispatch
,
impl_outer_event
,
parameter_types
,
// -- snip --
weights
::
Weight
,
}
traits
::{
OnInitialize
,
OnFinalize
},
\ No newline at end of file
};
use
sp_core
::
H256
;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use
sp_runtime
::{
Perbill
,
traits
::{
BlakeTwo256
,
IdentityLookup
},
testing
::
Header
,
};
use
crate
as
sudo
;
impl_outer_origin!
{
pub
enum
Origin
for
Test
where
system
=
frame_system
{}
}
// For testing the pallet, we construct most of a mock runtime. This means
// first constructing a configuration type (`Test`) which `impl`s each of the
// configuration traits of pallets we want to use.
#[derive(Clone,
Eq,
PartialEq)]
pub
struct
Test
;
impl
frame_system
::
Trait
for
Test
{
type
Event
=
();
type
Call
=
();
}
// impl Trait for TestRuntime {
// type Event = ();
// }
pub
type
Sudo
=
Module
<
Test
>
;
pub
type
System
=
frame_system
::
Module
<
Test
>
;
This diff is collapsed.
Click to expand it.
frame/sudo/src/tests.rs
0 → 100644
+
0
−
0
View file @
b95c8227
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