Bump Substrate/Polkadot/Cumulus refs (#1295)

Substrate: 31d90c202d6df9ce3837ee55587b604619a912ba
Polkadot: 60df3c55c711c2872872d6220f98b2611340e051
Cumulus: a9630551c2
This commit is contained in:
Svyatoslav Nikolsky
2022-01-27 15:42:26 +03:00
committed by Bastian Köcher
parent fe34a526bb
commit ea2d6f898d
43 changed files with 334 additions and 232 deletions
+4 -4
View File
@@ -64,8 +64,7 @@ pub mod pallet {
+ MaybeSerializeDeserialize
+ Debug
+ MaybeDisplay
+ Ord
+ Default;
+ Ord;
/// Type of account public key on target chain.
type TargetChainAccountPublic: Parameter + IdentifyAccount<AccountId = Self::AccountId>;
/// Type of signature that may prove that the message has been signed by
@@ -520,6 +519,7 @@ mod tests {
type DbWeight = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
impl Config for TestRuntime {
@@ -649,11 +649,11 @@ mod tests {
fn should_fail_on_weight_mismatch() {
new_test_ext().execute_with(|| {
let id = [0; 4];
let call = Call::System(frame_system::Call::remark { remark: vec![1, 2, 3] });
let call = Call::System(frame_system::Call::set_heap_pages { pages: 42 });
let call_weight = call.get_dispatch_info().weight;
let mut message = prepare_root_message(call);
message.weight = 7;
assert!(call_weight != 7, "needed for test to actually trigger a weight mismatch");
assert!(call_weight > 7, "needed for test to actually trigger a weight mismatch");
System::set_block_number(1);
let result = Dispatch::dispatch(
+1
View File
@@ -101,6 +101,7 @@ pub mod pallet {
}
#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::hooks]
+1
View File
@@ -77,6 +77,7 @@ impl frame_system::Config for TestRuntime {
type BlockLength = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
parameter_types! {
@@ -145,7 +145,7 @@ fn pay_relayers_rewards<Currency, AccountId>(
relayer_fund_account: &AccountId,
confirmation_fee: Currency::Balance,
) where
AccountId: Debug + Default + Encode + PartialEq,
AccountId: Debug + Encode + PartialEq,
Currency: CurrencyT<AccountId>,
Currency::Balance: From<u64>,
{
+3
View File
@@ -209,6 +209,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::call]
@@ -2116,6 +2117,7 @@ mod tests {
#[test]
#[should_panic]
#[cfg(debug_assertions)]
fn receive_messages_panics_in_debug_mode_if_callback_is_wrong() {
run_test(|| {
TestOnDeliveryConfirmed1::set_consumed_weight_per_message(
@@ -2248,6 +2250,7 @@ mod tests {
#[test]
#[should_panic]
#[cfg(debug_assertions)]
fn message_accepted_panics_in_debug_mode_if_callback_is_wrong() {
run_test(|| {
TestOnMessageAccepted::set_consumed_weight_per_message(
+1
View File
@@ -125,6 +125,7 @@ impl frame_system::Config for TestRuntime {
type DbWeight = DbWeight;
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
parameter_types! {
@@ -35,6 +35,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::hooks]
@@ -162,6 +163,7 @@ mod tests {
type DbWeight = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
parameter_types! {
+13 -11
View File
@@ -23,13 +23,13 @@ use crate::{
};
use bp_token_swap::{TokenSwap, TokenSwapCreation, TokenSwapState, TokenSwapType};
use codec::Encode;
use codec::{Decode, Encode};
use frame_benchmarking::{account, benchmarks_instance_pallet};
use frame_support::{traits::Currency, Parameter};
use frame_system::RawOrigin;
use sp_core::H256;
use sp_io::hashing::blake2_256;
use sp_runtime::traits::Bounded;
use sp_runtime::traits::{Bounded, TrailingZeroInput};
use sp_std::{boxed::Box, vec::Vec};
const SEED: u32 = 0;
@@ -43,8 +43,8 @@ pub trait Config<I: 'static>: crate::Config<I> {
benchmarks_instance_pallet! {
where_clause {
where
BridgedAccountPublicOf<T, I>: Default + Parameter,
BridgedAccountSignatureOf<T, I>: Default,
BridgedAccountPublicOf<T, I>: Decode + Parameter,
BridgedAccountSignatureOf<T, I>: Decode,
}
//
@@ -138,8 +138,8 @@ fn test_swap_hash<T: Config<I>, I: 'static>(sender: T::AccountId, is_create: boo
/// Returns test token swap creation params.
fn test_swap_creation<T: Config<I>, I: 'static>() -> TokenSwapCreationOf<T, I>
where
BridgedAccountPublicOf<T, I>: Default,
BridgedAccountSignatureOf<T, I>: Default,
BridgedAccountPublicOf<T, I>: Decode,
BridgedAccountSignatureOf<T, I>: Decode,
{
TokenSwapCreation {
target_public_at_bridged_chain: target_public_at_bridged_chain::<T, I>(),
@@ -176,20 +176,22 @@ fn target_balance_to_swap<T: Config<I>, I: 'static>() -> BridgedBalanceOf<T, I>
/// Public key of `target_account_at_bridged_chain`.
fn target_public_at_bridged_chain<T: Config<I>, I: 'static>() -> BridgedAccountPublicOf<T, I>
where
BridgedAccountPublicOf<T, I>: Default,
BridgedAccountPublicOf<T, I>: Decode,
{
Default::default()
BridgedAccountPublicOf::<T, I>::decode(&mut TrailingZeroInput::zeroes())
.expect("failed to decode `BridgedAccountPublicOf` from zeroes")
}
/// Signature of `target_account_at_bridged_chain` over message.
fn bridged_currency_transfer_signature<T: Config<I>, I: 'static>() -> BridgedAccountSignatureOf<T, I>
where
BridgedAccountSignatureOf<T, I>: Default,
BridgedAccountSignatureOf<T, I>: Decode,
{
Default::default()
BridgedAccountSignatureOf::<T, I>::decode(&mut TrailingZeroInput::zeroes())
.expect("failed to decode `BridgedAccountSignatureOf` from zeroes")
}
/// Account at the bridged chain that is participating in the swap.
fn target_account_at_bridged_chain<T: Config<I>, I: 'static>() -> BridgedAccountIdOf<T, I> {
Default::default()
account("target_account_at_bridged_chain", 0, SEED)
}
+1
View File
@@ -179,6 +179,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::hooks]
+1
View File
@@ -91,6 +91,7 @@ impl frame_system::Config for TestRuntime {
type DbWeight = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
frame_support::parameter_types! {