peer: move existing chan closer init logic to new method

In the next commit, we'll start checking feature bits to decide how to
init the chan closer.

In the future, we can move the current chan closer handling logic into
an `MsgEndpoint`, which'll allow us to get rid of the explicit chan
closer map and direct handling.
This commit is contained in:
Olaoluwa Osuntokun committed 2025-03-18 11:44:20 -05:00
1 parent fd05199ff2
commit 047d3532f9
2 files changed
+84 -72

No files matched your search

+4 -2
View File
@@ -860,8 +860,10 @@ func TestCustomShutdownScript(t *testing.T) {
t.Fatalf("did not receive shutdown message")
case err := <-errChan:
// Fail if we do not expect an error.
if err != test.expectedError {
t.Fatalf("error closing channel: %v", err)
if test.expectedError != nil {
require.ErrorIs(
t, err, test.expectedError,
)
}
// Terminate the test early if have received an error, no