mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-06-04 05:00:02 +00:00
remove proc getChannelForTest proc
This commit is contained in:
parent
2f9d9336cc
commit
f1f02302f0
@ -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,
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user