Page MenuHomePhabricator

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

Authored by tobias_ruck on Wed, Oct 2, 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
Branch
ecash-agora-subscribe-to-ws
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30474
Build 60466: Build Diffecash-agora-integration-tests · ecash-agora-tests
Build 60465: arc lint + arc unit

Event Timeline

bytesofman added inline comments.
modules/ecash-agora/tests/oneshot.test.ts
214

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.Wed, Oct 2, 21:33
modules/ecash-agora/tests/oneshot.test.ts
214

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