Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix balances mock
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez committed Oct 17, 2023
commit 88a01c4b27442e5266f8ebc883af7efa03f01bc4
10 changes: 9 additions & 1 deletion substrate/frame/balances/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use crate::{self as pallet_balances, AccountData, Config, CreditOf, Error, Pallet};
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::traits::VariantCount;
use frame_support::{
assert_err, assert_noop, assert_ok, assert_storage_noop,
dispatch::{DispatchInfo, GetDispatchInfo},
Expand Down Expand Up @@ -70,6 +71,12 @@ pub enum TestId {
Baz,
}

impl VariantCount for TestId {
fn variant_count() -> u32 {
3
}
}

frame_support::construct_runtime!(
pub struct Test
{
Expand Down Expand Up @@ -132,9 +139,10 @@ impl Config for Test {
type ReserveIdentifier = TestId;
type WeightInfo = ();
type RuntimeHoldReason = TestId;
type RuntimeFreezeReason = RuntimeFreezeReason;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be TestId?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably me or oliver did too much copy pasta :D I will double check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually probably not, it should be the default one.

type FreezeIdentifier = TestId;
type MaxFreezes = ConstU32<2>;
type MaxHolds = ConstU32<2>;
type MaxHolds = ConstU32<3>;
}

#[derive(Clone)]
Expand Down