( events: RelayEvent[], rows: RelayEvent[], )
| 3743 | } |
| 3744 | |
| 3745 | function buildMockChannelWindowAux( |
| 3746 | events: RelayEvent[], |
| 3747 | rows: RelayEvent[], |
| 3748 | ): RelayEvent[] { |
| 3749 | const collectHop = (kinds: Set<number>, targetIds: Set<string>) => |
| 3750 | events.filter( |
| 3751 | (event) => |
| 3752 | kinds.has(event.kind) && |
| 3753 | getEventTargets(event).some((target) => targetIds.has(target)), |
| 3754 | ); |
| 3755 | |
| 3756 | const firstHop = collectHop( |
| 3757 | CHANNEL_WINDOW_AUX_KINDS, |
| 3758 | new Set(rows.map((row) => row.id)), |
| 3759 | ); |
| 3760 | const secondHop = collectHop( |
| 3761 | CHANNEL_WINDOW_AUX_DELETION_KINDS, |
| 3762 | new Set(firstHop.map((event) => event.id)), |
| 3763 | ); |
| 3764 | const byId = new Map(firstHop.map((event) => [event.id, event])); |
| 3765 | for (const event of secondHop) byId.set(event.id, event); |
| 3766 | return [...byId.values()]; |
| 3767 | } |
| 3768 | |
| 3769 | function buildMockChannelThreadSummary( |
| 3770 | channelId: string, |
no test coverage detected