fix: add channelID to SdsUnwrapResponse

This commit is contained in:
shash256 2025-07-24 15:21:07 +05:30
parent 4e10d77218
commit f0c7035e38

View File

@ -18,6 +18,7 @@ type SdsMessageRequest* = object
type SdsUnwrapResponse* = object
message*: seq[byte]
missingDeps*: seq[SdsMessageID]
channelId*: string
proc createShared*(
T: type SdsMessageRequest,
@ -61,11 +62,11 @@ proc process*(
of UNWRAP_MESSAGE:
let messageBytes = self.message.toSeq()
let (unwrappedMessage, missingDeps, _) = unwrapReceivedMessage(rm[], messageBytes).valueOr:
let (unwrappedMessage, missingDeps, channelId) = unwrapReceivedMessage(rm[], messageBytes).valueOr:
error "UNWRAP_MESSAGE failed", error = error
return err("error processing UNWRAP_MESSAGE request: " & $error)
let res = SdsUnwrapResponse(message: unwrappedMessage, missingDeps: missingDeps)
let res = SdsUnwrapResponse(message: unwrappedMessage, missingDeps: missingDeps, channelId: channelId)
# return the result as a json string
return ok($(%*(res)))