Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
nodes
rust
Duniter v2S
Merge requests
!216
Add end2end test for offences
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add end2end test for offences
bgallois/duniter-v2s:114-offences-testing
into
master
Overview
5
Commits
6
Pipelines
10
Changes
5
Merged
Benjamin Gallois
requested to merge
bgallois/duniter-v2s:114-offences-testing
into
master
1 year ago
Overview
5
Commits
6
Pipelines
10
Changes
1
Expand
Closes
#114 (closed)
0
0
Merge request reports
Compare
version 4
version 4
89bf0d14
1 year ago
version 3
ff3ce062
1 year ago
version 2
5c68b602
1 year ago
version 1
636645b0
1 year ago
master (base)
and
latest version
latest version
53889608
6 commits,
1 year ago
version 4
89bf0d14
6 commits,
1 year ago
version 3
ff3ce062
5 commits,
1 year ago
version 2
5c68b602
4 commits,
1 year ago
version 1
636645b0
1 commit,
1 year ago
Show latest version
1 file
+
4
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
runtime/gdev/tests/offences_tests.rs
+
4
−
4
Options
@@ -21,6 +21,7 @@ use frame_support::assert_ok;
use
frame_support
::
traits
::
ValidatorSet
;
use
frame_support
::
traits
::
ValidatorSetWithIdentification
;
use
gdev_runtime
::
*
;
use
pallet_im_online
as
im_online
;
use
pallet_im_online
::
UnresponsivenessOffence
;
use
pallet_session
::
historical
::
IdentificationTuple
;
use
sp_runtime
::
traits
::
Convert
;
@@ -31,14 +32,13 @@ fn test_imonline_offence() {
ExtBuilder
::
new
(
1
,
3
,
4
)
.build
()
.execute_with
(||
{
run_to_block
(
1
);
let
session_index
=
Session
::
current_index
();
let
current_validators
=
<
Runtime
as
pallet_
im_online
::
Config
>
::
ValidatorSet
::
validators
();
let
current_validators
=
<
Runtime
as
im_online
::
Config
>
::
ValidatorSet
::
validators
();
// Construct an offence where all validators (member: 1) are offenders
type
ImOnline
=
pallet_im_online
::
Config
;
let
offenders
=
current_validatorc
let
offenders
=
current_validators
.into_iter
()
.enumerate
()
.filter_map
(|(
_
,
id
)|
{
<<
Runtime
as
ImO
nline
>
::
ValidatorSet
as
ValidatorSetWithIdentification
<
<<
Runtime
as
im_o
nline
::
Config
>
::
ValidatorSet
as
ValidatorSetWithIdentification
<
sp_runtime
::
AccountId32
,
>>
::
IdentificationOf
::
convert
(
id
.clone
())
.map
(|
full_id
|
(
id
,
full_id
))
Loading