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
!42
fix(wot): cannot certify self
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
fix(wot): cannot certify self
cannot-certify-self
into
master
Overview
11
Commits
1
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Merged
Pascal Engélibert
requested to merge
cannot-certify-self
into
master
3 years ago
Overview
11
Commits
1
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Expand
An identity should not be able to certify itself.
@librelois
1
0
Merge request reports
Compare
master
version 3
a236dcca
3 years ago
version 2
3f52e9c7
3 years ago
version 1
49e6ace7
3 years ago
master (base)
and
latest version
latest version
11cb408c
1 commit,
3 years ago
version 3
a236dcca
1 commit,
3 years ago
version 2
3f52e9c7
1 commit,
3 years ago
version 1
49e6ace7
1 commit,
3 years ago
2 files
+
35
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
pallets/certification/src/lib.rs
+
9
−
6
Options
@@ -260,22 +260,24 @@ pub mod pallet {
#[pallet::error]
pub
enum
Error
<
T
,
I
=
()
>
{
/// An identity cannot certify itself
CannotCertifySelf
,
/// Certification non autorisée
CertNotAllowed
,
/// Issuer not found
IssuerNotFound
,
/// An identity must receive certifications before it can issue them.
IdtyMustReceiveCertsBeforeCanIssue
,
/// This identity has already issued the maximum number of certifications
IssuedTooManyCert
,
///
Receiv
er not found
Receiv
erNotFound
,
///
Issu
er not found
Issu
erNotFound
,
/// Not enough certifications received
NotEnoughCertReceived
,
/// This certification has already been issued or renewed recently
NotRespectRenewablePeriod
,
/// This identity has already issued a certification too recently
NotRespectCertPeriod
,
/// This certification has already been issued or renewed recently
NotRespectRenewablePeriod
,
/// Receiver not found
ReceiverNotFound
,
}
#[pallet::hooks]
@@ -339,6 +341,7 @@ pub mod pallet {
receiver
:
T
::
AccountId
,
)
->
DispatchResultWithPostInfo
{
let
who
=
ensure_signed
(
origin
)
?
;
ensure!
(
who
!=
receiver
,
Error
::
<
T
,
I
>
::
CannotCertifySelf
);
let
issuer
=
T
::
IdtyIndexOf
::
convert
(
who
)
.ok_or
(
Error
::
<
T
,
I
>
::
IssuerNotFound
)
?
;
let
receiver
=
T
::
IdtyIndexOf
::
convert
(
receiver
)
.ok_or
(
Error
::
<
T
,
I
>
::
ReceiverNotFound
)
?
;
Loading