Remove more code not needed for Ledgeracio

This commit is contained in:
Demi M. Obenour
2020-09-11 20:26:14 -04:00
parent 9f34f76d81
commit 1df5a64024
3 changed files with 3 additions and 79 deletions
-42
View File
@@ -51,9 +51,6 @@ pub trait Session: System {
/// The validator account identifier type for the runtime.
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.
type Keys: OpaqueKeys + Member + Parameter + Default;
}
@@ -68,27 +65,6 @@ pub struct ValidatorsStore<T: Session> {
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.
#[derive(Encode, Call, Debug)]
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.
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
View File
@@ -24,11 +24,6 @@ use codec::{
Decode,
Encode,
};
use frame_support::Parameter;
use sp_runtime::traits::{
MaybeSerialize,
Member,
};
use std::{
collections::BTreeMap,
@@ -69,27 +64,7 @@ pub struct SetPayeeCall<T: Staking> {
/// The subset of the `frame::Trait` that a client must implement.
#[module]
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;
}
pub trait Staking: Balances {}
/// Number of eras to keep in history.
///
+2 -11
View File
@@ -146,10 +146,7 @@ pub trait Runtime: System + Sized + Send + Sync + 'static {
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct DefaultNodeRuntime;
impl Staking for DefaultNodeRuntime {
type NominatorIndex = u32;
type ValidatorIndex = u16;
}
impl Staking for DefaultNodeRuntime {}
impl Runtime for DefaultNodeRuntime {
type Signature = MultiSignature;
@@ -173,7 +170,6 @@ impl Balances for DefaultNodeRuntime {
}
impl Session for DefaultNodeRuntime {
type SessionIndex = u32;
type ValidatorId = <Self as System>::AccountId;
type Keys = BasicSessionKeys;
}
@@ -213,7 +209,6 @@ impl Balances for NodeTemplateRuntime {
}
impl Session for NodeTemplateRuntime {
type SessionIndex = u32;
type ValidatorId = <Self as System>::AccountId;
type Keys = BasicSessionKeys;
}
@@ -247,15 +242,11 @@ impl System for KusamaRuntime {
}
impl Session for KusamaRuntime {
type SessionIndex = u32;
type ValidatorId = <Self as System>::AccountId;
type Keys = SessionKeys;
}
impl Staking for KusamaRuntime {
type NominatorIndex = u32;
type ValidatorIndex = u16;
}
impl Staking for KusamaRuntime {}
impl Balances for KusamaRuntime {
type Balance = u128;