mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 01:57:56 +00:00
Define ss58 prefix inside the runtime (#7810)
* Add SS58Prefix type to the frame_system config trait * Remove unused chain_id runtime interface
This commit is contained in:
committed by
GitHub
parent
bd48ff310d
commit
ec2c70396e
@@ -257,6 +257,13 @@ pub trait Config: 'static + Eq + Clone {
|
||||
type OnKilledAccount: OnKilledAccount<Self::AccountId>;
|
||||
|
||||
type SystemWeightInfo: WeightInfo;
|
||||
|
||||
/// The designated SS85 prefix of this chain.
|
||||
///
|
||||
/// This replaces the "ss58Format" property declared in the chain spec. Reason is
|
||||
/// that the runtime should know about the prefix in order to make use of it as
|
||||
/// an identifier of the chain.
|
||||
type SS58Prefix: Get<u8>;
|
||||
}
|
||||
|
||||
pub type DigestOf<T> = generic::Digest<<T as Config>::Hash>;
|
||||
@@ -516,6 +523,13 @@ decl_module! {
|
||||
/// The weight configuration (limits & base values) for each class of extrinsics and block.
|
||||
const BlockWeights: limits::BlockWeights = T::BlockWeights::get();
|
||||
|
||||
/// The designated SS85 prefix of this chain.
|
||||
///
|
||||
/// This replaces the "ss58Format" property declared in the chain spec. Reason is
|
||||
/// that the runtime should know about the prefix in order to make use of it as
|
||||
/// an identifier of the chain.
|
||||
const SS58Prefix: u8 = T::SS58Prefix::get();
|
||||
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
if !UpgradedToU32RefCount::get() {
|
||||
Account::<T>::translate::<(T::Index, u8, T::AccountData), _>(|_key, (nonce, rc, data)|
|
||||
|
||||
@@ -117,6 +117,7 @@ impl Config for Test {
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = RecordKilled;
|
||||
type SystemWeightInfo = ();
|
||||
type SS58Prefix = ();
|
||||
}
|
||||
|
||||
pub type System = Module<Test>;
|
||||
|
||||
Reference in New Issue
Block a user