Skip to content

Commit

Permalink
fix: 🧪 tests & mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignazio Bovo committed Mar 28, 2024
1 parent b2fa736 commit ac4b0b1
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 49 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions runtime-modules/content/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,6 @@ impl common::council::CouncilBudgetManager<U256, u64> for CouncilBudgetManager {
}

parameter_types! {
pub const DWGModuleId: PalletId = PalletId(*b"m_distwg");
pub const SWGModuleId: PalletId = PalletId(*b"m_storwg");
pub const CWGModuleId: PalletId = PalletId(*b"m_contwg");
pub const MinVestedTransfer: u64 = 10;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
Expand All @@ -503,7 +500,6 @@ impl working_group::Config<StorageWorkingGroupInstance> for Test {
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type VestingBalanceToBalance = BalanceConverter;
type ModuleId = SWGModuleId;
}
// The distribution working group instance alias.
pub type DistributionWorkingGroupInstance = working_group::Instance9;
Expand All @@ -520,7 +516,6 @@ impl working_group::Config<DistributionWorkingGroupInstance> for Test {
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type VestingBalanceToBalance = BalanceConverter;
type ModuleId = DWGModuleId;
}

pub struct BlockNumberToBalance();
Expand Down Expand Up @@ -561,7 +556,6 @@ impl working_group::Config<ContentWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = CWGModuleId;
type VestingBalanceToBalance = BalanceConverter;
}

Expand Down
1 change: 0 additions & 1 deletion runtime-modules/forum/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ impl working_group::Config<ForumWorkingGroupInstance> for Runtime {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = ForumModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand Down
1 change: 1 addition & 0 deletions runtime-modules/proposals/codex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ balances = { package = 'pallet-balances', default-features = false, git = 'https
frame-election-provider-support = { package = 'frame-election-provider-support', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
pallet-bags-list = { package = 'pallet-bags-list', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
sp-npos-elections = { package = 'sp-npos-elections', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
vesting = { package = 'pallet-vesting', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }

[features]
default = ['std']
Expand Down
19 changes: 0 additions & 19 deletions runtime-modules/proposals/codex/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,6 @@ impl Convert<Balance, VestingBalance> for VestingBalanceToBalance {
}

parameter_types! {
// WG modules ids : 8 characters starting with m_ and ending with wg
pub const DistributionModuleId: PalletId = PalletId(*b"m_distwg");
pub const StorageModuleId: PalletId = PalletId(*b"m_storwg");
pub const ContentModuleId: PalletId = PalletId(*b"m_contwg");
pub const ForumModuleId: PalletId = PalletId(*b"m_foruwg");
pub const MembershipModuleId: PalletId = PalletId(*b"m_membwg");
pub const OperationsAlphaModuleId: PalletId = PalletId(*b"m_opsawg");
pub const OperationsBetaModuleId: PalletId = PalletId(*b"m_opsbwg");
pub const OperationsGammaModuleId: PalletId = PalletId(*b"m_opscwg");
pub const AppModuleId: PalletId = PalletId(*b"m_appswg");
pub const MinVestedTransfer: u64 = 10;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
Expand Down Expand Up @@ -559,7 +549,6 @@ impl working_group::Config<ForumWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = ForumModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -574,7 +563,6 @@ impl working_group::Config<StorageWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = StorageModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -589,7 +577,6 @@ impl working_group::Config<ContentWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = ContentModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -604,7 +591,6 @@ impl working_group::Config<OperationsWorkingGroupInstanceAlpha> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = OperationsAlphaModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -619,7 +605,6 @@ impl working_group::Config<AppWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = AppModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -634,7 +619,6 @@ impl working_group::Config<MembershipWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = MembershipModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -649,7 +633,6 @@ impl working_group::Config<OperationsWorkingGroupInstanceBeta> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = OperationsBetaModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -664,7 +647,6 @@ impl working_group::Config<OperationsWorkingGroupInstanceGamma> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = OperationsGammaModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -679,7 +661,6 @@ impl working_group::Config<DistributionWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = DistributionModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand Down
2 changes: 0 additions & 2 deletions runtime-modules/storage/src/tests/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ impl working_group::Config<StorageWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = SWGModuleId;
type VestingBalanceToBalance = ();
}

Expand All @@ -230,7 +229,6 @@ impl working_group::Config<DistributionWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = DWGModuleId;
type VestingBalanceToBalance = ();
}

Expand Down
20 changes: 0 additions & 20 deletions runtime-modules/utility/src/tests/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use frame_support::{
ConstU16, ConstU32, ConstU64, EitherOfDiverse, LockIdentifier, OnFinalize, OnInitialize,
WithdrawReasons,
},
PalletId,
};
use frame_system::{EnsureRoot, EnsureSigned, EventRecord, RawOrigin};
use sp_core::H256;
Expand Down Expand Up @@ -291,16 +290,6 @@ impl Convert<Balance, VestingBalance> for VestingBalanceToBalance {
}
}
parameter_types! {
// WG modules ids : 8 characters starting with m_ and ending with wg
pub const DistributionModuleId: PalletId = PalletId(*b"m_distwg");
pub const StorageModuleId: PalletId = PalletId(*b"m_storwg");
pub const ContentModuleId: PalletId = PalletId(*b"m_contwg");
pub const ForumModuleId: PalletId = PalletId(*b"m_foruwg");
pub const MembershipModuleId: PalletId = PalletId(*b"m_membwg");
pub const OperationsAlphaModuleId: PalletId = PalletId(*b"m_opsawg");
pub const OperationsBetaModuleId: PalletId = PalletId(*b"m_opsbwg");
pub const OperationsGammaModuleId: PalletId = PalletId(*b"m_opscwg");
pub const AppModuleId: PalletId = PalletId(*b"m_appswg");
pub const MinVestedTransfer: u64 = 10;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
Expand Down Expand Up @@ -342,7 +331,6 @@ impl working_group::Config<ForumWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = ForumModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -357,7 +345,6 @@ impl working_group::Config<StorageWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = StorageModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -372,7 +359,6 @@ impl working_group::Config<ContentWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = ContentModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -387,7 +373,6 @@ impl working_group::Config<OperationsWorkingGroupInstanceAlpha> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = OperationsAlphaModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -402,7 +387,6 @@ impl working_group::Config<AppWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = AppModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -417,7 +401,6 @@ impl working_group::Config<MembershipWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = MembershipModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -432,7 +415,6 @@ impl working_group::Config<OperationsWorkingGroupInstanceBeta> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = OperationsBetaModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -447,7 +429,6 @@ impl working_group::Config<OperationsWorkingGroupInstanceGamma> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = OperationsGammaModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand All @@ -462,7 +443,6 @@ impl working_group::Config<DistributionWorkingGroupInstance> for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = DistributionModuleId;
type VestingBalanceToBalance = VestingBalanceToBalance;
}

Expand Down
1 change: 0 additions & 1 deletion runtime-modules/working-group/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ impl Config for Test {
type WeightInfo = ();
type MinimumApplicationStake = MinimumApplicationStake;
type LeaderOpeningStake = LeaderOpeningStake;
type ModuleId = WorkingGroupModuleId;
}

pub struct BlockNumberToBalance();
Expand Down

0 comments on commit ac4b0b1

Please sign in to comment.