mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 21:45:41 +00:00
Remove more code not needed for Ledgeracio
This commit is contained in:
@@ -51,9 +51,6 @@ pub trait Session: System {
|
|||||||
/// The validator account identifier type for the runtime.
|
/// The validator account identifier type for the runtime.
|
||||||
type ValidatorId: Parameter + Debug + Ord + Default + Send + Sync + 'static;
|
type ValidatorId: Parameter + Debug + Ord + Default + Send + Sync + 'static;
|
||||||
|
|
||||||
/// The session index identifier type for the runtime.
|
|
||||||
type SessionIndex: Parameter + Debug + Ord + Default + Send + Sync + 'static;
|
|
||||||
|
|
||||||
/// The keys.
|
/// The keys.
|
||||||
type Keys: OpaqueKeys + Member + Parameter + Default;
|
type Keys: OpaqueKeys + Member + Parameter + Default;
|
||||||
}
|
}
|
||||||
@@ -68,27 +65,6 @@ pub struct ValidatorsStore<T: Session> {
|
|||||||
|
|
||||||
default_impl!(ValidatorsStore);
|
default_impl!(ValidatorsStore);
|
||||||
|
|
||||||
/// Current index of the session.
|
|
||||||
#[derive(Encode, Store, Debug)]
|
|
||||||
pub struct CurrentIndexStore<T: Session> {
|
|
||||||
#[store(returns = <T as Session>::SessionIndex)]
|
|
||||||
/// Marker for the runtime
|
|
||||||
pub _runtime: PhantomData<T>,
|
|
||||||
}
|
|
||||||
|
|
||||||
default_impl!(CurrentIndexStore);
|
|
||||||
|
|
||||||
/// True if the underlying economic identities or weighting behind the validators
|
|
||||||
/// has changed in the queued validator set.
|
|
||||||
#[derive(Encode, Store, Debug)]
|
|
||||||
pub struct QueuedChangedStore<T: Session> {
|
|
||||||
#[store(returns = bool)]
|
|
||||||
/// Marker for the runtime
|
|
||||||
pub _runtime: PhantomData<T>,
|
|
||||||
}
|
|
||||||
|
|
||||||
default_impl!(QueuedChangedStore);
|
|
||||||
|
|
||||||
/// Set the session keys for a validator.
|
/// Set the session keys for a validator.
|
||||||
#[derive(Encode, Call, Debug)]
|
#[derive(Encode, Call, Debug)]
|
||||||
pub struct SetKeysCall<T: Session> {
|
pub struct SetKeysCall<T: Session> {
|
||||||
@@ -97,21 +73,3 @@ pub struct SetKeysCall<T: Session> {
|
|||||||
/// The proof. This is not currently used and can be set to an empty vector.
|
/// The proof. This is not currently used and can be set to an empty vector.
|
||||||
pub proof: Vec<u8>,
|
pub proof: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::tests::test_client;
|
|
||||||
|
|
||||||
#[async_std::test]
|
|
||||||
#[ignore]
|
|
||||||
async fn test_state_read_free_balance() {
|
|
||||||
env_logger::try_init().ok();
|
|
||||||
let (client, _) = test_client().await;
|
|
||||||
assert!(client
|
|
||||||
.fetch(&QueuedChangedStore::default(), None)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.unwrap());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-26
@@ -24,11 +24,6 @@ use codec::{
|
|||||||
Decode,
|
Decode,
|
||||||
Encode,
|
Encode,
|
||||||
};
|
};
|
||||||
use frame_support::Parameter;
|
|
||||||
use sp_runtime::traits::{
|
|
||||||
MaybeSerialize,
|
|
||||||
Member,
|
|
||||||
};
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::BTreeMap,
|
collections::BTreeMap,
|
||||||
@@ -69,27 +64,7 @@ pub struct SetPayeeCall<T: Staking> {
|
|||||||
|
|
||||||
/// The subset of the `frame::Trait` that a client must implement.
|
/// The subset of the `frame::Trait` that a client must implement.
|
||||||
#[module]
|
#[module]
|
||||||
pub trait Staking: Balances {
|
pub trait Staking: Balances {}
|
||||||
/// Data type used to index nominators in the compact type
|
|
||||||
type NominatorIndex: Parameter
|
|
||||||
+ codec::Codec
|
|
||||||
+ Member
|
|
||||||
+ Default
|
|
||||||
+ Copy
|
|
||||||
+ MaybeSerialize
|
|
||||||
+ Debug;
|
|
||||||
|
|
||||||
/// Data type used to index validators in the compact type.
|
|
||||||
type ValidatorIndex: Parameter
|
|
||||||
+ codec::Codec
|
|
||||||
+ Send
|
|
||||||
+ Sync
|
|
||||||
+ Default
|
|
||||||
+ Member
|
|
||||||
+ Copy
|
|
||||||
+ MaybeSerialize
|
|
||||||
+ Debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Number of eras to keep in history.
|
/// Number of eras to keep in history.
|
||||||
///
|
///
|
||||||
|
|||||||
+2
-11
@@ -146,10 +146,7 @@ pub trait Runtime: System + Sized + Send + Sync + 'static {
|
|||||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||||
pub struct DefaultNodeRuntime;
|
pub struct DefaultNodeRuntime;
|
||||||
|
|
||||||
impl Staking for DefaultNodeRuntime {
|
impl Staking for DefaultNodeRuntime {}
|
||||||
type NominatorIndex = u32;
|
|
||||||
type ValidatorIndex = u16;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Runtime for DefaultNodeRuntime {
|
impl Runtime for DefaultNodeRuntime {
|
||||||
type Signature = MultiSignature;
|
type Signature = MultiSignature;
|
||||||
@@ -173,7 +170,6 @@ impl Balances for DefaultNodeRuntime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Session for DefaultNodeRuntime {
|
impl Session for DefaultNodeRuntime {
|
||||||
type SessionIndex = u32;
|
|
||||||
type ValidatorId = <Self as System>::AccountId;
|
type ValidatorId = <Self as System>::AccountId;
|
||||||
type Keys = BasicSessionKeys;
|
type Keys = BasicSessionKeys;
|
||||||
}
|
}
|
||||||
@@ -213,7 +209,6 @@ impl Balances for NodeTemplateRuntime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Session for NodeTemplateRuntime {
|
impl Session for NodeTemplateRuntime {
|
||||||
type SessionIndex = u32;
|
|
||||||
type ValidatorId = <Self as System>::AccountId;
|
type ValidatorId = <Self as System>::AccountId;
|
||||||
type Keys = BasicSessionKeys;
|
type Keys = BasicSessionKeys;
|
||||||
}
|
}
|
||||||
@@ -247,15 +242,11 @@ impl System for KusamaRuntime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Session for KusamaRuntime {
|
impl Session for KusamaRuntime {
|
||||||
type SessionIndex = u32;
|
|
||||||
type ValidatorId = <Self as System>::AccountId;
|
type ValidatorId = <Self as System>::AccountId;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Staking for KusamaRuntime {
|
impl Staking for KusamaRuntime {}
|
||||||
type NominatorIndex = u32;
|
|
||||||
type ValidatorIndex = u16;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Balances for KusamaRuntime {
|
impl Balances for KusamaRuntime {
|
||||||
type Balance = u128;
|
type Balance = u128;
|
||||||
|
|||||||
Reference in New Issue
Block a user