|
Ran
|
Jobs
1
|
Files
52
|
Run time
1min
|
Badge
README BADGES
|
push
github
Merge bitcoindevkit/bdk#1684: Refactor file store 54251a7c9 docs(file_store): Show how to overwrite original file during recovery (志宇) 52f2061fd refactor(store)!: change Store's method and error names (nymius) fc76d6603 feat(store): add `Bincode` error variant to FileError enum (nymius) 39987882b fix(store): replace `Path.exists` by `OpenOptions.create_new` (nymius) Pull request description: ### Description The `Store::open` method doesn't recovers the previous `Store` state saved in the file and emplaces the file pointer just after the magic bytes prefix, this later is agravated by `Store::append_changeset` which sets the file pointer after the last written changeset. The combination of both causes the lost of any previous changeset there may have been in the file. Is natural to think this shouldn't be the expected behavior, as @KnowWhoami pointed out in #1517, and the `Store` should recover the previous changesets stored in the file store. The approach proposed in #1632 triggered a discussion about more changes in `Store`, which motivated the current refactor. Besides the fix for #1517, the following methods have been changed/renamed/repurposed in Store: - `create`: create file and retrieve store, if exists fail. - `load`: load changesets from file, aggregate them and return aggregated changeset and `Store`. If there are problems with decoding, fail. - `dump`: aggregate all changesets and return them. - `load_or_create`: try load or fallback to create. Fixes #1517. Overrides #1632. ### Notes to the reviewers **Load** return type is `Result<(Option<C>, Store), StoreErrorWithDump>` to allow methods which doesn't use `WalletPersister` to get the aggregated changeset right away. **Dump** is kept to allow `WalletPersister::initialize` method to retrieve the aggregated changeset without forcing ... (continued)
220 of 310 new or added lines in 3 files covered. (70.97%)
65 existing lines in 4 files now uncovered.12144 of 15198 relevant lines covered (79.91%)
13819.22 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 3 |
28.57 |
-11.43% | crates/file_store/src/lib.rs |
| 87 |
71.07 |
-25.0% | crates/file_store/src/store.rs |
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 2 |
68.56 |
-0.2% | crates/chain/src/tx_graph.rs |
| 3 |
28.57 |
-11.43% | crates/file_store/src/lib.rs |
| 16 |
68.52 |
-11.92% | crates/file_store/src/entry_iter.rs |
| 44 |
71.07 |
-25.0% | crates/file_store/src/store.rs |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 13688754412.1 | 52 |
79.91 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|