mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Prepare for final genesis (#1131)
* Update claim statements * Update URLs * Minor tweak to make enum agree with URL * final html multihashes * New hashes * Version * updated SAFT statement hash * Update runtimes; this relies on substrate #6131 * Bump * Share transaction filterer and fix Kusama * Warning * Gah! * Tidy * Westend fixes * Westend fix * Tweak constants * Implement TCF stuff * Fix * Warning * 15 minute lookahead * 15 minute lookahead in Polkadot * update max transactions * Enable utility, disable vested_transfer * Update runtime/common/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Filter calls for validate unsigned also * Deduplicate * Fix * Introduce Polkadot (mainnet) chainspec * Fix naming. * Enable indices and fix comment. * Fix compilation * Enable indices and fix comment. * polkadot: babe: enable secondary VRF slots * Test JSON * Allow set_heads * Fix * Raw chain spec added Co-authored-by: keorn <github@i.keorn.org> Co-authored-by: NikVolf <nikvolf@gmail.com> Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> Co-authored-by: Tomasz Drwięga <tomasz@parity.io> Co-authored-by: André Silva <andre.beat@gmail.com>
This commit is contained in:
@@ -25,24 +25,22 @@ use sp_core::u32_trait::{_1, _2, _3, _4, _5};
|
||||
use codec::{Encode, Decode};
|
||||
use primitives::{
|
||||
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
|
||||
parachain::{self, ActiveParas, AbridgedCandidateReceipt, SigningContext}, ValidityError,
|
||||
parachain::{self, ActiveParas, AbridgedCandidateReceipt, SigningContext},
|
||||
};
|
||||
use runtime_common::{attestations, claims, parachains, registrar, slots,
|
||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
||||
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight,
|
||||
MaximumExtrinsicWeight
|
||||
MaximumExtrinsicWeight, TransactionCallFilter,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys, ModuleId,
|
||||
ApplyExtrinsicResult, KeyTypeId, Percent, Permill, Perbill, Perquintill, RuntimeDebug,
|
||||
transaction_validity::{
|
||||
TransactionValidity, InvalidTransaction, TransactionValidityError, TransactionSource, TransactionPriority,
|
||||
},
|
||||
ApplyExtrinsicResult, KeyTypeId, Percent, Permill, Perbill, Perquintill,
|
||||
transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority},
|
||||
curve::PiecewiseLinear,
|
||||
traits::{
|
||||
BlakeTwo256, Block as BlockT, SignedExtension, OpaqueKeys, ConvertInto, IdentityLookup,
|
||||
DispatchInfoOf, Extrinsic as ExtrinsicT, SaturatedConversion, Verify,
|
||||
BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, IdentityLookup,
|
||||
Extrinsic as ExtrinsicT, SaturatedConversion, Verify,
|
||||
},
|
||||
};
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
@@ -55,7 +53,7 @@ use sp_core::OpaqueMetadata;
|
||||
use sp_staking::SessionIndex;
|
||||
use frame_support::{
|
||||
parameter_types, construct_runtime, debug,
|
||||
traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier},
|
||||
traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier, Filter},
|
||||
weights::Weight,
|
||||
};
|
||||
use im_online::sr25519::AuthorityId as ImOnlineId;
|
||||
@@ -102,31 +100,10 @@ pub fn native_version() -> NativeVersion {
|
||||
}
|
||||
|
||||
/// Avoid processing transactions from slots and parachain registrar.
|
||||
#[derive(Default, Encode, Decode, Clone, Eq, PartialEq, RuntimeDebug)]
|
||||
pub struct RestrictFunctionality;
|
||||
impl SignedExtension for RestrictFunctionality {
|
||||
const IDENTIFIER: &'static str = "RestrictFunctionality";
|
||||
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: &Self::Call,
|
||||
_: &DispatchInfoOf<Self::Call>,
|
||||
_: usize
|
||||
)
|
||||
-> TransactionValidity
|
||||
{
|
||||
match call {
|
||||
Call::Slots(_) | Call::Registrar(_)
|
||||
=> Err(InvalidTransaction::Custom(ValidityError::NoPermission.into()).into()),
|
||||
_ => Ok(Default::default()),
|
||||
}
|
||||
pub struct IsCallable;
|
||||
impl Filter<Call> for IsCallable {
|
||||
fn filter(call: &Call) -> bool {
|
||||
!matches!(call, Call::Slots(_) | Call::Registrar(_))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,7 +582,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
RestrictFunctionality,
|
||||
TransactionCallFilter::<IsCallable, Call>::new(),
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
@@ -719,6 +696,7 @@ impl utility::Trait for Runtime {
|
||||
type MultisigDepositBase = MultisigDepositBase;
|
||||
type MultisigDepositFactor = MultisigDepositFactor;
|
||||
type MaxSignatories = MaxSignatories;
|
||||
type IsCallable = IsCallable;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -856,7 +834,7 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
RestrictFunctionality,
|
||||
TransactionCallFilter<IsCallable, Call>,
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
|
||||
Reference in New Issue
Block a user