Page MenuHomePhabricator

[Chronik] Add `type Aux` to `Group` to assist with grouping members
ClosedPublic

Authored by tobias_ruck on Feb 5 2024, 09:39.

Details

Summary

Currently, it's difficult to feed auxillary data to groups, e.g. when grouping txs/utxos by token ID.

This wasn't apparent yet because the ScriptGroup and ValueGroup only depended on TxOutput, but some groups, e.g. groups that group by token ID or by plugin groups need auxillary data coming from previous computations.

Keeping these within the group struct doesn't really work; we want MempoolGroupUtxos and MempoolGroupHistory to be parametrized by the group, but auxillary data usually has a lifetime similar to that of the tx, not the mempool, so it becomes impossible to express in Rust.

Instead, we simply externalize the auxillary data which actually keeps the design quite clean.

Test Plan

ninja check-functional

Diff Detail

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