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
Commits
ab5ac079
Commit
ab5ac079
authored
2 years ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
wip add revocation test
parent
22345178
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pallets/duniter-wot/src/tests.rs
+50
-0
50 additions, 0 deletions
pallets/duniter-wot/src/tests.rs
with
50 additions
and
0 deletions
pallets/duniter-wot/src/tests.rs
+
50
−
0
View file @
ab5ac079
...
...
@@ -251,6 +251,56 @@ fn test_confirm_idty_ok() {
});
}
#[test]
fn
test_revoke_idty
()
{
new_test_ext
(
5
,
1
)
.execute_with
(||
{
run_to_block
(
2
);
// Alice identity can not be revoked because she's smith
assert_noop!
(
Identity
::
revoke_identity
(
RuntimeOrigin
::
signed
(
1
),
1
,
1
,
TestSignature
(
1
,
(
REVOCATION_PAYLOAD_PREFIX
,
RevocationPayload
{
idty_index
:
1u32
,
genesis_hash
:
System
::
block_hash
(
0
),
}
)
.encode
()
)
),
pallet_duniter_wot
::
Error
::
<
Test
,
Instance2
>
::
NotAllowedToRemoveIdty
);
// Anyone should be able to submit Bob revocation certificate
assert_ok!
(
Identity
::
revoke_identity
(
RuntimeOrigin
::
signed
(
42
),
2
,
2
,
TestSignature
(
2
,
(
REVOCATION_PAYLOAD_PREFIX
,
RevocationPayload
{
idty_index
:
2u32
,
genesis_hash
:
System
::
block_hash
(
0
),
}
)
.encode
()
)
));
System
::
assert_has_event
(
RuntimeEvent
::
Identity
(
pallet_identity
::
Event
::
IdtyRemoved
{
idty_index
:
2
},
));
});
}
#[test]
fn
test_idty_membership_expire_them_requested
()
{
new_test_ext
(
3
,
2
)
.execute_with
(||
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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