Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1000i100-test
  • 105_gitlab_container_registry
  • cgeek/issue-297-cpu
  • ci_cache
  • debug/podman
  • elois-compose-metrics
  • elois-duniter-storage
  • elois-smoldot
  • feature/dc-dump
  • feature/distance-rule
  • feature/show_milestone
  • fix-252
  • gdev-800-tests
  • hugo-release/runtime-701
  • hugo-tmp-dockerfile-cache
  • hugo/195-doc
  • hugo/195-graphql-schema
  • hugo/distance-precompute
  • hugo/endpoint-gossip
  • hugo/tmp-0.9.1
  • master
  • network/gdev-800
  • network/gdev-802
  • network/gdev-803
  • network/gdev-900
  • pini-check-password
  • release/client-800.2
  • release/hugo-chainspec-gdev5
  • release/poka-chainspec-gdev5
  • release/poka-chainspec-gdev5-pini-docker
  • release/runtime-100
  • release/runtime-200
  • release/runtime-300
  • release/runtime-400
  • release/runtime-401
  • release/runtime-500
  • release/runtime-600
  • release/runtime-700
  • release/runtime-701
  • release/runtime-800
  • tests/distance-with-oracle
  • tuxmain/anonymous-tx
  • tuxmain/benchmark-distance
  • update-docker-compose-rpc-squid-names
  • gdev-800
  • gdev-800-0.8.0
  • gdev-802
  • gdev-803
  • gdev-900-0.10.0
  • gdev-900-0.10.1
  • gdev-900-0.9.0
  • gdev-900-0.9.1
  • gdev-900-0.9.2
  • runtime-100
  • runtime-101
  • runtime-102
  • runtime-103
  • runtime-104
  • runtime-105
  • runtime-200
  • runtime-201
  • runtime-300
  • runtime-301
  • runtime-302
  • runtime-303
  • runtime-400
  • runtime-401
  • runtime-500
  • runtime-600
  • runtime-700
  • runtime-701
  • runtime-800
  • runtime-800-backup
  • runtime-800-bis
  • runtime-801
  • v0.1.0
  • v0.2.0
  • v0.3.0
  • v0.4.0
  • v0.4.1
80 results

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Select Git revision
  • archive_upgrade_polkadot_v0.9.42
  • david-wot-scenarios-cucumber
  • distance
  • elois-ci-binary-release
  • elois-compose-metrics
  • elois-duniter-storage
  • elois-fix-85
  • elois-fix-idty-post-genesis
  • elois-fix-sufficients-change-owner-key
  • elois-opti-cert
  • elois-remove-renewable-period
  • elois-revoc-with-old-key
  • elois-rework-certs
  • elois-smish-members-cant-change-or-rem-idty
  • elois-smoldot
  • elois-substrate-v0.9.23
  • elois-technical-commitee
  • hugo-gtest
  • hugo-remove-duniter-account
  • hugo-rework-genesis
  • hugo-tmp
  • jrx/workspace_tomls
  • master
  • no-bootnodes
  • pallet-benchmark
  • release/poka-chainspec-gdev5
  • release/poka-chainspec-gdev5-pini-docker
  • release/runtime-100
  • release/runtime-200
  • release/runtime-300
  • release/runtime-400
  • test-gen-new-owner-key-msg
  • ts-types
  • ud-time-64
  • upgrade_polkadot_v0.9.42
  • runtime-100
  • runtime-101
  • runtime-102
  • runtime-103
  • runtime-104
  • runtime-105
  • runtime-200
  • runtime-201
  • runtime-300
  • runtime-301
  • runtime-302
  • runtime-303
  • runtime-400
  • v0.1.0
  • v0.2.0
  • v0.3.0
  • v0.4.0
