Page MenuHomePhabricator

[mock-chronik-client] Match shape of subs in ws to ChronikClientNode for ChronikClientNode methods
ClosedPublic

Authored by bytesofman on Mar 14 2024, 12:32.

Details

Summary

ChronikClientNode supports multiple types of ws subscription, so ws.subs is an object, not an array.

Match this shape for in-node users.

token-server uses in-node chronik-client but tests legacy shape to match mock behavior. Update token-server to test correct behavior.

Test Plan

npm test

Event Timeline

match shape for block methods

update changelog, minor version bump

Failed tests logs:

====== chronik/wsHandler.js: initializeWebsocket returns expected websocket object.chronik/wsHandler.js initializeWebsocket returns expected websocket object ======
AssertionError: false == true
AssertionError [ERR_ASSERTION]: false == true
    at Context.<anonymous> (test/chronik/wsHandler.test.ts:21:16)
    at Generator.next (<anonymous>)
    at fulfilled (test/chronik/wsHandler.test.ts:31:58)

      + expected - actual

      -false
      +true

Each failure log is accessible here:
chronik/wsHandler.js: initializeWebsocket returns expected websocket object.chronik/wsHandler.js initializeWebsocket returns expected websocket object

Failed tests logs:

====== chronik/wsHandler.js: initializeWebsocket returns expected websocket object.chronik/wsHandler.js initializeWebsocket returns expected websocket object ======
AssertionError: false == true
AssertionError [ERR_ASSERTION]: false == true
    at Context.<anonymous> (test/chronik/wsHandler.test.ts:21:16)
    at Generator.next (<anonymous>)
    at fulfilled (test/chronik/wsHandler.test.ts:31:58)

      + expected - actual

      -false
      +true

Each failure log is accessible here:
chronik/wsHandler.js: initializeWebsocket returns expected websocket object.chronik/wsHandler.js initializeWebsocket returns expected websocket object

Update test in token-server to match in-node shape

bytesofman edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 14 2024, 17:10