Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion smite-scenarios/src/executor/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ fn execute_recv_implicit_channel_ready_unknown_channel() {
panic!("unexpected error: {err:?}");
};
assert_eq!(*id, funding_channel_id());
assert!(reason.contains("unknown channel_id: no channel was funded for it"));
assert!(reason.contains("unknown channel_id: no channel is tracked for it"));
}

#[test]
Expand Down
12 changes: 6 additions & 6 deletions smite/src/oracles/channel_ready.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct ChannelReadyContext<'a> {
/// The `channel_ready` received from the peer.
pub channel_ready: &'a ChannelReady,
/// The channel the `channel_ready` belongs to, identified by its
/// `channel_id`, or `None` if no channel was funded for it.
/// `channel_id`, or `None` if no channel is tracked for it.
pub channel: Option<&'a ChannelState>,
/// Features negotiated between the target node and Smite.
pub negotiated_features: &'a Features,
Expand All @@ -35,11 +35,11 @@ pub struct ChannelReadyOracle;

impl Oracle<ChannelReadyContext<'_>> for ChannelReadyOracle {
fn evaluate(&self, context: &ChannelReadyContext<'_>) -> Result<(), Violation> {
// Check that the `channel_ready` answers a channel we funded.
// Check that the `channel_ready` answers a channel we track.
let Some(channel) = context.channel else {
return Err(Violation::InvalidChannelReady(
context.channel_ready.channel_id,
"unknown channel_id: no channel was funded for it".to_string(),
"unknown channel_id: no channel is tracked for it".to_string(),
));
};

Expand Down Expand Up @@ -197,7 +197,7 @@ mod tests {
}

/// Oracle inputs for testing. Defaults to a conforming `channel_ready`
/// for a funded channel at the minimum depth.
/// for a tracked channel at the minimum depth.
struct OracleInputs {
channel_ready: ChannelReady,
channel: Option<ChannelState>,
Expand Down Expand Up @@ -233,7 +233,7 @@ mod tests {
}

fn channel_mut(&mut self) -> &mut ChannelState {
self.channel.as_mut().expect("funded channel")
self.channel.as_mut().expect("tracked channel")
}
}

Expand Down Expand Up @@ -270,7 +270,7 @@ mod tests {
..OracleInputs::default()
};

assert_fail(&inputs, "unknown channel_id: no channel was funded for it");
assert_fail(&inputs, "unknown channel_id: no channel is tracked for it");
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion smite/src/violation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum Violation {
/// The target's `channel_ready` broke a BOLT 2 requirement, as judged by
/// [`crate::oracles::ChannelReadyOracle`]. The reason names the breached
/// requirement, one of:
/// - it names a `channel_id` we have not funded,
/// - it names a `channel_id` we have no channel tracked for,
/// - its funding output does not match the negotiated funding script and
/// amount,
/// - it arrives before the funding transaction reached `minimum_depth`,
Expand Down