52 results
Show changes
......@@ -23,72 +23,73 @@
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
pub mod parameters;
pub mod weights;
pub use self::parameters::*;
use common_runtime::IdtyNameValidatorImpl;
pub use common_runtime::{
constants::*, entities::*, handlers::*, AccountId, Address, Balance, BlockNumber,
FullIdentificationOfImpl, GetCurrentEpochIndex, Hash, Header, IdtyIndex, Index, Signature,
};
use frame_support::{traits::Contains, PalletId};
pub use frame_system::Call as SystemCall;
use frame_system::EnsureRoot;
pub use pallet_balances::Call as BalancesCall;
use pallet_grandpa::{
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
};
pub use pallet_identity::{IdtyStatus, IdtyValue};
pub use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_session::historical as session_historical;
pub use pallet_timestamp::Call as TimestampCall;
use pallet_transaction_payment::CurrencyAdapter;
use pallet_transaction_payment::FungibleAdapter;
pub use pallet_universal_dividend;
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
pub use sp_runtime::{KeyTypeId, Perbill, Permill};
use common_runtime::IdtyNameValidatorImpl;
use frame_support::traits::Contains;
use frame_support::PalletId;
use frame_system::EnsureRoot;
use pallet_grandpa::fg_primitives;
use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
use scale_info::prelude::{vec, vec::Vec};
use sp_api::impl_runtime_apis;
use sp_core::OpaqueMetadata;
use sp_runtime::traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys};
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
generic, impl_opaque_keys,
traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
ApplyExtrinsicResult, Cow, Perquintill,
};
use sp_std::prelude::*;
pub use sp_runtime::{KeyTypeId, Perbill, Permill};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
pub use weights::paritydb_weights::constants::ParityDbWeight as DbWeight;
// A few exports that help ease life for downstream crates.
use frame_support::instances::Instance2;
pub use frame_support::{
construct_runtime, parameter_types,
traits::{EqualPrivilegeOnly, KeyOwnerProofSystem, Randomness},
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},
Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
},
StorageValue,
};
common_runtime::declare_session_keys! {}
// To learn more about runtime versioning and what each of the following value means:
// https://substrate.dev/docs/en/knowledgebase/runtime/upgrades#runtime-versioning
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("g1"),
impl_name: create_runtime_str!("duniter-g1"),
spec_name: Cow::Borrowed("g1"),
impl_name: Cow::Borrowed("duniter-g1"),
authoring_version: 1,
// The version of the runtime specification. A full node will not attempt to use its native
// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 400,
spec_version: 800,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
state_version: 1,
system_version: 1,
};
/// The version information used to identify this runtime when compiled natively.
......@@ -104,9 +105,9 @@ pub fn native_version() -> NativeVersion {
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// The SignedExtension to the basic transaction logic.
pub type SignedExtra = (
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
/// The `TransactionExtension` to the basic transaction logic.
pub type TxExtension = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
......@@ -115,6 +116,7 @@ pub type SignedExtra = (
pallet_oneshot_account::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
......@@ -127,43 +129,10 @@ pub type Executive = frame_executive::Executive<
pub type TechnicalCommitteeInstance = Instance2;
#[cfg(feature = "runtime-benchmarks")]
mod benches {
define_benchmarks!(
// Duniter
// NOTE: Make sure to prefix these with `common_runtime::` so
// the that path resolves correctly in the generated file.
[common_runtime::oneshot_account, OneshotAccount]
[common_runtime::universal_dividend, UniversalDividend]
[common_runtime::upgrade_origin, UpgradeOrigin]
// Substrate
[pallet_balances, Balances]
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_collective, TechnicalCommittee]
[pallet_im_online, ImOnline]
[pallet_multisig, Multisig]
[pallet_preimage, Preimage]
[pallet_proxy, Proxy]
[pallet_scheduler, Scheduler]
[frame_system, SystemBench::<Runtime>]
[pallet_timestamp, Timestamp]
[pallet_treasury, Treasury]
[pallet_utility, Utility]
);
}
pub struct BaseCallFilter;
impl Contains<RuntimeCall> for BaseCallFilter {
fn contains(call: &RuntimeCall) -> bool {
!matches!(
call,
RuntimeCall::System(
frame_system::Call::remark { .. } | frame_system::Call::remark_with_event { .. }
) | RuntimeCall::Membership(
pallet_membership::Call::claim_membership { .. }
| pallet_membership::Call::revoke_membership { .. }
) | RuntimeCall::Session(_)
)
!matches!(call, RuntimeCall::Session(_))
}
}
......@@ -171,13 +140,14 @@ impl Contains<RuntimeCall> for BaseCallFilter {
#[derive(
Copy,
Clone,
codec::DecodeWithMemTracking,
Eq,
PartialEq,
Ord,
PartialOrd,
codec::Encode,
codec::Decode,
frame_support::RuntimeDebug,
frame_support::pallet_prelude::RuntimeDebug,
codec::MaxEncodedLen,
scale_info::TypeInfo,
)]
......@@ -199,7 +169,9 @@ impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType {
// Some calls are never authorized from a proxied account
!matches!(
c,
RuntimeCall::Cert(..) | RuntimeCall::Identity(..) | RuntimeCall::SmithsCert(..)
RuntimeCall::Certification(..)
| RuntimeCall::Identity(..)
| RuntimeCall::SmithMembers(..)
)
}
ProxyType::TransferOnly => {
......@@ -218,90 +190,67 @@ impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType {
}
}
common_runtime::pallets_config! {
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
}
}
// Create the runtime by composing the FRAME pallets that were previously configured.
// Create the runtime by composing the pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = common_runtime::Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub enum Runtime
{
// Basic stuff
System: frame_system::{Pallet, Call, Config, Storage, Event<T>} = 0,
Account: pallet_duniter_account::{Pallet, Storage, Config<T>, Event<T>} = 1,
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>} = 2,
System: frame_system = 0,
Account: pallet_duniter_account = 1,
Scheduler: pallet_scheduler = 2,
// Block creation
Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned} = 3,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 4,
Babe: pallet_babe = 3,
Timestamp: pallet_timestamp = 4,
// Money management
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 6,
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>} = 32,
OneshotAccount: pallet_oneshot_account::{Pallet, Call, Storage, Event<T>} = 7,
Balances: pallet_balances = 6,
TransactionPayment: pallet_transaction_payment = 32,
OneshotAccount: pallet_oneshot_account = 7,
Quota: pallet_quota = 66,
// Consensus support.
AuthorityMembers: pallet_authority_members::{Pallet, Call, Storage, Config<T>, Event<T>} = 10,
Authorship: pallet_authorship::{Pallet, Call, Storage} = 11,
Offences: pallet_offences::{Pallet, Storage, Event} = 12,
Historical: session_historical::{Pallet} = 13,
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 14,
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event} = 15,
ImOnline: pallet_im_online::{Pallet, Call, Storage, Event<T>, ValidateUnsigned, Config<T>} = 16,
AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config} = 17,
// Consensus support
SmithMembers: pallet_smith_members = 10,
AuthorityMembers: pallet_authority_members = 11,
Authorship: pallet_authorship = 12,
Offences: pallet_offences = 13,
Historical: session_historical = 14,
Session: pallet_session = 15,
Grandpa: pallet_grandpa= 16,
ImOnline: pallet_im_online = 17,
AuthorityDiscovery: pallet_authority_discovery = 18,
// Governance stuff.
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
UpgradeOrigin: pallet_upgrade_origin::{Pallet, Call, Event} = 21,
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 22,
TechnicalCommittee: pallet_collective::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>, Origin<T>} = 23,
// Governance stuff
Sudo: pallet_sudo = 20,
UpgradeOrigin: pallet_upgrade_origin = 21,
Preimage: pallet_preimage = 22,
TechnicalCommittee: pallet_collective::<Instance2> = 23,
// Universal dividend
UniversalDividend: pallet_universal_dividend::{Pallet, Call, Config<T>, Storage, Event<T>} = 30,
UniversalDividend: pallet_universal_dividend = 30,
// Web Of Trust
Wot: pallet_duniter_wot::<Instance1>::{Pallet} = 40,
Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 41,
Membership: pallet_membership::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 42,
Cert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 43,
// Smiths Sub-Wot
SmithsSubWot: pallet_duniter_wot::<Instance2>::{Pallet} = 50,
SmithsMembership: pallet_membership::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 52,
SmithsCert: pallet_certification::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 53,
Wot: pallet_duniter_wot = 40,
Identity: pallet_identity = 41,
Membership: pallet_membership = 42,
Certification: pallet_certification = 43,
Distance: pallet_distance = 44,
// Utilities
AtomicSwap: pallet_atomic_swap::{Pallet, Call, Storage, Event<T>} = 60,
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 61,
ProvideRandomness: pallet_provide_randomness::{Pallet, Call, Storage, Event} = 62,
Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 63,
Utility: pallet_utility::{Pallet, Call, Event} = 64,
Treasury: pallet_treasury::{Pallet, Call, Config, Storage, Event<T>} = 65,
AtomicSwap: pallet_atomic_swap = 50,
Multisig: pallet_multisig = 51,
ProvideRandomness: pallet_provide_randomness = 52,
Proxy: pallet_proxy = 53,
Utility: pallet_utility = 54,
Treasury: pallet_treasury = 55,
}
);
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = RuntimeCall;
}
// All of our runtimes share most of their Runtime API implementations.
// We use a macro to implement this common part and add runtime-specific additional implementations.
// This macro expands to :
// ```
// impl_runtime_apis! {
// // All impl blocks shared between all runtimes.
//
// // Specific impls provided to the `runtime_apis!` macro.
// }
// ```
common_runtime::pallets_config!();
common_runtime::declare_session_keys! {}
#[cfg(feature = "runtime-benchmarks")]
common_runtime::benchmarks_config!();
common_runtime::offchain_config! {}
common_runtime::runtime_apis! {}
......@@ -15,18 +15,14 @@
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use crate::*;
use common_runtime::constants::*;
use common_runtime::{Balance, BlockNumber};
use frame_support::parameter_types;
use frame_support::weights::constants::WEIGHT_PER_SECOND;
use sp_arithmetic::Perbill;
use common_runtime::{constants::*, Moment};
use frame_support::{parameter_types, weights::constants::WEIGHT_REF_TIME_PER_SECOND};
use sp_runtime::transaction_validity::TransactionPriority;
parameter_types! {
pub const BlockHashCount: BlockNumber = 2400;
/// We allow for 2 seconds of compute with a 6 second average block time.
pub BlockWeights: frame_system::limits::BlockWeights = block_weights((WEIGHT_PER_SECOND * 2)
.set_proof_size(5 * 1024 * 1024), NORMAL_DISPATCH_RATIO);
pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::with_sensible_defaults(Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND * 2u64, u64::MAX), NORMAL_DISPATCH_RATIO);
pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength
::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
pub const SS58Prefix: u16 = 4450;
......@@ -51,17 +47,23 @@ parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}
// Distance
parameter_types! {
pub const MinAccessibleReferees: Perbill = Perbill::from_percent(80);
pub const MaxRefereeDistance: u32 = 5;
}
// Babe
pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 4 * HOURS;
parameter_types! {
pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64;
pub const ExpectedBlockTime: u64 = MILLISECS_PER_BLOCK;
pub const ReportLongevity: u64 = 168 * EpochDuration::get();
pub const ReportLongevity: BlockNumber = 168 * EPOCH_DURATION_IN_SLOTS;
}
// ImOnline
parameter_types! {
pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value();
pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::MAX;
pub const MaxPeerInHeartbeats: u32 = 10_000;
pub const MaxPeerDataEncodingSize: u32 = 1_000;
}
......@@ -71,6 +73,15 @@ parameter_types! {
/*********/
// Balances
// Why? Pallet treasury benchmarks are broken because the spend
// value is hardcoded 100 in benchmark and the account is not provided enough funds
// to exist if ED > 100.
#[cfg(feature = "runtime-benchmarks")]
frame_support::parameter_types! {
pub const ExistentialDeposit: Balance = 100;
pub const MaxLocks: u32 = 50;
}
#[cfg(not(feature = "runtime-benchmarks"))]
frame_support::parameter_types! {
pub const ExistentialDeposit: Balance = 200;
pub const MaxLocks: u32 = 50;
......@@ -80,8 +91,8 @@ frame_support::parameter_types! {
parameter_types! {
// 0.002_381_440 = 0.0488^2
pub const SquareMoneyGrowthRate: Perbill = Perbill::from_parts(2_381_440);
pub const UdCreationPeriod: BlockNumber = DAYS;
pub const UdReevalPeriod: BlockNumber = 2_620_800; // 86400 * 182 / 6
pub const UdCreationPeriod: Moment = 86_400_000; // 1 day
pub const UdReevalPeriod: Moment = 15_778_800_000; // 1/2 year
}
/*******/
......@@ -100,12 +111,14 @@ parameter_types! {
pub const ConfirmPeriod: BlockNumber = 14 * DAYS;
pub const IdtyCreationPeriod: BlockNumber = MONTHS;
pub const ValidationPeriod: BlockNumber = YEARS;
pub const AutorevocationPeriod: BlockNumber = YEARS;
pub const DeletionPeriod: BlockNumber = 10 * YEARS;
}
// Membership
parameter_types! {
pub const MembershipPeriod: BlockNumber = YEARS;
pub const PendingMembershipPeriod: BlockNumber = 2 * MONTHS;
pub const MembershipRenewalPeriod: BlockNumber = 2 * MONTHS;
}
// Certification
......@@ -117,26 +130,13 @@ parameter_types! {
}
/******************/
/* SMITHS SUB-WOT */
/* SMITH-MEMBERS */
/******************/
parameter_types! {
pub const SmithsWotFirstCertIssuableOn: BlockNumber = 30 * DAYS;
pub const SmithsWotMinCertForMembership: u32 = 3;
}
// Membership
parameter_types! {
pub const SmithMembershipPeriod: BlockNumber = 73 * DAYS;
pub const SmithPendingMembershipPeriod: BlockNumber = 12 * DAYS;
}
// Certification
parameter_types! {
pub const SmithCertPeriod: BlockNumber = 5 * DAYS;
pub const SmithWotMinCertForMembership: u32 = 3;
pub const SmithMaxByIssuer: u32 = 12;
pub const SmithMinReceivedCertToBeAbleToIssueCert: u32 = 5;
pub const SmithValidityPeriod: BlockNumber = 146 * DAYS;
pub const SmithInactivityMaxDuration: u32 = 48;
}
/*************/
......
......@@ -18,16 +18,37 @@
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(clippy::unnecessary_cast)]
#![allow(unused_doc_comments)]
pub mod frame_system_extensions;
pub mod pallet_transaction_payment;
pub mod block_weights;
pub mod extrinsic_weights;
pub mod frame_system;
pub mod pallet_babe;
pub mod pallet_balances;
pub mod pallet_collective;
pub mod pallet_distance;
pub mod pallet_grandpa;
pub mod pallet_im_online;
pub mod pallet_multisig;
pub mod pallet_proxy;
pub mod pallet_session;
pub mod pallet_scheduler;
pub mod pallet_timestamp;
pub mod pallet_treasury;
pub mod pallet_universal_dividend;
pub mod pallet_upgrade_origin;
pub mod pallet_provide_randomness;
pub mod pallet_identity;
pub mod pallet_preimage;
pub mod pallet_utility;
pub mod pallet_duniter_account;
pub mod pallet_quota;
pub mod pallet_oneshot_account;
pub mod pallet_certification;
pub mod pallet_membership;
pub mod pallet_smith_members;
pub mod pallet_sudo;
pub mod pallet_authority_members;
pub mod paritydb_weights;
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.0.0
//! DATE: 2025-04-09 (Y/M/D)
//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F`
//!
//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Ğ1 Local Testnet`
//! WARMUPS: `10`, REPEAT: `100`
//! WEIGHT-PATH: `./runtime/g1/src/weights/`
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`
// Executed Command:
// target/release/duniter
// benchmark
// overhead
// --chain=dev
// --wasm-execution=compiled
// --weight-path=./runtime/g1/src/weights/
// --warmup=10
// --repeat=100
use sp_core::parameter_types;
use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
parameter_types! {
/// Weight of executing an empty block.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 126_592, 173_147
/// Average: 134_865
/// Median: 133_906
/// Std-Dev: 5688.69
///
/// Percentiles nanoseconds:
/// 99th: 156_296
/// 95th: 142_398
/// 75th: 135_389
pub const BlockExecutionWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(134_865), 0);
}
#[cfg(test)]
mod test_weights {
use sp_weights::constants;
/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::BlockExecutionWeight::get();
// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
);
}
}