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
656963a0
Unverified
Commit
656963a0
authored
1 year ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
fix
#220
parent
3240a1aa
No related branches found
No related tags found
No related merge requests found
Pipeline
#36559
failed
1 year ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pallets/smith-members/src/lib.rs
+6
-6
6 additions, 6 deletions
pallets/smith-members/src/lib.rs
with
6 additions
and
6 deletions
pallets/smith-members/src/lib.rs
+
6
−
6
View file @
656963a0
...
...
@@ -132,20 +132,20 @@ pub mod pallet {
pub
enum
Event
<
T
:
Config
>
{
/// An identity is being inivited to become a smith.
InvitationSent
{
receiver
:
T
::
IdtyIndex
,
issuer
:
T
::
IdtyIndex
,
receiver
:
T
::
IdtyIndex
,
},
/// The invitation has been accepted.
InvitationAccepted
{
idty_index
:
T
::
IdtyIndex
},
/// Certification received
SmithCertAdded
{
receiver
:
T
::
IdtyIndex
,
issuer
:
T
::
IdtyIndex
,
receiver
:
T
::
IdtyIndex
,
},
/// Certification lost
SmithCertRemoved
{
receiver
:
T
::
IdtyIndex
,
issuer
:
T
::
IdtyIndex
,
receiver
:
T
::
IdtyIndex
,
},
/// A smith gathered enough certifications to become an authority (can call `go_online()`).
SmithMembershipAdded
{
idty_index
:
T
::
IdtyIndex
},
...
...
@@ -361,7 +361,7 @@ impl<T: Config> Pallet<T> {
existing
.received_certs
=
vec!
[];
Smiths
::
<
T
>
::
insert
(
receiver
,
existing
);
ExpiresOn
::
<
T
>
::
append
(
new_expires_on
,
receiver
);
Self
::
deposit_event
(
Event
::
<
T
>
::
InvitationSent
{
receiver
,
issu
er
});
Self
::
deposit_event
(
Event
::
<
T
>
::
InvitationSent
{
issuer
,
receiv
er
});
}
fn
check_accept_invitation
(
receiver
:
T
::
IdtyIndex
)
->
DispatchResultWithPostInfo
{
...
...
@@ -443,7 +443,7 @@ impl<T: Config> Pallet<T> {
// - adds a certification in receiver received list
smith_meta
.received_certs
.push
(
issuer
);
smith_meta
.received_certs
.sort
();
Self
::
deposit_event
(
Event
::
<
T
>
::
SmithCertAdded
{
receiver
,
issu
er
});
Self
::
deposit_event
(
Event
::
<
T
>
::
SmithCertAdded
{
issuer
,
receiv
er
});
// - receiving a certification either lead us to Pending or Smith status
let
previous_status
=
smith_meta
.status
;
...
...
@@ -517,8 +517,8 @@ impl<T: Config> Pallet<T> {
if
let
Ok
(
index
)
=
smith_meta
.issued_certs
.binary_search
(
&
receiver
)
{
smith_meta
.issued_certs
.remove
(
index
);
Self
::
deposit_event
(
Event
::
<
T
>
::
SmithCertRemoved
{
receiver
,
issuer
:
lost_cert_issuer
,
receiver
,
});
}
}
...
...
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