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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
8c0a09f5
Commit
8c0a09f5
authored
1 year ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
WIP put pallet in dev mode before benchmarks
parent
ee51277f
No related branches found
No related tags found
No related merge requests found
Pipeline
#33244
waiting for manual action
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pallets/distance/src/lib.rs
+18
-6
18 additions, 6 deletions
pallets/distance/src/lib.rs
pallets/distance/src/weights.rs
+1
-0
1 addition, 0 deletions
pallets/distance/src/weights.rs
with
19 additions
and
6 deletions
pallets/distance/src/lib.rs
+
18
−
6
View file @
8c0a09f5
...
@@ -19,10 +19,12 @@
...
@@ -19,10 +19,12 @@
mod
median
;
mod
median
;
mod
traits
;
mod
traits
;
mod
types
;
mod
types
;
mod
weights
;
pub
use
pallet
::
*
;
pub
use
pallet
::
*
;
pub
use
traits
::
*
;
pub
use
traits
::
*
;
pub
use
types
::
*
;
pub
use
types
::
*
;
// pub use weights::WeightInfo;
use
frame_support
::
traits
::
StorageVersion
;
use
frame_support
::
traits
::
StorageVersion
;
use
pallet_authority_members
::
SessionIndex
;
use
pallet_authority_members
::
SessionIndex
;
...
@@ -32,7 +34,7 @@ use sp_std::convert::TryInto;
...
@@ -32,7 +34,7 @@ use sp_std::convert::TryInto;
type
IdtyIndex
=
u32
;
type
IdtyIndex
=
u32
;
#[frame_support::pallet
]
#[frame_support::pallet
(dev_mode)]
// dev mode while waiting for benchmarks
pub
mod
pallet
{
pub
mod
pallet
{
use
super
::
*
;
use
super
::
*
;
use
frame_support
::{
pallet_prelude
::
*
,
traits
::
ReservableCurrency
};
use
frame_support
::{
pallet_prelude
::
*
,
traits
::
ReservableCurrency
};
...
@@ -43,7 +45,7 @@ pub mod pallet {
...
@@ -43,7 +45,7 @@ pub mod pallet {
const
STORAGE_VERSION
:
StorageVersion
=
StorageVersion
::
new
(
1
);
const
STORAGE_VERSION
:
StorageVersion
=
StorageVersion
::
new
(
1
);
#[pallet::pallet]
#[pallet::pallet]
#[pallet::generate_store(pub(super)
trait
Store)]
//
#[pallet::generate_store(pub(super) trait Store)]
// deprecated
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
#[pallet::without_storage_info]
pub
struct
Pallet
<
T
,
I
=
()
>
(
PhantomData
<
(
T
,
I
)
>
);
pub
struct
Pallet
<
T
,
I
=
()
>
(
PhantomData
<
(
T
,
I
)
>
);
...
@@ -70,6 +72,8 @@ pub mod pallet {
...
@@ -70,6 +72,8 @@ pub mod pallet {
type
MinAccessibleReferees
:
Get
<
Perbill
>
;
type
MinAccessibleReferees
:
Get
<
Perbill
>
;
/// Number of session to keep a positive evaluation result
/// Number of session to keep a positive evaluation result
type
ResultExpiration
:
Get
<
u32
>
;
type
ResultExpiration
:
Get
<
u32
>
;
// /// Type representing the weight of this pallet
// type WeightInfo: WeightInfo;
}
}
// STORAGE //
// STORAGE //
...
@@ -190,7 +194,9 @@ pub mod pallet {
...
@@ -190,7 +194,9 @@ pub mod pallet {
#[pallet::call]
#[pallet::call]
impl
<
T
:
Config
<
I
>
,
I
:
'static
>
Pallet
<
T
,
I
>
{
impl
<
T
:
Config
<
I
>
,
I
:
'static
>
Pallet
<
T
,
I
>
{
/// Request an identity to be evaluated
/// Request an identity to be evaluated
#[pallet::weight(
1_000_000_000
)]
#[pallet::call_index(
0
)]
#[pallet::weight(
0
)]
// #[pallet::weight(T::WeightInfo::request_distance_evaluation())]
pub
fn
request_distance_evaluation
(
origin
:
OriginFor
<
T
>
)
->
DispatchResultWithPostInfo
{
pub
fn
request_distance_evaluation
(
origin
:
OriginFor
<
T
>
)
->
DispatchResultWithPostInfo
{
let
who
=
ensure_signed
(
origin
)
?
;
let
who
=
ensure_signed
(
origin
)
?
;
...
@@ -207,7 +213,9 @@ pub mod pallet {
...
@@ -207,7 +213,9 @@ pub mod pallet {
}
}
/// (Inherent) Push an evaluation result to the pool
/// (Inherent) Push an evaluation result to the pool
#[pallet::weight(
1_000_000_000
)]
#[pallet::call_index(
1
)]
#[pallet::weight(
0
)]
// #[pallet::weight(T::WeightInfo::update_evaluation())]
pub
fn
update_evaluation
(
pub
fn
update_evaluation
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
computation_result
:
ComputationResult
,
computation_result
:
ComputationResult
,
...
@@ -226,7 +234,9 @@ pub mod pallet {
...
@@ -226,7 +234,9 @@ pub mod pallet {
}
}
/// Push an evaluation result to the pool
/// Push an evaluation result to the pool
#[pallet::weight(
1_000_000_000
)]
#[pallet::call_index(
2
)]
#[pallet::weight(
0
)]
// #[pallet::weight(T::WeightInfo::force_update_evaluation())]
pub
fn
force_update_evaluation
(
pub
fn
force_update_evaluation
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
evaluator
:
<
T
as
frame_system
::
Config
>
::
AccountId
,
evaluator
:
<
T
as
frame_system
::
Config
>
::
AccountId
,
...
@@ -238,7 +248,9 @@ pub mod pallet {
...
@@ -238,7 +248,9 @@ pub mod pallet {
}
}
/// Push an evaluation result to the pool
/// Push an evaluation result to the pool
#[pallet::weight(
1_000_000
)]
#[pallet::call_index(
3
)]
#[pallet::weight(
0
)]
// #[pallet::weight(T::WeightInfo::force_set_distance_status())]
pub
fn
force_set_distance_status
(
pub
fn
force_set_distance_status
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
identity
:
<
T
as
pallet_certification
::
Config
<
I
>>
::
IdtyIndex
,
identity
:
<
T
as
pallet_certification
::
Config
<
I
>>
::
IdtyIndex
,
...
...
This diff is collapsed.
Click to expand it.
pallets/distance/src/weights.rs
0 → 100644
+
1
−
0
View file @
8c0a09f5
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