(
args: {
channelId: string;
purpose: string;
},
config: E2eConfig | undefined,
)
| 5329 | } |
| 5330 | |
| 5331 | async function handleSetChannelPurpose( |
| 5332 | args: { |
| 5333 | channelId: string; |
| 5334 | purpose: string; |
| 5335 | }, |
| 5336 | config: E2eConfig | undefined, |
| 5337 | ) { |
| 5338 | const identity = getIdentity(config); |
| 5339 | if (!identity) { |
| 5340 | const channel = getMockChannel(args.channelId); |
| 5341 | const nextPurpose = args.purpose.trim(); |
| 5342 | |
| 5343 | channel.purpose = nextPurpose.length > 0 ? nextPurpose : null; |
| 5344 | channel.purpose_set_by = getMockMemberPubkey(config); |
| 5345 | channel.purpose_set_at = new Date().toISOString(); |
| 5346 | touchMockChannel(channel); |
| 5347 | return; |
| 5348 | } |
| 5349 | |
| 5350 | await submitSignedEvent(config, { |
| 5351 | kind: 9002, |
| 5352 | content: "", |
| 5353 | tags: [ |
| 5354 | ["h", args.channelId], |
| 5355 | ["purpose", args.purpose], |
| 5356 | ], |
| 5357 | }); |
| 5358 | } |
| 5359 | |
| 5360 | type MockUpdaterChannel = { |
| 5361 | onmessage?: (event: { event: "Finished" }) => void; |
no test coverage detected