From 770d3a29e990b4f1f71429fe513a14ed8cca13ba Mon Sep 17 00:00:00 2001 From: Ignazio Bovo Date: Tue, 4 Jun 2024 16:23:35 +0200 Subject: [PATCH 1/2] fix: :art: adjust funding proposal parameters --- runtime/src/lib.rs | 2 +- runtime/src/proposals_configuration/defaults.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index f104cbf8bd..7a1a63fcdd 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1682,7 +1682,7 @@ parameter_types! { // Make sure to stay below MAX_BLOCK_SIZE of substrate consensus of ~4MB // The new compressed wasm format is much smaller in size ~ 1MB pub const RuntimeUpgradeWasmProposalMaxLength: u32 = DispatchableCallCodeMaxLen::get(); - pub const FundingRequestProposalMaxTotalAmount: Balance = dollars!(10_000); + pub const FundingRequestProposalMaxTotalAmount: Balance = 10_000_000_000_000_000.into(); // 1 million JOY pub const FundingRequestProposalMaxAccounts: u32 = 20; pub const SetMaxValidatorCountProposalMaxValidators: u32 = 100; } diff --git a/runtime/src/proposals_configuration/defaults.rs b/runtime/src/proposals_configuration/defaults.rs index 15e3fc6d1f..18ec9a3031 100644 --- a/runtime/src/proposals_configuration/defaults.rs +++ b/runtime/src/proposals_configuration/defaults.rs @@ -65,7 +65,7 @@ pub(crate) fn funding_request_proposal() -> ProposalParameters Date: Tue, 4 Jun 2024 16:42:32 +0200 Subject: [PATCH 2/2] fix: :sparkles: use joy macro for readability --- runtime/src/lib.rs | 2 +- runtime/src/proposals_configuration/defaults.rs | 4 ++-- runtime/src/utils.rs | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 7a1a63fcdd..ffe3de2bc8 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1682,7 +1682,7 @@ parameter_types! { // Make sure to stay below MAX_BLOCK_SIZE of substrate consensus of ~4MB // The new compressed wasm format is much smaller in size ~ 1MB pub const RuntimeUpgradeWasmProposalMaxLength: u32 = DispatchableCallCodeMaxLen::get(); - pub const FundingRequestProposalMaxTotalAmount: Balance = 10_000_000_000_000_000.into(); // 1 million JOY + pub const FundingRequestProposalMaxTotalAmount: Balance = joy!(1_000_000); pub const FundingRequestProposalMaxAccounts: u32 = 20; pub const SetMaxValidatorCountProposalMaxValidators: u32 = 100; } diff --git a/runtime/src/proposals_configuration/defaults.rs b/runtime/src/proposals_configuration/defaults.rs index 18ec9a3031..3b1ba508af 100644 --- a/runtime/src/proposals_configuration/defaults.rs +++ b/runtime/src/proposals_configuration/defaults.rs @@ -1,7 +1,7 @@ //! This module contains default "production" parameters configuration for the runtime codex proposals. use crate::{ - currency, days, dollars, hours, Balance, BlockNumber, CouncilSize, ExpectedBlockTime, + currency, days, dollars, hours, joy, Balance, BlockNumber, CouncilSize, ExpectedBlockTime, ProposalParameters, }; use static_assertions::const_assert; @@ -65,7 +65,7 @@ pub(crate) fn funding_request_proposal() -> ProposalParameters { + currency::BASE_UNIT_PER_JOY.saturating_mul($a).into() + }; +}