Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bdk_electrum crate to use sync/full-scan structs #1403

Merged
merged 13 commits into from
May 10, 2024

Commits on May 10, 2024

  1. refactor(electrum): remove RelevantTxids and track txs in TxGraph

    This PR removes `RelevantTxids` from the electrum crate and tracks
    transactions in a `TxGraph`. This removes the need to separately
    construct a `TxGraph` after a `full_scan` or `sync`.
    LagginTimes authored and evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    2ffb656 View commit details
    Browse the repository at this point in the history
  2. feat(chain): TxGraph::insert_tx reuses Arc

    When we insert a transaction that is already wrapped in `Arc`, we should
    reuse the `Arc`.
    evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    e3cfb84 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    721bb7f View commit details
    Browse the repository at this point in the history
  4. feat(chain): introduce TxCache to SyncRequest and FullScanRequest

    This transaction cache can be provided so the chain-source can avoid
    re-fetching transactions.
    evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    58f27b3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    653e4fe View commit details
    Browse the repository at this point in the history
  6. feat(electrum)!: use new sync/full-scan structs for ElectrumExt

    `ElectrumResultExt` trait is also introduced that adds methods which can
    convert the `Anchor` type for the update `TxGraph`.
    
    We also make use of the new `TxCache` fields in
    `SyncRequest`/`FullScanRequest`. This way, we can avoid re-fetching full
    transactions from Electrum if not needed.
    
    Examples and tests are updated to use the new `ElectrumExt` API.
    evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    a6fdfb2 View commit details
    Browse the repository at this point in the history
  7. feat: update logging of electrum examples

    * Syncing with `example_electrum` now shows progress as a percentage.
    * Flush stdout more aggressively.
    evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    b1f861b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9ed33c2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2945c6b View commit details
    Browse the repository at this point in the history
  10. feat(chain)!: use custom return types for ElectrumExt methods

    This is more code, but a much more elegant solution than having
    `ElectrumExt` methods return `SyncResult`/`FullScanResult` and having an
    `ElectrumResultExt` extention trait.
    evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    c0d7d60 View commit details
    Browse the repository at this point in the history
  11. feat(electrum): include option for previous TxOuts for fee calculation

    The previous `TxOut` for transactions received from an external
    wallet may be optionally added as floating `TxOut`s to `TxGraph`
    to allow for fee calculation.
    LagginTimes authored and evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    b2f3cac View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    92fb6cb View commit details
    Browse the repository at this point in the history
  13. feat(electrum): update docs and simplify logic of ElectrumExt

    Helper method docs are updated to explain what they are updating. Logic
    is simplified as we do not need to check whether a tx exists already in
    `update_graph` before inserting it.
    evanlinjin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    b45897e View commit details
    Browse the repository at this point in the history