Make BeaconChainTypes Send + Sync + 'static

This commit is contained in:
Paul Hauner
2019-08-22 16:34:21 +10:00
parent 5a34f86e77
commit 853344af8a
8 changed files with 19 additions and 23 deletions

View File

@@ -36,7 +36,11 @@ pub struct ClientType<S: Store, E: EthSpec> {
_phantom_u: PhantomData<E>,
}
impl<S: Store, E: EthSpec + Clone> BeaconChainTypes for ClientType<S, E> {
impl<S, E> BeaconChainTypes for ClientType<S, E>
where
S: Store + 'static,
E: EthSpec + 'static + Clone,
{
type Store = S;
type SlotClock = SystemTimeSlotClock;
type LmdGhost = ThreadSafeReducedTree<S, E>;

View File

@@ -49,7 +49,7 @@ pub struct Client<T: BeaconChainTypes> {
impl<T> Client<T>
where
T: BeaconChainTypes + InitialiseBeaconChain<T> + Clone + Send + Sync + 'static,
T: BeaconChainTypes + InitialiseBeaconChain<T> + Clone,
{
/// Generate an instance of the client. Spawn and link all internal sub-processes.
pub fn new(

View File

@@ -17,11 +17,7 @@ pub const WARN_PEER_COUNT: usize = 1;
/// durations.
///
/// Presently unused, but remains for future use.
pub fn run<T: BeaconChainTypes + Send + Sync + 'static>(
client: &Client<T>,
executor: TaskExecutor,
exit: Exit,
) {
pub fn run<T: BeaconChainTypes>(client: &Client<T>, executor: TaskExecutor, exit: Exit) {
// notification heartbeat
let interval = Interval::new(
Instant::now(),