Page MenuHomePhabricator

[chronik-client] Add support for token info endpoint to ChronikClientNode
ClosedPublic

Authored by bytesofman on Feb 24 2024, 00:59.

Details

Summary

T3441

Add support for chronik.token(tokenId) to in-node chronik-client

Test Plan

CI

Event Timeline

TODO

  • Get token info from mempool
  • Get token info after genesis confirmed
  • Cover SLP, SLP2, ALP, and NFT1
  • should alp info be hex or text? per Tobias, keep data as uint8array, use hex for authpubkey
  • decision on including or not including blank strings as keys, esp alp strings for non-alp txs

shape genesis info by token type

alp data as uint8array, test non-utf8 token genesis input

Failed tests logs:

====== Get blocktxs, txs, and history for SLP NFT1 token txs: "before each" hook for "Gets an SLP NFT1 child genesis tx from the mempool".Get blocktxs, txs, and history for SLP NFT1 token txs "before each" hook for "Gets an SLP NFT1 child genesis tx from the mempool" ======
Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/work/modules/chronik-client/test/integration/token_slp_nft1.ts)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)

Each failure log is accessible here:
Get blocktxs, txs, and history for SLP NFT1 token txs: "before each" hook for "Gets an SLP NFT1 child genesis tx from the mempool".Get blocktxs, txs, and history for SLP NFT1 token txs "before each" hook for "Gets an SLP NFT1 child genesis tx from the mempool"

rebase for rerun of flaky test

genesisInfo will always be there

tobias_ruck added a subscriber: tobias_ruck.
tobias_ruck added inline comments.
modules/chronik-client/src/ChronikClientNode.ts
1407
modules/chronik-client/test/integration/token_alp.ts
1188

I think it’s better to use the \u escapes here for the ? replacements instead of committing them as-is UTF-8, people (or software) might think their encoding broke

This revision now requires changes to proceed.Feb 24 2024, 15:36
bytesofman marked an inline comment as done.

use unicode escape chars for test result, improve test comments, tokenType required in TokenInfo interface

Failed tests logs:

====== Get blocktxs, txs, and history for SLP NFT1 token txs: "before each" hook for "Gets an SLP NFT1 send tx from the mempool".Get blocktxs, txs, and history for SLP NFT1 token txs "before each" hook for "Gets an SLP NFT1 send tx from the mempool" ======
Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/work/modules/chronik-client/test/integration/token_slp_nft1.ts)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)

Each failure log is accessible here:
Get blocktxs, txs, and history for SLP NFT1 token txs: "before each" hook for "Gets an SLP NFT1 send tx from the mempool".Get blocktxs, txs, and history for SLP NFT1 token txs "before each" hook for "Gets an SLP NFT1 send tx from the mempool"

rebase to rerun ci on flaky test

This revision is now accepted and ready to land.Feb 26 2024, 14:08