-
Notifications
You must be signed in to change notification settings - Fork 94
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
[r2r] HD wallet tx history #1285
Conversation
* Add `coins::tx_history_storage` module * Move `load_history`, `save_history`, `clear` from `TxHistoryDb` implementation to static functions
* Cover `BeBigUint` with unit tests
* Add `indexed_db::DbTable::count`, `indexed_db::DbTable::count_all` * Add methods to `indexed_db::DbTable` that take multiple index keys as arguments * Remove `DbTransaction::wait_for_complete` as it doesn't work properly
* Add tx history `WalletId` * Add `SqlQuery` that acts like `SqlBuilder` but manages parameters * Add `<WalletId>_tx_from_address`, `<WalletId>_tx_to_address` SQL tables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🔥 Here are my notes and suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Work! only one inquiry.
* Add `try_serialize_index_value` macro * Avoid declaring public methods, traits, types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for great work! I have mostly cosmetic changes requests and a couple of questions.
* Move big JSON payloads to separate files * Add the `indexed_db::test_transaction_abort_on_error` test * Allow the `SqlQuery` to validate SQL identifiers and values
@sergeyboyko0791 Please solve git conflicts, so I can proceed with the next review iteration :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
@ozkanonur @shamardy Could you please take one more look too? |
@artemii235 could you please share your thoughts on these TODOs? https://github.com/KomodoPlatform/atomicDEX-API/blob/f980fee5a524fdc390b2ecc7162eaee6edd2d380/mm2src/coins/tx_history_storage/sql_tx_history_storage_v2.rs#L619 This one can be done at the next iteration unless the transaction history v2 is integrated into AirDEX already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one non-blocker comment :)
...c/coins/for_tests/RICK_2c33baf0c40eebcb70fc22eab0158e315e2176e4a3f20acddcd849186fca492c.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 2 notes :)
* Avoid adding `mm2src/coins/for_tests/RICK_<ID>.json` files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work 🔥
#964 #740 * Restructure TX history storage modules * Add `coins::tx_history_storage` module * Move `load_history`, `save_history`, `clear` from `TxHistoryDb` implementation to static functions * Add `BeBigUint` into `common::indexed_db` * Cover `BeBigUint` with unit tests * Add `IndexedDbTxHistoryStorage` * Add `indexed_db::DbTable::count`, `indexed_db::DbTable::count_all` * Add methods to `indexed_db::DbTable` that take multiple index keys as arguments * Remove `DbTransaction::wait_for_complete` as it doesn't work properly * Integrate HD addresses into TxHistory V2 Storage scheme * Add tx history `WalletId` * Add `SqlQuery` that acts like `SqlBuilder` but manages parameters * Add `<WalletId>_tx_from_address`, `<WalletId>_tx_to_address` SQL tables * Minor changes * Add `try_serialize_index_value` macro * Avoid declaring public methods, traits, types * Fix PR issues * Move big JSON payloads to separate files * Add the `indexed_db::test_transaction_abort_on_error` test * Allow the `SqlQuery` to validate SQL identifiers and values * Combine `tx_from_address` and `tx_to_address` tables into single `tx_address` * Fix clippy warning * Fix PR issues * Avoid adding `mm2src/coins/for_tests/RICK_<ID>.json` files * Minor changes
#964
#740
BeBigUint
tomm2_db::indexed_db
;IndexedDbTxHistoryStorage
;mm2_db::indexed_db::DbTable
with the methods that take multiple index keys as arguments;WalletId
(that may include HD walletrmd160
);SqlQuery
that acts likeSqlBuilder
but also manages SQL parameters;<WalletId>_tx_from_address
,<WalletId>_tx_to_address
SQL tablesPlease also note that I've left TODO comments with questions and suggestions how to improve the performance at the next iterations.