Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Democracy Electorate Configuration #162

Merged
merged 3 commits into from Feb 8, 2024

Conversation

vstam1
Copy link
Collaborator

@vstam1 vstam1 commented Feb 8, 2024

No description provided.

@vstam1 vstam1 requested review from lrazovic and JuaniRios and removed request for lrazovic February 8, 2024 14:36
Copy link
Contributor

@JuaniRios JuaniRios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

Copy link
Contributor

@lrazovic lrazovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice hotfix!

I don't think it makes a big difference, but what about using the fungible API to get the treasuries balance as stated here?

diff --git a/runtimes/base/src/lib.rs b/runtimes/base/src/lib.rs
index 29b651b..5116cfa 100644
--- a/runtimes/base/src/lib.rs
+++ b/runtimes/base/src/lib.rs
@@ -24,7 +24,7 @@ extern crate frame_benchmarking;
 use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
 use frame_support::{
 	construct_runtime, parameter_types,
-	traits::{fungible::Credit, tokens, ConstU32, Contains, EitherOfDiverse, InstanceFilter, PrivilegeCmp},
+	traits::{fungible::{Credit, Inspect}, tokens, ConstU32, Contains, EitherOfDiverse, InstanceFilter, PrivilegeCmp},
 	weights::{ConstantMultiplier, Weight},
 };
 use frame_system::{EnsureRoot, EnsureSigned};
@@ -489,8 +489,8 @@ pub struct Electorate;
 impl GetElectorate<Balance> for Electorate {
 	fn get_electorate() -> Balance {
 		let total_issuance = Balances::total_issuance();
-		let growth_treasury_balance = Balances::free_balance(Treasury::account_id());
-		let protocol_treasury_balance = Balances::free_balance(PayMaster::get());
+		let growth_treasury_balance = Balances::balance(&Treasury::account_id());
+		let protocol_treasury_balance = Balances::balance(&PayMaster::get());
 		total_issuance.saturating_sub(growth_treasury_balance).saturating_sub(protocol_treasury_balance)
 	}
 }

@lrazovic lrazovic self-requested a review February 8, 2024 15:14
Copy link
Contributor

@lrazovic lrazovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lrazovic lrazovic merged commit 5326bab into main Feb 8, 2024
@JuaniRios JuaniRios deleted the feature/update-electorate-calculation branch March 26, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants