Now that the in-node chronik supports token indexing, add supported proto data to chronik-client.
Details
- Reviewers
tobias_ruck - Group Reviewers
Restricted Project - Commits
- rABC5da580a8daf3: [chronik-client] Support token data in tx
CI or ref D14915
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- cc-tokens-in-tx
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 27143 Build 53852: Build Diff chronik-client-tests · chronik-client-integration-tests Build 53851: arc lint + arc unit
Event Timeline
modules/chronik-client/src/ChronikClientNode.ts | ||
---|---|---|
421 ↗ | (On Diff #45310) | there’s no spoon neo |
625 ↗ | (On Diff #45310) | Yes, hopefully we can remove all the _InNode suffixes soon |
634 ↗ | (On Diff #45310) | Protobuf enums must start at 0; but there’s no SLP type with that number, so I just put NONE. It’s a quirk of protobuf. However, it actually should be turned into an UNKNOWN, since people could start sending token type 0 txs. |
modules/chronik-client/src/ChronikClientNode.ts | ||
---|---|---|
589 ↗ | (On Diff #45337) | this can now be guaranteed |
modules/chronik-client/test/integration/token_alp.ts | ||
461 ↗ | (On Diff #45337) | this should allow you to avoid all the // @ts-ignore comments |
test/functional/setup_scripts/chronik-client_token_alp.py | ||
136 ↗ | (On Diff #45337) | be careful here; either use genesis.test to ensure the token stuff in the TokenTx matches, or don't use TokenTx at all and just send txs normally (e.g. using sendrawtransaction or chronik.broadcast_tx). Otherwise, people could change the tx and the actual token data of the tx won't be checked against the claimed token data in TokenTx. My suggestion would be to not use TokenTx in the first place which would make these files significantly shorter; and that's ok because the txs are tested in JS already. |
modules/chronik-client/test/integration/token_alp.ts | ||
---|---|---|
461 ↗ | (On Diff #45337) | nice, ty |
test/functional/setup_scripts/chronik-client_token_alp.py | ||
136 ↗ | (On Diff #45337) | ok nice. i get what was going on in the file now. bit of a refactor with var names but definitely worth it. what's with all the tx.rehash() statements? tests here pass without them, are they needed for the chronik compare tests / can they be omitted here? |
no ts-ignore, remove TokenTx from setup scripts, remove tx.rehash() from setup scripts, remove done todo comment
test/functional/setup_scripts/chronik-client_token_alp.py | ||
---|---|---|
136 ↗ | (On Diff #45337) | The rehash was mostly related to GENESIS txs in TokenTx, but since you don't use that anymore you can just remove it. |
modules/chronik-client/test/integration/token_slp_nft1.ts | ||
---|---|---|
247 ↗ | (On Diff #45347) | nice yeah just missed it in this file. |
modules/chronik-client/src/ChronikClientNode.ts | ||
---|---|---|
591 ↗ | (On Diff #45352) | I don’t wanna be that guy but while we’re at it we should turn this into a string literal sum type as well |
663 ↗ | (On Diff #45352) | |
modules/chronik-client/test/integration/token_alp.ts | ||
117 ↗ | (On Diff #45352) | What do you think about adding a default object and then use it with the spread operator? That’s what I do in the tests, and it removes a lot of dead LOC |
modules/chronik-client/test/integration/token_slp_fungible.ts | ||
151 ↗ | (On Diff #45352) | I don’t think we have to test that |
modules/chronik-client/test/integration/token_slp_mint_vault.ts | ||
151 ↗ | (On Diff #45352) | Same |
modules/chronik-client/test/integration/token_slp_nft1.ts | ||
151 ↗ | (On Diff #45352) | Aqui tambien |
test/functional/setup_scripts/chronik-client_token_slp_nft1.py | ||
89 ↗ | (On Diff #45352) | As discussed before, remove this |
143 ↗ | (On Diff #45352) | Here too |
184 ↗ | (On Diff #45352) | Here too |
229 ↗ | (On Diff #45352) | Here too |
remove missed TokenTx in py script, remove copypasta placeholder test assertion, better type guards for TokenTxType, spread operator to simplify tokenEntries expected shape in tests
modules/chronik-client/src/ChronikClientNode.ts | ||
---|---|---|
591 ↗ | (On Diff #45352) | missed it, added |
modules/chronik-client/test/integration/token_alp.ts | ||
117 ↗ | (On Diff #45352) | nice optimization, makes it easier to see what we are actually testing |
modules/chronik-client/test/integration/token_slp_nft1.ts | ||
---|---|---|
136 ↗ | (On Diff #45361) | (badly) assumed the linter was picking this up as I went through |