Skip to content

Commit a3ddaf0

Browse files
committed
Seperated stateful and effectful actions
1 parent d4382fa commit a3ddaf0

File tree

40 files changed

+515
-465
lines changed

40 files changed

+515
-465
lines changed

node/src/action.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use p2p::P2pEffectfulAction;
12
use serde::{Deserialize, Serialize};
23

34
pub type ActionWithMeta = redux::ActionWithMeta<Action>;
@@ -33,6 +34,7 @@ pub enum Action {
3334
EventSource(EventSourceAction),
3435

3536
P2p(P2pAction),
37+
P2pEffectful(P2pEffectfulAction),
3638
P2pCallbacks(P2pCallbacksAction),
3739

3840
Ledger(LedgerAction),
@@ -76,6 +78,10 @@ impl redux::EnablingCondition<crate::State> for Action {
7678
.ready()
7779
.map_or(false, |p2p| other.is_enabled(p2p, time)),
7880
},
81+
Action::P2pEffectful(a) => state
82+
.p2p
83+
.ready()
84+
.map_or(false, |state| a.is_enabled(state, time)),
7985
Action::Ledger(a) => a.is_enabled(state, time),
8086
Action::Snark(a) => a.is_enabled(&state.snark, time),
8187
Action::Consensus(a) => a.is_enabled(state, time),

0 commit comments

Comments
 (0)