remove proc getChannelForTest proc

This commit is contained in:
Ivan FB 2026-05-29 15:17:04 +02:00
parent 2f9d9336cc
commit f1f02302f0
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270
2 changed files with 3 additions and 18 deletions

View File

@ -61,15 +61,6 @@ proc stop*(self: ReliableChannelManager) {.async.} =
if not self.waku.isNil():
await self.waku.deliveryService.stopDeliveryService()
proc getChannelForTest*(
self: ReliableChannelManager, channelId: ChannelId
): ReliableChannel =
## Test-only: returns the channel for `channelId`, or `nil` if none
## exists. Production callers must address channels by `channelId`
## through the manager's `send` / `closeChannel` API — direct
## references bypass the manager's lifecycle and pipeline.
self.channels.getOrDefault(channelId)
proc createReliableChannel*(
self: ReliableChannelManager,
channelId: ChannelId,

View File

@ -187,9 +187,6 @@ suite "Reliable Channel - send state machine":
)
.expect("createReliableChannel")
let chn = manager.getChannelForTest(channelId)
doAssert not chn.isNil()
let sentFut = newFuture[RequestId]("channel-sent")
discard ChannelMessageSentEvent
.listen(
@ -201,7 +198,7 @@ suite "Reliable Channel - send state machine":
)
.expect("listen ChannelMessageSentEvent")
let channelReqId = chn.send("hello".toBytes()).expect("send")
let channelReqId = manager.send(channelId, "hello".toBytes()).expect("send")
let dispatchDeadline = Moment.now() + 1.seconds
while Moment.now() < dispatchDeadline and sendCalls == 0:
@ -258,9 +255,6 @@ suite "Reliable Channel - send state machine":
)
.expect("createReliableChannel")
let chn = manager.getChannelForTest(channelId)
doAssert not chn.isNil()
let sentFut = newFuture[RequestId]("channel-sent")
let erroredFut = newFuture[RequestId]("channel-errored")
discard ChannelMessageSentEvent
@ -282,8 +276,8 @@ suite "Reliable Channel - send state machine":
)
.expect("listen ChannelMessageErrorEvent")
let channelReqId1 = chn.send("first".toBytes()).expect("send 1")
let channelReqId2 = chn.send("second".toBytes()).expect("send 2")
let channelReqId1 = manager.send(channelId, "first".toBytes()).expect("send 1")
let channelReqId2 = manager.send(channelId, "second".toBytes()).expect("send 2")
let dispatchDeadline = Moment.now() + 1.seconds
while Moment.now() < dispatchDeadline and msgReqIds.len < 2: