Skip to content

Commit

Permalink
Rename vars, add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
InversionSpaces committed Jun 21, 2023
1 parent ab719e3 commit 7fc22fb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions model/res/src/main/scala/aqua/res/MakeRes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@ import aqua.raw.value.{LiteralRaw, ValueRaw}
import aqua.model.*
import aqua.types.*

// TODO docs
/**
* Helpers for translating [[OpModel]] to [[ResolvedOp]]
*/
object MakeRes {
val op: ValueModel = LiteralModel.fromRaw(LiteralRaw.quote("op"))

/**
* Make topology hop to peer
*
* @param onPeer peer to make hop to
* @return [[ResolvedOp.Tree]] corresponsing to a hop
*/
def hop(onPeer: ValueModel): ResolvedOp.Tree = {
val streamName = "hop-stream-drop"
// Those names can't be produced from compilation
// so they are safe to use
val streamName = "-ephemeral-stream-"
val canonName = "-ephemeral-canon-"
val elementType = BottomType
val streamType = StreamType(elementType)
val canonName = "hop-canon-drop"
val canonType = CanonStreamType(elementType)

RestrictionRes(streamName, streamType).wrap(
Expand Down

0 comments on commit 7fc22fb

Please sign in to comment.