Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Applying block APIs #193

Open
LLFourn opened this issue Feb 20, 2023 · 0 comments
Open

Applying block APIs #193

LLFourn opened this issue Feb 20, 2023 · 0 comments
Assignees

Comments

@LLFourn
Copy link
Owner

LLFourn commented Feb 20, 2023

We need a set of APIs to easily apply blocks to a keychain tracker. I propse the following:

  • ChainGraph::<ConfirmationTime>::from_block(block): This creates a chain graph with two checkpoints (one for the block at height and one for prev block hash).
  • KeychainTracker::apply_update_relevant(scan: KeychainScan), does this same thing as apply_update but doesn't not take transactions that don't send to or from things in the txout index. Also add determine_relevant_changeset.
  • ChainGraph::apply_update_relevant(|tx| is_this_relevant(tx)) same as above except you can pass a predicate (also needs the changeset option).

In addition to adding these APIs it looks like KeychainTracker::determine_changeset has a TODO in it that needs to be fixed before this whole workflow will work properly:

// TODO: `KeychainTxOutIndex::determine_additions`

I'm also open to other suggestions :)

danielabrozzoni added a commit to danielabrozzoni/bdk_core_staging that referenced this issue Feb 28, 2023
- ChainGraph::determine_relevant_changeset
- KeychainTracker::determine_relevant_changeset,
  KeychainTracker::determine_additions,
  KeychainTracker::apply_update_relevant,
- TxGraph::determine_relevant_additions

Partially solves LLFourn#193
danielabrozzoni added a commit to danielabrozzoni/bdk_core_staging that referenced this issue Feb 28, 2023
- ChainGraph::determine_relevant_changeset
- KeychainTracker::determine_relevant_changeset,
  KeychainTracker::determine_additions,
  KeychainTracker::apply_update_relevant,
- TxGraph::determine_relevant_additions

Partially solves LLFourn#193
danielabrozzoni added a commit to danielabrozzoni/bdk_core_staging that referenced this issue Mar 7, 2023
- ChainGraph::determine_relevant_changeset
- KeychainTracker::determine_relevant_changeset,
  KeychainTracker::determine_additions,
  KeychainTracker::apply_update_relevant,
- TxGraph::determine_relevant_additions

Partially solves LLFourn#193
danielabrozzoni added a commit to danielabrozzoni/bdk_core_staging that referenced this issue Mar 7, 2023
- ChainGraph::determine_relevant_changeset
- KeychainTracker::determine_relevant_changeset,
  KeychainTracker::determine_additions,
  KeychainTracker::apply_update_relevant,
- TxGraph::determine_relevant_additions

Partially solves LLFourn#193
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants