Skip to content

Wallet sqlite#272

Draft
Sosthene00 wants to merge 22 commits intodevfrom
wallet_sqlite
Draft

Wallet sqlite#272
Sosthene00 wants to merge 22 commits intodevfrom
wallet_sqlite

Conversation

@Sosthene00
Copy link
Collaborator

The goal of this PR is to use the sqlite database that we added for Contacts to store UTXOs we have in the wallet and transaction history. Both are stored in Storage now, which is cumbersome and will become a problem when users have a lot of transactions and utxos in their wallet.

  • We rely on a still unmerged change in spdk that replace SpendStatus with SpendInfo
  • We remove a lot of back and forth between Dart and Rust during scanning that were kind of unnecessary. That also allows us to remove a lot of code in Rust that was mostly boilerplate anyway.
  • We defined the sql tables for owned_outputs that mostly copy the rust object
  • We think that it's better to use 2 tables for incoming and outgoing transactions, data structure differs significantly from rust.

TODO:

  • backup is being broken by this update and needs to be fixed (maybe in a followup PR)
  • We still keep a minimal TxHistory to be able to handle upgrade from previous version of Dana that saved data in Storage. Maybe that could be removed at some point in the future.

Hardcode a default `DateTime` for all network, 1st June of 2025 for now.
* `getBlockForHash`: needed to retrieve the timestamp of a block
* `getBlockHashForHeight`: retrieve the block hash from its height
* `getBlockFromTimestamp`: used to get the height of the closest block from a timestamp
Add `toSeconds()` method to `DateTime` and a `toDate()` method to `int`
Birthday becomes a DateTime (stored as unix timestamp) instead of a block height integer. Includes migration logic for existing wallets that still have a block height stored.
* add a ticker box on Seed Phrase Recovery screen
* if ticked open birthday picker
* if user does'nt provice a birthday set network default
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.

1 participant