Page MenuHomePhabricator

[ecash-agora] Add `subscribeWs` and `unsubscribeWs`
ClosedPublic

Authored by tobias_ruck on Oct 2 2024, 20:14.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABCc0adb402e89c: [ecash-agora] Add `subscribeWs` and `unsubscribeWs`
Summary

These take a WsEndpoint object from ChronikClient.ws, and subscribe to / unsubscribe from the requested type of updates from the Agora plugin.

Test Plan

npm run integration-tests

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bytesofman added inline comments.
modules/ecash-agora/tests/oneshot.test.ts
214 ↗(On Diff #49910)

are you just writing these kinds of methods as you go along?

I've found managing these integration tests pretty complicated, usually all kinda gotchas.

then I come across diffs like this and it's like "uh yeah well why didn't you just listenNext(), obv"

🤔

This revision is now accepted and ready to land.Oct 2 2024, 21:33
modules/ecash-agora/tests/oneshot.test.ts
214 ↗(On Diff #49910)

are you just writing these kinds of methods as you go along?

technically this is a function

I've found managing these integration tests pretty complicated, usually all kinda gotchas.

oh yeah, here it took me quite a while to figure out why my WS subscription didn't go through (didn't await waitForOpen), or why my event wasn't being sent to my EventEmitter (listener has to be registered first)...

so this stuff doesn't solve the complexity but makes it a bit easier to work with