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
72b30e37
Commit
72b30e37
authored
2 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
sanity tests should not panic
parent
48abb408
No related branches found
No related tags found
1 merge request
!76
tests(live): add sanity tests against gdev live chain
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
live-tests/tests/sanity_gdev.rs
+14
-10
14 additions, 10 deletions
live-tests/tests/sanity_gdev.rs
with
14 additions
and
10 deletions
live-tests/tests/sanity_gdev.rs
+
14
−
10
View file @
72b30e37
...
...
@@ -203,19 +203,23 @@ mod verifier {
)
->
anyhow
::
Result
<
()
>
{
for
(
idty_index
,
idty_value
)
in
identities
{
// Rule 1: each identity should have an account
let
idty_account
=
accounts
.get
(
&
idty_value
.owner_key
)
.unwrap_or_else
(||
panic!
(
"Identity {} has no account"
,
idty_index
));
// Rule 2: each identity account should be sufficient
let
maybe_account
=
accounts
.get
(
&
idty_value
.owner_key
);
self
.assert
(
idty_account
.sufficients
>
0
,
format!
(
"Identity {} is corrupted: idty_account.sufficients == 0"
,
idty_index
),
maybe_account
.is_some
(),
format!
(
"Identity {} has no account"
,
idty_index
),
);
if
let
Some
(
account
)
=
maybe_account
{
// Rule 2: each identity account should be sufficient
self
.assert
(
account
.sufficients
>
0
,
format!
(
"Identity {} is corrupted: idty_account.sufficients == 0"
,
idty_index
),
);
}
match
idty_value
.status
{
IdtyStatus
::
Validated
=>
{
// Rule 3: If the identity is validated, removable_on shoud be zero
...
...
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