Skip to content

Commit feacbc6

Browse files
committed
feat(actions): fix enabling condition propagation
1 parent 2663a5f commit feacbc6

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::*;
22

33
impl redux::EnablingCondition<crate::State> for P2pChannelsRpcAction {
4-
fn is_enabled(&self, state: &crate::State) -> bool {
5-
self.is_enabled(&state.p2p)
4+
fn is_enabled_with_time(&self, state: &crate::State, time: redux::Timestamp) -> bool {
5+
self.is_enabled_with_time(&state.p2p, time)
66
}
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::*;
22

33
impl redux::EnablingCondition<crate::State> for P2pConnectionIncomingAction {
4-
fn is_enabled(&self, state: &crate::State) -> bool {
5-
self.is_enabled(&state.p2p)
4+
fn is_enabled_with_time(&self, state: &crate::State, time: redux::Timestamp) -> bool {
5+
self.is_enabled_with_time(&state.p2p, time)
66
}
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::*;
22

33
impl redux::EnablingCondition<crate::State> for P2pConnectionOutgoingAction {
4-
fn is_enabled(&self, state: &crate::State) -> bool {
5-
self.is_enabled(&state.p2p)
4+
fn is_enabled_with_time(&self, state: &crate::State, time: redux::Timestamp) -> bool {
5+
self.is_enabled_with_time(&state.p2p, time)
66
}
77
}

p2p/src/channels/rpc/p2p_channels_rpc_actions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ impl P2pChannelsRpcAction {
6262
}
6363

6464
impl redux::EnablingCondition<P2pState> for P2pChannelsRpcAction {
65+
fn is_enabled(&self, _state: &P2pState) -> bool {
66+
panic!("is_enabled_with_time should be used")
67+
}
68+
6569
fn is_enabled_with_time(&self, state: &P2pState, time: Timestamp) -> bool {
6670
match self {
6771
P2pChannelsRpcAction::Init { peer_id } => {

p2p/src/connection/outgoing/p2p_connection_outgoing_actions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ impl P2pConnectionOutgoingAction {
9999
}
100100

101101
impl redux::EnablingCondition<P2pState> for P2pConnectionOutgoingAction {
102+
fn is_enabled(&self, _state: &P2pState) -> bool {
103+
panic!("is_enabled_with_time should be used")
104+
}
105+
102106
fn is_enabled_with_time(&self, state: &P2pState, time: redux::Timestamp) -> bool {
103107
match self {
104108
P2pConnectionOutgoingAction::RandomInit => {

0 commit comments

Comments
 (0)