Skip to content

Furthur changes to redesign structures. #971

@evanlinjin

Description

@evanlinjin

Describe the enhancement

After a call with @LLFourn, the follow things will be added (either to this PR, or a separate PR):

  1. The PersistBackend<T, C> trait currently has a generic T for the "in memory representation". This also constrains C to "accompany" T, thus requiring us to have something like Tracker in Implement persistence with the new structures #965. The "onioning" of these structures is unfortunate. However, there is a way to do PersistBackend without T and just rely on C! Let's experiment with that to see if it cleans up the API and reduces "onioning".
    -- Completed by Implement persistence with the new structures #965

  2. ChainOracle::get_chain_tip(&self) -> Result<Option<BlockId>, Self::Error> will be added. This is needed as we need something to input as the "static block" for the is_block_in_best_chain call. Additionally, a structure that is capable of implementing ChainOracle functionality should also have the functionality to return the tip of the best chain.

  3. OwnedIndexer is bad. Here is something better:

    pub trait OwnedTxOuts {
        type SpkIndex;
        type Iter: Iterator<Item = (Self::SpkIndex, OutPoint)>;
        fn owned_txouts(&self) -> Self::Iter;
    }

    This thing iterates over all outpoints that we own (alongside the spk index we give it). To get the owned UTXO set, we filter over this. Same thing for balance.
    -- Turns out OwnedTxOuts is not needed either, all removed in Improve txout listing and balance APIs for redesigned structures #975

Metadata

Metadata

Assignees

Labels

new featureNew feature or request

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions