Skip to content

Commit

Permalink
fix(pallets/subspace): set floor founder share to 0 in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aripiprazole committed May 3, 2024
1 parent 1d87f87 commit aa7df07
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions pallets/subspace/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ impl<T: Config> Pallet<T> {
AdjustmentAlpha::<T>::put(adjustment_alpha);
}

pub fn set_floor_founder_share(founder_share: u8) {
FloorFounderShare::<T>::put(founder_share);
}

// Whitelist management
pub fn is_in_legit_whitelist(account_id: &T::AccountId) -> bool {
LegitWhitelist::<T>::contains_key(account_id)
Expand Down
2 changes: 0 additions & 2 deletions pallets/subspace/src/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ impl<T: Config> Pallet<T> {
}
};

log::info!("AAAAAAAAAAAA");

// TODO: later, once legit whitelist has been filled up, turn on the code below.
// We also have to declear a migration, of modules on netuid 0 that are not whitelisted.

Expand Down
3 changes: 0 additions & 3 deletions pallets/subspace/tests/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ fn test_burn() {
let voter_key_index = 1;
let voter_key = keys[voter_key_index];

println!("biiiiii");

SubspaceModule::set_max_registrations_per_block(1000);
for (key, stake) in keys.iter().zip(stakes.iter()) {
println!("a");
assert_ok!(register_module(netuid, *key, *stake));
}

Expand Down
1 change: 1 addition & 0 deletions pallets/subspace/tests/profit_share.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn test_add_profit_share() {
let voter_key = U256::from(1);
// make sure that the results won´t get affected by burn
SubspaceModule::set_min_burn(0);
SubspaceModule::set_floor_founder_share(0);

register_module(netuid, miner_key, 1_000_000_000).expect("register miner module failed");
register_module(netuid, voter_key, 1_000_000_000).expect("register voter module failed");
Expand Down
2 changes: 2 additions & 0 deletions pallets/subspace/tests/step_yuma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fn test_1_graph() {
new_test_ext().execute_with(|| {
SubspaceModule::set_unit_emission(23148148148);
SubspaceModule::set_min_burn(0);
SubspaceModule::set_floor_founder_share(0);

// Register general subnet
assert_ok!(register_module(0, 10.into(), 1));
Expand Down Expand Up @@ -114,6 +115,7 @@ fn test_10_graph() {
new_test_ext().execute_with(|| {
SubspaceModule::set_unit_emission(23148148148);
SubspaceModule::set_min_burn(0);
SubspaceModule::set_floor_founder_share(0);
SubspaceModule::set_max_registrations_per_block(1000);
// Register general subnet
assert_ok!(register_module(0, 10_000.into(), 1));
Expand Down
5 changes: 3 additions & 2 deletions pallets/subspace/tests/voting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use frame_support::assert_ok;
use mock::*;
use pallet_subspace::{
voting::{ProposalData, ProposalStatus, VoteMode},
GlobalParams, MinBurn, ProposalCost, ProposalExpiration, Proposals, SubnetParams, Tempo,
VoteModeSubnet,
FloorFounderShare, GlobalParams, MinBurn, ProposalCost, ProposalExpiration, Proposals,
SubnetParams, Tempo, VoteModeSubnet,
};
use sp_core::U256;

Expand All @@ -17,6 +17,7 @@ fn creates_global_params_proposal_correctly_and_expires() {
const COST: u64 = to_nano(10);

MinBurn::<Test>::set(0);
FloorFounderShare::<Test>::set(0);

ProposalCost::<Test>::set(COST);
ProposalExpiration::<Test>::set(100);
Expand Down
1 change: 1 addition & 0 deletions pallets/subspace/tests/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ fn test_weight_age() {
const PASSIVE_VOTER: u16 = 0;
const ACTIVE_VOTER: u16 = 1;
SubspaceModule::set_max_registrations_per_block(1000);
SubspaceModule::set_floor_founder_share(0);

// Register modules
(0..MODULE_COUNT).for_each(|i| {
Expand Down

0 comments on commit aa7df07

Please sign in to comment.