Merged
Conversation
lrazovic
requested changes
Feb 8, 2024
Member
lrazovic
left a comment
There was a problem hiding this comment.
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)
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.