-
Notifications
You must be signed in to change notification settings - Fork 307
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
Update bdk_electrum
crate to use sync/full-scan structs
#1403
Commits on May 10, 2024
-
refactor(electrum): remove
RelevantTxids
and track txs inTxGraph
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`.
Configuration menu - View commit details
-
Copy full SHA for 2ffb656 - Browse repository at this point
Copy the full SHA 2ffb656View commit details -
feat(chain):
TxGraph::insert_tx
reusesArc
When we insert a transaction that is already wrapped in `Arc`, we should reuse the `Arc`.
Configuration menu - View commit details
-
Copy full SHA for e3cfb84 - Browse repository at this point
Copy the full SHA e3cfb84View commit details -
Configuration menu - View commit details
-
Copy full SHA for 721bb7f - Browse repository at this point
Copy the full SHA 721bb7fView commit details -
feat(chain): introduce
TxCache
toSyncRequest
andFullScanRequest
This transaction cache can be provided so the chain-source can avoid re-fetching transactions.
Configuration menu - View commit details
-
Copy full SHA for 58f27b3 - Browse repository at this point
Copy the full SHA 58f27b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 653e4fe - Browse repository at this point
Copy the full SHA 653e4feView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a6fdfb2 - Browse repository at this point
Copy the full SHA a6fdfb2View commit details -
feat: update logging of electrum examples
* Syncing with `example_electrum` now shows progress as a percentage. * Flush stdout more aggressively.
Configuration menu - View commit details
-
Copy full SHA for b1f861b - Browse repository at this point
Copy the full SHA b1f861bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ed33c2 - Browse repository at this point
Copy the full SHA 9ed33c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2945c6b - Browse repository at this point
Copy the full SHA 2945c6bView commit details -
feat(chain)!: use custom return types for
ElectrumExt
methodsThis is more code, but a much more elegant solution than having `ElectrumExt` methods return `SyncResult`/`FullScanResult` and having an `ElectrumResultExt` extention trait.
Configuration menu - View commit details
-
Copy full SHA for c0d7d60 - Browse repository at this point
Copy the full SHA c0d7d60View commit details -
feat(electrum): include option for previous
TxOut
s for fee calculationThe previous `TxOut` for transactions received from an external wallet may be optionally added as floating `TxOut`s to `TxGraph` to allow for fee calculation.
Configuration menu - View commit details
-
Copy full SHA for b2f3cac - Browse repository at this point
Copy the full SHA b2f3cacView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92fb6cb - Browse repository at this point
Copy the full SHA 92fb6cbView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b45897e - Browse repository at this point
Copy the full SHA b45897eView commit details