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
e88b9a4b
Unverified
Commit
e88b9a4b
authored
5 months ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
move MembersCount
parent
40404150
No related branches found
No related tags found
1 merge request
!286
Refactore Runtime handlers and providers
Pipeline
#38572
passed
5 months ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
runtime/common/src/pallets_config.rs
+1
-10
1 addition, 10 deletions
runtime/common/src/pallets_config.rs
runtime/common/src/providers.rs
+11
-1
11 additions, 1 deletion
runtime/common/src/providers.rs
with
12 additions
and
11 deletions
runtime/common/src/pallets_config.rs
+
1
−
10
View file @
e88b9a4b
...
...
@@ -176,8 +176,6 @@ macro_rules! pallets_config {
type
WeightInfo
=
weights
::
pallet_balances
::
WeightInfo
<
Runtime
>
;
}
pub
struct
OnChargeTransaction
;
parameter_types!
{
pub
Target
:
Perquintill
=
Perquintill
::
from_percent
(
25
);
pub
MaxMultiplier
:
sp_runtime
::
FixedU128
=
10
.into
();
...
...
@@ -411,19 +409,12 @@ macro_rules! pallets_config {
// UNIVERSAL DIVIDEND //
pub
struct
MembersCount
;
impl
frame_support
::
pallet_prelude
::
Get
<
Balance
>
for
MembersCount
{
fn
get
()
->
Balance
{
<
Membership
as
sp_membership
::
traits
::
MembersCount
>
::
members_count
()
as
Balance
}
}
impl
pallet_universal_dividend
::
Config
for
Runtime
{
type
Currency
=
Balances
;
#[cfg(feature
=
"runtime-benchmarks"
)]
type
IdtyAttr
=
Identity
;
type
MaxPastReeval
=
frame_support
::
traits
::
ConstU32
<
160
>
;
type
MembersCount
=
MembersCount
;
type
MembersCount
=
common_runtime
::
providers
::
MembersCount
<
Membership
>
;
type
MembersStorage
=
common_runtime
::
providers
::
UdMembersStorage
<
Runtime
>
;
type
MomentIntoBalance
=
sp_runtime
::
traits
::
ConvertInto
;
type
RuntimeEvent
=
RuntimeEvent
;
...
...
This diff is collapsed.
Click to expand it.
runtime/common/src/providers.rs
+
11
−
1
View file @
e88b9a4b
...
...
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use
crate
::{
entities
::
IdtyData
,
AccountId
,
IdtyIndex
};
use
crate
::{
entities
::
IdtyData
,
AccountId
,
Balance
,
IdtyIndex
};
use
core
::
marker
::
PhantomData
;
use
pallet_universal_dividend
::
FirstEligibleUd
;
...
...
@@ -116,3 +116,13 @@ macro_rules! impl_benchmark_setup_handler {
#[cfg(feature
=
"runtime-benchmarks"
)]
impl_benchmark_setup_handler!
(
pallet_membership
::
SetupBenchmark
<<
T
as
pallet_identity
::
Config
>
::
IdtyIndex
,
T
::
AccountId
>
);
pub
struct
MembersCount
<
T
>
(
PhantomData
<
T
>
);
impl
<
T
>
frame_support
::
pallet_prelude
::
Get
<
Balance
>
for
MembersCount
<
T
>
where
T
:
sp_membership
::
traits
::
MembersCount
,
{
fn
get
()
->
Balance
{
T
::
members_count
()
as
Balance
}
}
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