From b0f946f4719887840b2fdbf559546735b3c1350b Mon Sep 17 00:00:00 2001 From: akildemir Date: Mon, 14 Oct 2024 12:54:48 +0300 Subject: [PATCH] set mock runtime AllowMint to correct type --- substrate/in-instructions/pallet/src/mock.rs | 2 +- substrate/in-instructions/pallet/src/tests.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/substrate/in-instructions/pallet/src/mock.rs b/substrate/in-instructions/pallet/src/mock.rs index 65013eb4..05417863 100644 --- a/substrate/in-instructions/pallet/src/mock.rs +++ b/substrate/in-instructions/pallet/src/mock.rs @@ -112,7 +112,7 @@ impl grandpa::Config for Test { impl coins::Config for Test { type RuntimeEvent = RuntimeEvent; - type AllowMint = (); + type AllowMint = ValidatorSets; } impl coins::Config for Test { diff --git a/substrate/in-instructions/pallet/src/tests.rs b/substrate/in-instructions/pallet/src/tests.rs index 43a5b025..cc2b0f3e 100644 --- a/substrate/in-instructions/pallet/src/tests.rs +++ b/substrate/in-instructions/pallet/src/tests.rs @@ -443,6 +443,16 @@ fn swap_to_staked_sri_instruction() { // make a pool so that can actually swap make_liquid_pool(coin, 5 * 10u64.pow(coin.decimals())); + // set the keys to set the TAS for the network + ValidatorSets::::set_keys( + RawOrigin::None.into(), + coin.network(), + Vec::new().try_into().unwrap(), + KeyPair(insecure_pair_from_name("random-key").public(), Vec::new().try_into().unwrap()), + Signature([0u8; 64]), + ) + .unwrap(); + // make sure account doesn't already have lTs or allocation let current_liq_tokens = LiquidityTokens::balance(POL_ACCOUNT.into(), coin.into()).0; assert_eq!(current_liq_tokens, 0);