mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
Companion: remove IsCallable make use of introduced in-origin filtering (#1226)
* remove IsCallable make use of in-origin filter * update lock * bump version for runtimes as spec as changed * trigger CI * Revert "trigger CI" This reverts commit 5ac58fd42ac50dfb2fcd41ca866c7f6a605c5112.
This commit is contained in:
committed by
GitHub
parent
c1b329491f
commit
8492e622ae
Generated
+136
-136
File diff suppressed because it is too large
Load Diff
@@ -666,6 +666,7 @@ mod tests {
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||
}
|
||||
impl system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = u64;
|
||||
@@ -794,7 +795,7 @@ mod tests {
|
||||
fn claiming_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
assert_ok!(Claims::claim(Origin::NONE, 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_ok!(Claims::claim(Origin::none(), 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_eq!(Balances::free_balance(&42), 100);
|
||||
assert_eq!(Vesting::vesting_balance(&42), Some(50));
|
||||
assert_eq!(Claims::total(), total_claims() - 100);
|
||||
@@ -807,8 +808,8 @@ mod tests {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
assert_noop!(Claims::move_claim(Origin::signed(1), eth(&alice()), eth(&bob()), None), BadOrigin);
|
||||
assert_ok!(Claims::move_claim(Origin::signed(6), eth(&alice()), eth(&bob()), None));
|
||||
assert_noop!(Claims::claim(Origin::NONE, 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])), Error::<Test>::SignerHasNoClaim);
|
||||
assert_ok!(Claims::claim(Origin::NONE, 42, sig::<Test>(&bob(), &42u64.encode(), &[][..])));
|
||||
assert_noop!(Claims::claim(Origin::none(), 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])), Error::<Test>::SignerHasNoClaim);
|
||||
assert_ok!(Claims::claim(Origin::none(), 42, sig::<Test>(&bob(), &42u64.encode(), &[][..])));
|
||||
assert_eq!(Balances::free_balance(&42), 100);
|
||||
assert_eq!(Vesting::vesting_balance(&42), Some(50));
|
||||
assert_eq!(Claims::total(), total_claims() - 100);
|
||||
@@ -820,7 +821,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(Claims::move_claim(Origin::signed(6), eth(&dave()), eth(&bob()), None));
|
||||
let s = sig::<Test>(&bob(), &42u64.encode(), StatementKind::Regular.to_text());
|
||||
assert_ok!(Claims::claim_attest(Origin::NONE, 42, s, StatementKind::Regular.to_text().to_vec()));
|
||||
assert_ok!(Claims::claim_attest(Origin::none(), 42, s, StatementKind::Regular.to_text().to_vec()));
|
||||
assert_eq!(Balances::free_balance(&42), 200);
|
||||
});
|
||||
}
|
||||
@@ -837,16 +838,16 @@ mod tests {
|
||||
#[test]
|
||||
fn claiming_does_not_bypass_signing() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(Claims::claim(Origin::NONE, 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_ok!(Claims::claim(Origin::none(), 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 42, sig::<Test>(&dave(), &42u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 42, sig::<Test>(&dave(), &42u64.encode(), &[][..])),
|
||||
Error::<Test>::InvalidStatement,
|
||||
);
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 42, sig::<Test>(&eve(), &42u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 42, sig::<Test>(&eve(), &42u64.encode(), &[][..])),
|
||||
Error::<Test>::InvalidStatement,
|
||||
);
|
||||
assert_ok!(Claims::claim(Origin::NONE, 42, sig::<Test>(&frank(), &42u64.encode(), &[][..])));
|
||||
assert_ok!(Claims::claim(Origin::none(), 42, sig::<Test>(&frank(), &42u64.encode(), &[][..])));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -855,21 +856,21 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
let s = sig::<Test>(&dave(), &42u64.encode(), StatementKind::Saft.to_text());
|
||||
let r = Claims::claim_attest(Origin::NONE, 42, s.clone(), StatementKind::Saft.to_text().to_vec());
|
||||
let r = Claims::claim_attest(Origin::none(), 42, s.clone(), StatementKind::Saft.to_text().to_vec());
|
||||
assert_noop!(r, Error::<Test>::InvalidStatement);
|
||||
|
||||
let r = Claims::claim_attest(Origin::NONE, 42, s, StatementKind::Regular.to_text().to_vec());
|
||||
let r = Claims::claim_attest(Origin::none(), 42, s, StatementKind::Regular.to_text().to_vec());
|
||||
assert_noop!(r, Error::<Test>::SignerHasNoClaim);
|
||||
// ^^^ we use ecdsa_recover, so an invalid signature just results in a random signer id
|
||||
// being recovered, which realistically will never have a claim.
|
||||
|
||||
let s = sig::<Test>(&dave(), &42u64.encode(), StatementKind::Regular.to_text());
|
||||
assert_ok!(Claims::claim_attest(Origin::NONE, 42, s, StatementKind::Regular.to_text().to_vec()));
|
||||
assert_ok!(Claims::claim_attest(Origin::none(), 42, s, StatementKind::Regular.to_text().to_vec()));
|
||||
assert_eq!(Balances::free_balance(&42), 200);
|
||||
assert_eq!(Claims::total(), total_claims() - 200);
|
||||
|
||||
let s = sig::<Test>(&dave(), &42u64.encode(), StatementKind::Regular.to_text());
|
||||
let r = Claims::claim_attest(Origin::NONE, 42, s, StatementKind::Regular.to_text().to_vec());
|
||||
let r = Claims::claim_attest(Origin::none(), 42, s, StatementKind::Regular.to_text().to_vec());
|
||||
assert_noop!(r, Error::<Test>::SignerHasNoClaim);
|
||||
});
|
||||
}
|
||||
@@ -891,7 +892,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
// Alice's claim is 100
|
||||
assert_ok!(Claims::claim(Origin::NONE, 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_ok!(Claims::claim(Origin::none(), 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_eq!(Balances::free_balance(&42), 100);
|
||||
// Eve's claim is 300 through Account 42
|
||||
assert_ok!(Claims::attest(Origin::signed(42), StatementKind::Saft.to_text().to_vec()));
|
||||
@@ -932,7 +933,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
let s = sig::<Test>(&dave(), &42u64.encode(), &[]);
|
||||
let r = Claims::claim(Origin::NONE, 42, s.clone());
|
||||
let r = Claims::claim(Origin::none(), 42, s.clone());
|
||||
assert_noop!(r, Error::<Test>::InvalidStatement);
|
||||
});
|
||||
}
|
||||
@@ -946,12 +947,12 @@ mod tests {
|
||||
);
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Error::<Test>::SignerHasNoClaim,
|
||||
);
|
||||
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, None, None));
|
||||
assert_ok!(Claims::mint_claim(Origin::root(), eth(&bob()), 200, None, None));
|
||||
assert_eq!(Claims::total(), total_claims() + 200);
|
||||
assert_ok!(Claims::claim(Origin::NONE, 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])));
|
||||
assert_ok!(Claims::claim(Origin::none(), 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])));
|
||||
assert_eq!(Balances::free_balance(&69), 200);
|
||||
assert_eq!(Vesting::vesting_balance(&69), None);
|
||||
assert_eq!(Claims::total(), total_claims());
|
||||
@@ -967,11 +968,11 @@ mod tests {
|
||||
);
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Error::<Test>::SignerHasNoClaim,
|
||||
);
|
||||
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, Some((50, 10, 1)), None));
|
||||
assert_ok!(Claims::claim(Origin::NONE, 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])));
|
||||
assert_ok!(Claims::mint_claim(Origin::root(), eth(&bob()), 200, Some((50, 10, 1)), None));
|
||||
assert_ok!(Claims::claim(Origin::none(), 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])));
|
||||
assert_eq!(Balances::free_balance(&69), 200);
|
||||
assert_eq!(Vesting::vesting_balance(&69), Some(50));
|
||||
|
||||
@@ -994,20 +995,20 @@ mod tests {
|
||||
let signature = sig::<Test>(&bob(), &69u64.encode(), StatementKind::Regular.to_text());
|
||||
assert_noop!(
|
||||
Claims::claim_attest(
|
||||
Origin::NONE, 69, signature.clone(), StatementKind::Regular.to_text().to_vec()
|
||||
Origin::none(), 69, signature.clone(), StatementKind::Regular.to_text().to_vec()
|
||||
),
|
||||
Error::<Test>::SignerHasNoClaim
|
||||
);
|
||||
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, None, Some(StatementKind::Regular)));
|
||||
assert_ok!(Claims::mint_claim(Origin::root(), eth(&bob()), 200, None, Some(StatementKind::Regular)));
|
||||
assert_noop!(
|
||||
Claims::claim_attest(
|
||||
Origin::NONE, 69, signature.clone(), vec![],
|
||||
Origin::none(), 69, signature.clone(), vec![],
|
||||
),
|
||||
Error::<Test>::SignerHasNoClaim
|
||||
);
|
||||
assert_ok!(
|
||||
Claims::claim_attest(
|
||||
Origin::NONE, 69, signature.clone(), StatementKind::Regular.to_text().to_vec()
|
||||
Origin::none(), 69, signature.clone(), StatementKind::Regular.to_text().to_vec()
|
||||
)
|
||||
);
|
||||
assert_eq!(Balances::free_balance(&69), 200);
|
||||
@@ -1029,9 +1030,9 @@ mod tests {
|
||||
fn double_claiming_doesnt_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
assert_ok!(Claims::claim(Origin::NONE, 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_ok!(Claims::claim(Origin::none(), 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])));
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 42, sig::<Test>(&alice(), &42u64.encode(), &[][..])),
|
||||
Error::<Test>::SignerHasNoClaim
|
||||
);
|
||||
});
|
||||
@@ -1044,13 +1045,13 @@ mod tests {
|
||||
assert_ok!(<Test as Trait>::VestingSchedule::add_vesting_schedule(&69, total_claims(), 100, 10));
|
||||
CurrencyOf::<Test>::make_free_balance_be(&69, total_claims());
|
||||
assert_eq!(Balances::free_balance(69), total_claims());
|
||||
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, Some((50, 10, 1)), None));
|
||||
assert_ok!(Claims::mint_claim(Origin::root(), eth(&bob()), 200, Some((50, 10, 1)), None));
|
||||
// New total
|
||||
assert_eq!(Claims::total(), total_claims() + 200);
|
||||
|
||||
// They should not be able to claim
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 69, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Error::<Test>::VestedBalanceExists,
|
||||
);
|
||||
});
|
||||
@@ -1061,7 +1062,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 42, sig::<Test>(&alice(), &69u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 42, sig::<Test>(&alice(), &69u64.encode(), &[][..])),
|
||||
Error::<Test>::SignerHasNoClaim
|
||||
);
|
||||
});
|
||||
@@ -1072,7 +1073,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Balances::free_balance(42), 0);
|
||||
assert_noop!(
|
||||
Claims::claim(Origin::NONE, 42, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Claims::claim(Origin::none(), 42, sig::<Test>(&bob(), &69u64.encode(), &[][..])),
|
||||
Error::<Test>::SignerHasNoClaim
|
||||
);
|
||||
});
|
||||
|
||||
@@ -593,6 +593,7 @@ mod tests {
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||
}
|
||||
impl system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = ();
|
||||
type Index = u64;
|
||||
@@ -985,7 +986,7 @@ mod tests {
|
||||
fn onboard_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
assert_eq!(Balances::free_balance(1), 999);
|
||||
|
||||
@@ -1021,7 +1022,7 @@ mod tests {
|
||||
fn onboard_handles_basic_errors() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
assert_eq!(Balances::free_balance(1), 999);
|
||||
|
||||
@@ -1059,7 +1060,7 @@ mod tests {
|
||||
fn begin_retirement_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
assert_eq!(Balances::free_balance(1), 999);
|
||||
|
||||
@@ -1102,7 +1103,7 @@ mod tests {
|
||||
fn begin_retirement_handles_basic_errors() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
assert_eq!(Balances::free_balance(1), 999);
|
||||
|
||||
@@ -1147,7 +1148,7 @@ mod tests {
|
||||
fn withdraw_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
// Transfer fee is taken here
|
||||
assert_ok!(Crowdfund::contribute(Origin::signed(1), 0, 100));
|
||||
@@ -1173,7 +1174,7 @@ mod tests {
|
||||
fn withdraw_handles_basic_errors() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
// Transfer fee is taken here
|
||||
assert_ok!(Crowdfund::contribute(Origin::signed(1), 0, 49));
|
||||
@@ -1197,7 +1198,7 @@ mod tests {
|
||||
fn dissolve_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
// Transfer fee is taken here
|
||||
assert_ok!(Crowdfund::contribute(Origin::signed(1), 0, 100));
|
||||
@@ -1234,7 +1235,7 @@ mod tests {
|
||||
fn dissolve_handles_basic_errors() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Set up a crowdfund
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 9));
|
||||
// Transfer fee is taken here
|
||||
assert_ok!(Crowdfund::contribute(Origin::signed(1), 0, 100));
|
||||
@@ -1276,7 +1277,7 @@ mod tests {
|
||||
// Some blocks later...
|
||||
run_to_block(2);
|
||||
// Create an auction
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
// Add deploy data
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
@@ -1306,7 +1307,7 @@ mod tests {
|
||||
fn fund_across_multiple_auctions_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Create an auction
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
// Create two competing crowdfunds, with end dates across multiple auctions
|
||||
// Each crowdfund is competing for the same slots, so only one can win
|
||||
assert_ok!(Crowdfund::create(Origin::signed(1), 1000, 1, 4, 30));
|
||||
@@ -1344,7 +1345,7 @@ mod tests {
|
||||
assert_eq!(Slots::managed_ids(), vec![0.into()]);
|
||||
|
||||
// Create a second auction
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
// Contribute to existing funds add to NewRaise
|
||||
assert_ok!(Crowdfund::contribute(Origin::signed(1), 1, 10));
|
||||
|
||||
|
||||
@@ -27,15 +27,10 @@ pub mod slots;
|
||||
pub mod crowdfund;
|
||||
pub mod impls;
|
||||
|
||||
use sp_std::marker::PhantomData;
|
||||
use codec::{Encode, Decode};
|
||||
use primitives::{BlockNumber, AccountId, ValidityError};
|
||||
use sp_runtime::{
|
||||
Perbill, traits::{Saturating, SignedExtension, DispatchInfoOf},
|
||||
transaction_validity::{TransactionValidityError, TransactionValidity, InvalidTransaction}
|
||||
};
|
||||
use primitives::BlockNumber;
|
||||
use sp_runtime::{Perbill, traits::Saturating};
|
||||
use frame_support::{
|
||||
parameter_types, traits::{Currency, Filter},
|
||||
parameter_types, traits::{Currency},
|
||||
weights::{Weight, constants::WEIGHT_PER_SECOND},
|
||||
};
|
||||
use static_assertions::const_assert;
|
||||
@@ -52,7 +47,6 @@ pub use parachains::Call as ParachainsCall;
|
||||
|
||||
/// Implementations of some helper traits passed into runtime modules as associated types.
|
||||
pub use impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor};
|
||||
use sp_runtime::traits::Dispatchable;
|
||||
|
||||
pub type NegativeImbalance<T> = <balances::Module<T> as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
|
||||
|
||||
@@ -67,66 +61,3 @@ parameter_types! {
|
||||
}
|
||||
|
||||
const_assert!(AvailableBlockRatio::get().deconstruct() >= AVERAGE_ON_INITIALIZE_WEIGHT.deconstruct());
|
||||
|
||||
/// Apply a given filter to transactions.
|
||||
pub struct TransactionCallFilter<T: Filter<Call>, Call>(PhantomData<(T, Call)>);
|
||||
|
||||
impl<F: Filter<Call>, Call> Default for TransactionCallFilter<F, Call> {
|
||||
fn default() -> Self { Self::new() }
|
||||
}
|
||||
impl<F: Filter<Call>, Call> Encode for TransactionCallFilter<F, Call> {
|
||||
fn using_encoded<R, FO: FnOnce(&[u8]) -> R>(&self, f: FO) -> R { f(&b""[..]) }
|
||||
}
|
||||
impl<F: Filter<Call>, Call> Decode for TransactionCallFilter<F, Call> {
|
||||
fn decode<I: codec::Input>(_: &mut I) -> Result<Self, codec::Error> { Ok(Self::new()) }
|
||||
}
|
||||
impl<F: Filter<Call>, Call> Clone for TransactionCallFilter<F, Call> {
|
||||
fn clone(&self) -> Self { Self::new() }
|
||||
}
|
||||
impl<F: Filter<Call>, Call> Eq for TransactionCallFilter<F, Call> {}
|
||||
impl<F: Filter<Call>, Call> PartialEq for TransactionCallFilter<F, Call> {
|
||||
fn eq(&self, _: &Self) -> bool { true }
|
||||
}
|
||||
impl<F: Filter<Call>, Call> sp_std::fmt::Debug for TransactionCallFilter<F, Call> {
|
||||
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) }
|
||||
}
|
||||
|
||||
fn validate<F: Filter<Call>, Call>(call: &Call) -> TransactionValidity {
|
||||
if F::filter(call) {
|
||||
Ok(Default::default())
|
||||
} else {
|
||||
Err(InvalidTransaction::Custom(ValidityError::NoPermission.into()).into())
|
||||
}
|
||||
}
|
||||
|
||||
impl<F: Filter<Call> + Send + Sync, Call: Dispatchable + Send + Sync>
|
||||
SignedExtension for TransactionCallFilter<F, Call>
|
||||
{
|
||||
const IDENTIFIER: &'static str = "TransactionCallFilter";
|
||||
type AccountId = AccountId;
|
||||
type Call = Call;
|
||||
type AdditionalSigned = ();
|
||||
type Pre = ();
|
||||
|
||||
fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { Ok(()) }
|
||||
|
||||
fn validate(&self,
|
||||
_: &Self::AccountId,
|
||||
call: &Call,
|
||||
_: &DispatchInfoOf<Self::Call>,
|
||||
_: usize,
|
||||
) -> TransactionValidity { validate::<F, _>(call) }
|
||||
|
||||
fn validate_unsigned(
|
||||
call: &Self::Call,
|
||||
_info: &DispatchInfoOf<Self::Call>,
|
||||
_len: usize,
|
||||
) -> TransactionValidity { validate::<F, _>(call) }
|
||||
}
|
||||
|
||||
impl<F: Filter<Call>, Call> TransactionCallFilter<F, Call> {
|
||||
/// Create a new instance.
|
||||
pub fn new() -> Self {
|
||||
Self(sp_std::marker::PhantomData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1609,6 +1609,7 @@ mod tests {
|
||||
}
|
||||
|
||||
impl system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = u64;
|
||||
@@ -2142,7 +2143,7 @@ mod tests {
|
||||
if System::block_number() > 1 {
|
||||
println!("Finalizing {}", System::block_number());
|
||||
if !DidUpdate::get().is_some() {
|
||||
Parachains::set_heads(Origin::NONE, vec![]).unwrap();
|
||||
Parachains::set_heads(Origin::none(), vec![]).unwrap();
|
||||
}
|
||||
|
||||
Parachains::on_finalize(System::block_number());
|
||||
@@ -2423,10 +2424,7 @@ mod tests {
|
||||
];
|
||||
candidates.iter_mut().for_each(make_attestations);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(candidates),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(candidates)).dispatch(Origin::none()));
|
||||
|
||||
assert!(<RelayDispatchQueue>::get(ParaId::from(0)).is_empty());
|
||||
assert!(<RelayDispatchQueue>::get(ParaId::from(1)).is_empty());
|
||||
@@ -2463,21 +2461,21 @@ mod tests {
|
||||
assert_eq!(Parachains::parachain_code(ParaId::from(100u32)), Some(vec![4,5,6].into()));
|
||||
|
||||
assert_ok!(Registrar::register_para(
|
||||
Origin::ROOT,
|
||||
Origin::root(),
|
||||
99u32.into(),
|
||||
ParaInfo{scheduling: Scheduling::Always},
|
||||
vec![7,8,9].into(),
|
||||
vec![1, 1, 1].into(),
|
||||
));
|
||||
assert_ok!(Parachains::set_heads(Origin::NONE, vec![]));
|
||||
assert_ok!(Parachains::set_heads(Origin::none(), vec![]));
|
||||
|
||||
run_to_block(3);
|
||||
|
||||
assert_eq!(Parachains::active_parachains(), vec![(5u32.into(), None), (99u32.into(), None), (100u32.into(), None)]);
|
||||
assert_eq!(Parachains::parachain_code(&ParaId::from(99u32)), Some(vec![7,8,9].into()));
|
||||
|
||||
assert_ok!(Registrar::deregister_para(Origin::ROOT, 5u32.into()));
|
||||
assert_ok!(Parachains::set_heads(Origin::NONE, vec![]));
|
||||
assert_ok!(Registrar::deregister_para(Origin::root(), 5u32.into()));
|
||||
assert_ok!(Parachains::set_heads(Origin::none(), vec![]));
|
||||
|
||||
// parachain still active this block. another block must pass before it's inactive.
|
||||
run_to_block(4);
|
||||
@@ -2533,7 +2531,7 @@ mod tests {
|
||||
new_test_ext(parachains.clone()).execute_with(|| {
|
||||
run_to_block(2);
|
||||
let candidate = make_blank_attested(raw_candidate(0.into()));
|
||||
assert!(Parachains::dispatch(set_heads(vec![candidate]), Origin::NONE).is_err());
|
||||
assert!(Call::from(set_heads(vec![candidate])).dispatch(Origin::none()).is_err());
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2554,15 +2552,11 @@ mod tests {
|
||||
make_attestations(&mut candidate_a);
|
||||
make_attestations(&mut candidate_b);
|
||||
|
||||
assert!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_b.clone(), candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
).is_err());
|
||||
assert!(Call::from(set_heads(vec![candidate_b.clone(), candidate_a.clone()]))
|
||||
.dispatch(Origin::none()).is_err());
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone(), candidate_b.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone(), candidate_b.clone()]))
|
||||
.dispatch(Origin::none()));
|
||||
|
||||
assert_eq!(Heads::get(&ParaId::from(0)), Some(candidate_a.candidate.head_data));
|
||||
assert_eq!(Heads::get(&ParaId::from(1)), Some(candidate_b.candidate.head_data));
|
||||
@@ -2586,10 +2580,7 @@ mod tests {
|
||||
double_validity.validity_votes.push(candidate.validity_votes[0].clone());
|
||||
double_validity.validator_indices.push(true);
|
||||
|
||||
assert!(Parachains::dispatch(
|
||||
set_heads(vec![double_validity]),
|
||||
Origin::NONE,
|
||||
).is_err());
|
||||
assert!(Call::from(set_heads(vec![double_validity])).dispatch(Origin::none()).is_err());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2610,10 +2601,7 @@ mod tests {
|
||||
assert!(candidate.validator_indices.pop().is_some());
|
||||
candidate.validator_indices.append(&mut bitvec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
|
||||
|
||||
assert!(Parachains::dispatch(
|
||||
set_heads(vec![candidate]),
|
||||
Origin::NONE,
|
||||
).is_err());
|
||||
assert!(Call::from(set_heads(vec![candidate])).dispatch(Origin::none()).is_err());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2774,10 +2762,7 @@ mod tests {
|
||||
assert_eq!(applied_after, 1 + ValidationUpgradeDelay::get());
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()));
|
||||
|
||||
assert!(Parachains::past_code_meta(¶_id).most_recent_change().is_none());
|
||||
assert_eq!(Parachains::code_upgrade_schedule(¶_id), Some(applied_after));
|
||||
@@ -2798,10 +2783,7 @@ mod tests {
|
||||
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()));
|
||||
|
||||
assert!(Parachains::past_code_meta(¶_id).most_recent_change().is_none());
|
||||
assert_eq!(Parachains::code_upgrade_schedule(¶_id), Some(applied_after));
|
||||
@@ -2820,10 +2802,7 @@ mod tests {
|
||||
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()));
|
||||
|
||||
assert_eq!(
|
||||
Parachains::past_code_meta(¶_id).most_recent_change(),
|
||||
@@ -2865,10 +2844,7 @@ mod tests {
|
||||
assert_eq!(applied_after, 1 + ValidationUpgradeDelay::get());
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()));
|
||||
|
||||
assert!(Parachains::past_code_meta(¶_id).most_recent_change().is_none());
|
||||
assert_eq!(Parachains::code_upgrade_schedule(¶_id), Some(applied_after));
|
||||
@@ -2887,10 +2863,7 @@ mod tests {
|
||||
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()));
|
||||
|
||||
assert_eq!(
|
||||
Parachains::past_code_meta(¶_id).most_recent_change(),
|
||||
@@ -2927,10 +2900,7 @@ mod tests {
|
||||
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()));
|
||||
};
|
||||
|
||||
run_to_block(3);
|
||||
@@ -2944,10 +2914,7 @@ mod tests {
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_err!(
|
||||
Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
),
|
||||
Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()),
|
||||
Error::<Test>::DisallowedCodeUpgrade,
|
||||
);
|
||||
}
|
||||
@@ -2976,10 +2943,7 @@ mod tests {
|
||||
assert_eq!(applied_after, 1 + ValidationUpgradeDelay::get());
|
||||
make_attestations(&mut candidate_a);
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
set_heads(vec![candidate_a.clone()]),
|
||||
Origin::NONE,
|
||||
));
|
||||
assert_ok!(Call::from(set_heads(vec![candidate_a.clone()])).dispatch(Origin::none()));
|
||||
|
||||
assert!(Parachains::past_code_meta(¶_id).most_recent_change().is_none());
|
||||
assert_eq!(Parachains::code_upgrade_schedule(¶_id), Some(applied_after));
|
||||
@@ -3077,7 +3041,7 @@ mod tests {
|
||||
|
||||
let inner = report_double_vote(report).unwrap();
|
||||
|
||||
assert_ok!(Parachains::dispatch(inner, Origin::signed(1)));
|
||||
assert_ok!(Call::from(inner).dispatch(Origin::signed(1)));
|
||||
|
||||
start_era(2);
|
||||
|
||||
@@ -3170,10 +3134,7 @@ mod tests {
|
||||
signing_context,
|
||||
};
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
report_double_vote(report).unwrap(),
|
||||
Origin::signed(1),
|
||||
));
|
||||
assert_ok!(Call::from(report_double_vote(report).unwrap()).dispatch(Origin::signed(1)));
|
||||
|
||||
start_era(2);
|
||||
|
||||
@@ -3267,10 +3228,7 @@ mod tests {
|
||||
signing_context,
|
||||
};
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
report_double_vote(report).unwrap(),
|
||||
Origin::signed(1),
|
||||
));
|
||||
assert_ok!(Call::from(report_double_vote(report).unwrap()).dispatch(Origin::signed(1)));
|
||||
|
||||
start_era(2);
|
||||
|
||||
@@ -3367,15 +3325,9 @@ mod tests {
|
||||
signing_context,
|
||||
};
|
||||
|
||||
assert_ok!(Parachains::dispatch(
|
||||
report_double_vote(report.clone()).unwrap(),
|
||||
Origin::signed(1),
|
||||
));
|
||||
assert_ok!(Call::from(report_double_vote(report.clone()).unwrap()).dispatch(Origin::signed(1)));
|
||||
|
||||
assert!(Parachains::dispatch(
|
||||
report_double_vote(report).unwrap(),
|
||||
Origin::signed(1),
|
||||
).is_err()
|
||||
assert!(Call::from(report_double_vote(report).unwrap()).dispatch(Origin::signed(1)).is_err()
|
||||
);
|
||||
|
||||
start_era(2);
|
||||
|
||||
@@ -723,6 +723,7 @@ mod tests {
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||
}
|
||||
impl system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = u64;
|
||||
@@ -1133,7 +1134,7 @@ mod tests {
|
||||
#[test]
|
||||
fn swap_chain_and_thread_works() {
|
||||
new_test_ext(vec![]).execute_with(|| {
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 1));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 1));
|
||||
|
||||
// Need to trigger on_initialize
|
||||
run_to_block(2);
|
||||
@@ -1146,7 +1147,7 @@ mod tests {
|
||||
));
|
||||
|
||||
// Lease out a new parachain
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 4, 1));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1212,7 +1213,7 @@ mod tests {
|
||||
#[test]
|
||||
fn swap_handles_funds_correctly() {
|
||||
new_test_ext(vec![]).execute_with(|| {
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 1));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 1));
|
||||
|
||||
// Need to trigger on_initialize
|
||||
run_to_block(2);
|
||||
@@ -1228,7 +1229,7 @@ mod tests {
|
||||
));
|
||||
|
||||
// User 2 leases out a new parachain
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(2), 0, 1, 1, 4, 1));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1269,7 +1270,7 @@ mod tests {
|
||||
|
||||
// Register a new parachain
|
||||
assert_ok!(Registrar::register_para(
|
||||
Origin::ROOT,
|
||||
Origin::root(),
|
||||
2u32.into(),
|
||||
ParaInfo { scheduling: Scheduling::Always },
|
||||
vec![2; 3].into(),
|
||||
@@ -1302,7 +1303,7 @@ mod tests {
|
||||
assert_eq!(Parachains::parachain_code(&ParaId::from(2u32)), Some(vec![2; 3].into()));
|
||||
assert_eq!(Parachains::parachain_code(&user_id(0)), Some(vec![3; 3].into()));
|
||||
|
||||
assert_ok!(Registrar::deregister_para(Origin::ROOT, 2u32.into()));
|
||||
assert_ok!(Registrar::deregister_para(Origin::root(), 2u32.into()));
|
||||
assert_ok!(Registrar::deregister_parathread(
|
||||
parachains::Origin::Parachain(user_id(0)).into()
|
||||
));
|
||||
@@ -1323,7 +1324,7 @@ mod tests {
|
||||
#[test]
|
||||
fn parathread_scheduling_works() {
|
||||
new_test_ext(vec![]).execute_with(|| {
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 1));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 1));
|
||||
|
||||
run_to_block(2);
|
||||
|
||||
@@ -1344,7 +1345,7 @@ mod tests {
|
||||
assert_eq!(Registrar::active_paras(), vec![
|
||||
(user_id(0), Some((col.clone(), Retriable::WithRetries(0))))
|
||||
]);
|
||||
assert_ok!(Parachains::set_heads(Origin::NONE, vec![
|
||||
assert_ok!(Parachains::set_heads(Origin::none(), vec![
|
||||
attest(user_id(0), &Sr25519Keyring::One.pair().into(), &[3; 3], &[0; 0])
|
||||
]));
|
||||
|
||||
@@ -1357,7 +1358,7 @@ mod tests {
|
||||
#[test]
|
||||
fn removing_scheduled_parathread_works() {
|
||||
new_test_ext(vec![]).execute_with(|| {
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 1));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 1));
|
||||
|
||||
run_to_block(2);
|
||||
|
||||
@@ -1400,7 +1401,7 @@ mod tests {
|
||||
#[test]
|
||||
fn parathread_rescheduling_works() {
|
||||
new_test_ext(vec![]).execute_with(|| {
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 1));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 1));
|
||||
|
||||
run_to_block(2);
|
||||
|
||||
@@ -1428,7 +1429,7 @@ mod tests {
|
||||
assert_eq!(Registrar::active_paras(), vec![]);
|
||||
|
||||
// schedule and miss all 3 and check that they go through the queueing system ok.
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 2));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 2));
|
||||
schedule_thread(user_id(0), &[3; 3], &col);
|
||||
schedule_thread(user_id(1), &[4; 3], &col);
|
||||
|
||||
@@ -1498,7 +1499,7 @@ mod tests {
|
||||
let info = &DispatchInfo::default();
|
||||
|
||||
// Allow for threads
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 10));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 10));
|
||||
|
||||
// Bad parathread id
|
||||
let col = CollatorId::default();
|
||||
@@ -1551,7 +1552,7 @@ mod tests {
|
||||
}
|
||||
|
||||
// Only 3 slots available... who will win??
|
||||
assert_ok!(Registrar::set_thread_count(Origin::ROOT, 3));
|
||||
assert_ok!(Registrar::set_thread_count(Origin::root(), 3));
|
||||
|
||||
// Everyone wants a thread
|
||||
for x in 0..5 {
|
||||
|
||||
@@ -909,6 +909,7 @@ mod tests {
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||
}
|
||||
impl system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = ();
|
||||
type Index = u64;
|
||||
@@ -1072,7 +1073,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
|
||||
assert_eq!(Slots::auction_counter(), 1);
|
||||
assert_eq!(Slots::is_in_progress(), true);
|
||||
@@ -1085,7 +1086,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
|
||||
assert_eq!(Slots::auction_counter(), 1);
|
||||
assert_eq!(Slots::is_in_progress(), true);
|
||||
@@ -1130,7 +1131,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 4, 1));
|
||||
assert_eq!(Balances::reserved_balance(1), 1);
|
||||
assert_eq!(Balances::free_balance(1), 9);
|
||||
@@ -1150,7 +1151,7 @@ mod tests {
|
||||
fn offboarding_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 4, 1));
|
||||
assert_eq!(Balances::free_balance(1), 9);
|
||||
|
||||
@@ -1168,7 +1169,7 @@ mod tests {
|
||||
fn set_offboarding_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 4, 1));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1189,7 +1190,7 @@ mod tests {
|
||||
fn onboarding_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 4, 1));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1209,7 +1210,7 @@ mod tests {
|
||||
fn late_onboarding_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 4, 1));
|
||||
|
||||
run_to_block(10);
|
||||
@@ -1232,7 +1233,7 @@ mod tests {
|
||||
fn under_bidding_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 4, 5));
|
||||
assert_ok!(Slots::bid(Origin::signed(2), 0, 1, 1, 4, 1));
|
||||
assert_eq!(Balances::reserved_balance(2), 0);
|
||||
@@ -1248,7 +1249,7 @@ mod tests {
|
||||
fn should_choose_best_combination() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(2), 0, 1, 2, 3, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(3), 0, 1, 4, 4, 2));
|
||||
@@ -1276,7 +1277,7 @@ mod tests {
|
||||
fn independent_bids_should_fail() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 1, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 1, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 2, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 2, 4, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 2, 2, 1));
|
||||
@@ -1291,13 +1292,13 @@ mod tests {
|
||||
fn multiple_onboards_offboards_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 1, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 1, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(2), 0, 1, 2, 3, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(3), 0, 1, 4, 4, 1));
|
||||
|
||||
run_to_block(5);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 1, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 1, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(4), 1, 2, 1, 2, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(5), 1, 2, 3, 4, 1));
|
||||
|
||||
@@ -1368,7 +1369,7 @@ mod tests {
|
||||
fn extensions_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 1));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1379,7 +1380,7 @@ mod tests {
|
||||
assert_ok!(Slots::fix_deploy_data(Origin::signed(1), 0, 0.into(), h, 1, vec![1].into()));
|
||||
assert_ok!(Slots::elaborate_deploy_data(Origin::signed(0), 0.into(), vec![1].into()));
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 2));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 2));
|
||||
assert_ok!(Slots::bid_renew(Origin::signed(ParaId::from(0).into_account()), 2, 2, 2, 1));
|
||||
|
||||
with_parachains(|p| {
|
||||
@@ -1392,7 +1393,7 @@ mod tests {
|
||||
assert_eq!(p.len(), 1);
|
||||
assert_eq!(p[&0], (vec![1].into(), vec![1].into()));
|
||||
});
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 2));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 2));
|
||||
assert_ok!(Balances::transfer(Origin::signed(1), ParaId::from(0).into_account(), 1));
|
||||
assert_ok!(Slots::bid_renew(Origin::signed(ParaId::from(0).into_account()), 3, 3, 3, 2));
|
||||
|
||||
@@ -1413,7 +1414,7 @@ mod tests {
|
||||
fn renewal_with_lower_value_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 5));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1424,13 +1425,13 @@ mod tests {
|
||||
assert_ok!(Slots::fix_deploy_data(Origin::signed(1), 0, 0.into(), h, 1, vec![1].into()));
|
||||
assert_ok!(Slots::elaborate_deploy_data(Origin::signed(0), 0.into(), vec![1].into()));
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 2));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 2));
|
||||
assert_ok!(Slots::bid_renew(Origin::signed(ParaId::from(0).into_account()), 2, 2, 2, 3));
|
||||
|
||||
run_to_block(20);
|
||||
assert_eq!(Balances::free_balance(&ParaId::from(0u32).into_account()), 2);
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 2));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 2));
|
||||
assert_ok!(Slots::bid_renew(Origin::signed(ParaId::from(0).into_account()), 3, 3, 3, 4));
|
||||
|
||||
run_to_block(30);
|
||||
@@ -1443,7 +1444,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 4, 4, 5));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1464,7 +1465,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
|
||||
for i in 1..6u64 {
|
||||
run_to_block(i as _);
|
||||
@@ -1492,7 +1493,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
|
||||
for i in 1..6u64 {
|
||||
run_to_block((i + 3) as _);
|
||||
@@ -1615,7 +1616,7 @@ mod tests {
|
||||
fn deploy_code_too_large() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 5));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1638,7 +1639,7 @@ mod tests {
|
||||
fn deploy_maximum_ok() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 5));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1659,7 +1660,7 @@ mod tests {
|
||||
fn deploy_head_data_too_large() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 5));
|
||||
|
||||
run_to_block(9);
|
||||
@@ -1683,7 +1684,7 @@ mod tests {
|
||||
fn code_size_must_be_correct() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(1);
|
||||
assert_ok!(Slots::new_auction(Origin::ROOT, 5, 1));
|
||||
assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
|
||||
assert_ok!(Slots::bid(Origin::signed(1), 0, 1, 1, 1, 5));
|
||||
|
||||
run_to_block(9);
|
||||
|
||||
@@ -31,7 +31,7 @@ use runtime_common::{attestations, claims, parachains, registrar, slots,
|
||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
||||
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight,
|
||||
MaximumExtrinsicWeight, TransactionCallFilter,
|
||||
MaximumExtrinsicWeight,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys, ModuleId,
|
||||
@@ -85,7 +85,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: create_runtime_str!("kusama"),
|
||||
impl_name: create_runtime_str!("parity-kusama"),
|
||||
authoring_version: 2,
|
||||
spec_version: 2008,
|
||||
spec_version: 2009,
|
||||
impl_version: 0,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
transaction_version: 1,
|
||||
@@ -107,8 +107,6 @@ impl Filter<Call> for BaseFilter {
|
||||
!matches!(call, Call::Slots(_) | Call::Registrar(_))
|
||||
}
|
||||
}
|
||||
pub struct IsCallable;
|
||||
frame_support::impl_filter_stack!(IsCallable, BaseFilter, Call, is_callable);
|
||||
|
||||
type MoreThanHalfCouncil = EnsureOneOf<
|
||||
AccountId,
|
||||
@@ -121,6 +119,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl system::Trait for Runtime {
|
||||
type BaseCallFilter = BaseFilter;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = Nonce;
|
||||
@@ -610,7 +609,6 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
TransactionCallFilter::<IsCallable, Call>::new(),
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
@@ -713,7 +711,6 @@ impl identity::Trait for Runtime {
|
||||
impl utility::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type IsCallable = IsCallable;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -731,7 +728,6 @@ impl multisig::Trait for Runtime {
|
||||
type DepositBase = DepositBase;
|
||||
type DepositFactor = DepositFactor;
|
||||
type MaxSignatories = MaxSignatories;
|
||||
type IsCallable = IsCallable;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -842,7 +838,6 @@ impl proxy::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type Currency = Balances;
|
||||
type IsCallable = IsCallable;
|
||||
type ProxyType = ProxyType;
|
||||
type ProxyDepositBase = ProxyDepositBase;
|
||||
type ProxyDepositFactor = ProxyDepositFactor;
|
||||
@@ -934,7 +929,6 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
TransactionCallFilter<IsCallable, Call>,
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
|
||||
@@ -275,37 +275,37 @@ mod tests {
|
||||
assert!(<Configuration as Store>::PendingConfig::get().is_none());
|
||||
|
||||
Configuration::set_validation_upgrade_frequency(
|
||||
Origin::ROOT, new_config.validation_upgrade_frequency,
|
||||
Origin::root(), new_config.validation_upgrade_frequency,
|
||||
).unwrap();
|
||||
Configuration::set_validation_upgrade_delay(
|
||||
Origin::ROOT, new_config.validation_upgrade_delay,
|
||||
Origin::root(), new_config.validation_upgrade_delay,
|
||||
).unwrap();
|
||||
Configuration::set_acceptance_period(
|
||||
Origin::ROOT, new_config.acceptance_period,
|
||||
Origin::root(), new_config.acceptance_period,
|
||||
).unwrap();
|
||||
Configuration::set_max_code_size(
|
||||
Origin::ROOT, new_config.max_code_size,
|
||||
Origin::root(), new_config.max_code_size,
|
||||
).unwrap();
|
||||
Configuration::set_max_head_data_size(
|
||||
Origin::ROOT, new_config.max_head_data_size,
|
||||
Origin::root(), new_config.max_head_data_size,
|
||||
).unwrap();
|
||||
Configuration::set_parathread_cores(
|
||||
Origin::ROOT, new_config.parathread_cores,
|
||||
Origin::root(), new_config.parathread_cores,
|
||||
).unwrap();
|
||||
Configuration::set_parathread_retries(
|
||||
Origin::ROOT, new_config.parathread_retries,
|
||||
Origin::root(), new_config.parathread_retries,
|
||||
).unwrap();
|
||||
Configuration::set_parachain_rotation_frequency(
|
||||
Origin::ROOT, new_config.parachain_rotation_frequency,
|
||||
Origin::root(), new_config.parachain_rotation_frequency,
|
||||
).unwrap();
|
||||
Configuration::set_chain_availability_period(
|
||||
Origin::ROOT, new_config.chain_availability_period,
|
||||
Origin::root(), new_config.chain_availability_period,
|
||||
).unwrap();
|
||||
Configuration::set_thread_availability_period(
|
||||
Origin::ROOT, new_config.thread_availability_period,
|
||||
Origin::root(), new_config.thread_availability_period,
|
||||
).unwrap();
|
||||
Configuration::set_scheduling_lookahead(
|
||||
Origin::ROOT, new_config.scheduling_lookahead,
|
||||
Origin::root(), new_config.scheduling_lookahead,
|
||||
).unwrap();
|
||||
|
||||
assert_eq!(<Configuration as Store>::PendingConfig::get(), Some(new_config));
|
||||
@@ -322,7 +322,7 @@ mod tests {
|
||||
#[test]
|
||||
fn setting_config_to_same_as_current_is_noop() {
|
||||
new_test_ext(Default::default()).execute_with(|| {
|
||||
Configuration::set_validation_upgrade_delay(Origin::ROOT, Default::default()).unwrap();
|
||||
Configuration::set_validation_upgrade_delay(Origin::root(), Default::default()).unwrap();
|
||||
assert!(<Configuration as Store>::PendingConfig::get().is_none())
|
||||
});
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = u64;
|
||||
|
||||
@@ -24,7 +24,7 @@ use runtime_common::{attestations, claims, parachains, registrar, slots,
|
||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
||||
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight,
|
||||
MaximumExtrinsicWeight, TransactionCallFilter,
|
||||
MaximumExtrinsicWeight,
|
||||
};
|
||||
|
||||
use sp_std::prelude::*;
|
||||
@@ -90,7 +90,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: create_runtime_str!("polkadot"),
|
||||
impl_name: create_runtime_str!("parity-polkadot"),
|
||||
authoring_version: 0,
|
||||
spec_version: 8,
|
||||
spec_version: 9,
|
||||
impl_version: 0,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
transaction_version: 0,
|
||||
@@ -133,8 +133,6 @@ impl Filter<Call> for BaseFilter {
|
||||
}
|
||||
}
|
||||
}
|
||||
pub struct IsCallable;
|
||||
frame_support::impl_filter_stack!(IsCallable, BaseFilter, Call, is_callable);
|
||||
|
||||
type MoreThanHalfCouncil = EnsureOneOf<
|
||||
AccountId,
|
||||
@@ -147,6 +145,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl system::Trait for Runtime {
|
||||
type BaseCallFilter = BaseFilter;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = Nonce;
|
||||
@@ -656,7 +655,6 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
TransactionCallFilter::<IsCallable, Call>::new(),
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
@@ -746,7 +744,6 @@ impl vesting::Trait for Runtime {
|
||||
impl utility::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type IsCallable = IsCallable;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -764,7 +761,6 @@ impl multisig::Trait for Runtime {
|
||||
type DepositBase = DepositBase;
|
||||
type DepositFactor = DepositFactor;
|
||||
type MaxSignatories = MaxSignatories;
|
||||
type IsCallable = IsCallable;
|
||||
}
|
||||
|
||||
impl sudo::Trait for Runtime {
|
||||
@@ -830,7 +826,6 @@ impl proxy::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type Currency = Balances;
|
||||
type IsCallable = IsCallable;
|
||||
type ProxyType = ProxyType;
|
||||
type ProxyDepositBase = ProxyDepositBase;
|
||||
type ProxyDepositFactor = ProxyDepositFactor;
|
||||
@@ -917,7 +912,6 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
TransactionCallFilter<IsCallable, Call>,
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
|
||||
@@ -130,6 +130,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl system::Trait for Runtime {
|
||||
type BaseCallFilter = ();
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = Nonce;
|
||||
|
||||
@@ -31,7 +31,6 @@ use runtime_common::{attestations, parachains, registrar,
|
||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength,
|
||||
BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, MaximumExtrinsicWeight,
|
||||
TransactionCallFilter,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
@@ -82,7 +81,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: create_runtime_str!("westend"),
|
||||
impl_name: create_runtime_str!("parity-westend"),
|
||||
authoring_version: 2,
|
||||
spec_version: 28,
|
||||
spec_version: 29,
|
||||
impl_version: 0,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
transaction_version: 1,
|
||||
@@ -104,14 +103,13 @@ impl Filter<Call> for BaseFilter {
|
||||
!matches!(call, Call::Registrar(_))
|
||||
}
|
||||
}
|
||||
pub struct IsCallable;
|
||||
frame_support::impl_filter_stack!(IsCallable, BaseFilter, Call, is_callable);
|
||||
|
||||
parameter_types! {
|
||||
pub const Version: RuntimeVersion = VERSION;
|
||||
}
|
||||
|
||||
impl system::Trait for Runtime {
|
||||
type BaseCallFilter = BaseFilter;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = Nonce;
|
||||
@@ -447,7 +445,6 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
TransactionCallFilter::<IsCallable, Call>::new(),
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
@@ -525,7 +522,6 @@ impl identity::Trait for Runtime {
|
||||
impl utility::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type IsCallable = IsCallable;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -543,7 +539,6 @@ impl multisig::Trait for Runtime {
|
||||
type DepositBase = DepositBase;
|
||||
type DepositFactor = DepositFactor;
|
||||
type MaxSignatories = MaxSignatories;
|
||||
type IsCallable = IsCallable;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -629,7 +624,6 @@ impl proxy::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type Currency = Balances;
|
||||
type IsCallable = IsCallable;
|
||||
type ProxyType = ProxyType;
|
||||
type ProxyDepositBase = ProxyDepositBase;
|
||||
type ProxyDepositFactor = ProxyDepositFactor;
|
||||
@@ -709,7 +703,6 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
TransactionCallFilter<IsCallable, Call>,
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
|
||||
Reference in New Issue
Block a user