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

Implement BCH and SLP tx history. Refactoring. #1175

Merged
merged 31 commits into from Dec 28, 2021
Merged

Implement BCH and SLP tx history. Refactoring. #1175

merged 31 commits into from Dec 28, 2021

Conversation

artemii235
Copy link
Member

@artemii235 artemii235 commented Dec 24, 2021

Added TxHistoryStorage trait.
Implemented it for SQLite DB.
Added TxDetailsBuilder struct.
Implemented BCH and SLP tx history fetching loop as a state machine. It fetches data for all SLP transfers - if a token is activated later its history will be available immediately.
Added my_tx_history 2.0 RPC for native platforms.
Created db_common crate.
block_on now uses CORE.block_on. Added async_blocking helper to run blocking IO in the async context. cc @Milerius this can help with the Solana RPC client in: #1109
Updated Rust toolchain.

TODO for later: implement TxHistoryStorage for IndexedDB to support WASM.

Also, there is a possible solution for #1166. We can require all the background spawning fns to return AbortHandle and add it to MmCtx::abort_handlers, which are already used in MmCtx::stop.

#701

# Conflicts:
#	mm2src/coins/lightning.rs
#	mm2src/coins/lightning/ln_rpc.rs
# Conflicts:
#	mm2src/coins/qrc20/history.rs
#	mm2src/coins/utxo.rs
#	mm2src/coins/utxo/slp.rs
#	mm2src/coins/utxo/utxo_common.rs
#	mm2src/coins/utxo/utxo_tests.rs
#	mm2src/coins_activation/src/bch_with_tokens_activation.rs
#	mm2src/docker_tests.rs
#	mm2src/docker_tests/qrc20_tests.rs
#	mm2src/lp_swap/taker_swap.rs
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great the huge refactoring!
I left a few questions and comments. Could you please answer them?

mm2src/coins/my_tx_history_v2.rs Show resolved Hide resolved
mm2src/coins/my_tx_history_v2.rs Show resolved Hide resolved
mm2src/coins/utxo/bch.rs Show resolved Hide resolved
mm2src/coins/utxo/bch_and_slp_tx_history.rs Show resolved Hide resolved
rust-toolchain.toml Show resolved Hide resolved
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@artemii235 artemii235 merged commit 383878a into dev Dec 28, 2021
@artemii235 artemii235 deleted the slp_tx_history branch December 28, 2021 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants