2074 Commits

Author SHA1 Message Date
Michael Mallan
da185361f9
sqlite: add helper to query single row 2024-11-28 14:56:15 +00:00
Michael Mallan
4f6dcbfdfd
sqlite: add columns to transactions and coins tables
The new columns in the transactions table will be populated for
new transactions by the poller, while existing rows will be
updated in a subsequent migration.

New and existing coins will all have `is_from_self` set to false
due to the default column value.

None of these columns will be used by the wallet at this stage.
2024-11-28 14:56:13 +00:00
Michael Mallan
f2c910f6eb
sqlite: refactor test to not depend on order of coins
I found that making changes to the transactions used in the test
can affect the order in which coins are returned, probably due
to the txid changing.
2024-11-28 08:56:08 +00:00
Michael Mallan
bde3299db1
sqlite: refactor migration tests
Some migration tests used structs and methods that are expected
to change and so will not be backward compatible.

This change replaces those with structs and methods specific to
the migration tests so that the tests will be unaffected by DB
schema changes. At the same time, these new structs and methods
simplify some of the setup by allowing to store new coins,
including their confirmation and spend status, in a single
DB operation.
2024-11-22 14:48:31 +00:00
edouardparis
e246305273
Merge #1481: Use a flake instead of shell nix
bd6e6f456b04b1ffb2a78e6232a3de34afb5ae4e Use a flake instead of shell nix (edouardparis)

Pull request description:

  A flake makes more sense for development with nix declarative systems.
  To launch the shell: do `nix develop`

ACKs for top commit:
  edouardparis:
    Self-ACK bd6e6f456b04b1ffb2a78e6232a3de34afb5ae4e

Tree-SHA512: e9d81ee2e7e6e08a7ea6eca3ae8c5b5d58de517dd5615d6c73578832bd1d2e1e9a9c99781079d48683268fd93647b8a95f70cfafabf818f08321410961ee38f0
2024-11-21 12:06:08 +01:00
edouardparis
bd6e6f456b Use a flake instead of shell nix 2024-11-21 11:50:57 +01:00
edouardparis
1f7c41ae5b
Merge #1476: Split liana into liana and lianad crates
da4c102a66c1f340797be13d70659b2f875c3438 Fix reproducible system to handle lianad crate (edouardparis)
74820d97e9257e44c5c9d3bc64926e30066b285a Split into lianad and liana crate (edouardparis)

Pull request description:

  This change introduce two crates:
  - `lianad` the crate responsible to create the `lianad` and `liana-cli` binaries and expose daemon modules for `liana-gui` to embed
  - `liana` the crate responsible for the descriptors and the core logic of the bitcoin scripts and spend transactions creation. This will allow multiple platforms and mediums to start manipulating these modules without importing all the daemon dependencies (like the database or bitcoin core clients).

ACKs for top commit:
  jp1ac4:
    ACK da4c102a66.

Tree-SHA512: 85a268b2bffe5fe7b54d7b1e452dd2097ae606b903e5684a7b0e996b61981ab222b6718fb19739a05d1153b4d48a85d0ec3e1e15f68afe17936eec80111ecf04
2024-11-19 19:02:57 +01:00
edouardparis
da4c102a66 Fix reproducible system to handle lianad crate 2024-11-19 18:01:25 +01:00
edouardparis
74820d97e9 Split into lianad and liana crate 2024-11-19 18:01:25 +01:00
edouardparis
36b24d4d81
Merge #1475: remove commands import in spend module
4668980ff12c1026bf3a1b3b520d1d38db8939cb remove commands import in spend module (edouardparis)

Pull request description:

  This is preparatory work to create a specific liana lib.
  We keep modules separated.

ACKs for top commit:
  edouardparis:
    Self-ACK 4668980ff12c1026bf3a1b3b520d1d38db8939cb

Tree-SHA512: 0c33ab252a2e8b5404893367467ea48dbed8d84b5de0cb15dcc91bf5491b8af0d6bddd4aafe55699e16dcd7cd97b96d462d004b1921a38ae5e438c908d515c03
2024-11-19 14:04:05 +01:00
edouardparis
4668980ff1 remove commands import in spend module 2024-11-19 13:30:43 +01:00
edouardparis
1454c11f41
Merge #1473: Update liana gui to import liana directly
6cefd2464a55fbfaea5c4e9a3a370fb034c5462e remove liana from vendored source link (edouardparis)
b0fbe0839d15914cf1d56d35184bdc49683adfd3 liana-gui: import liana with directory path (edouardparis)

Pull request description:

  We import directly liana with the directory path instead of the git url.

ACKs for top commit:
  edouardparis:
    Self-ACK 6cefd2464a55fbfaea5c4e9a3a370fb034c5462e

Tree-SHA512: a4ef7e0a8899751b6200f9753856ae6b6a9ddf1a0c1c8d8576238631b5bf33358d59a6988f8f26e153ee09824eb217df13590bdf82560d3889a99a123df9f0b0
2024-11-19 12:59:18 +01:00
edouardparis
6cefd2464a remove liana from vendored source link 2024-11-19 12:03:29 +01:00
edouardparis
b0fbe0839d liana-gui: import liana with directory path 2024-11-19 10:43:07 +01:00
edouardparis
9c6eae9ee4
Merge #1469: liana: remove daemon feature
c14c55beeea56655096eb873ba0bce4d37ccd6bb remove daemonize from config (edouardparis)
c8112ab02752f3f49e67452cc2ef5e628d6804ac move rpc code to its own module (edouardparis)
a636cda2f7f9925d44f7bde3069255b3cbc618ea liana: remove the daemon feature (edouardparis)

Pull request description:

  We expect user to use systemd service to manage a daemon or
  to handle their process by themself.

  The json-rpc server is exposed only for unix systems through
  unix sockets, it is moved to its own module while the implementation
  for windows is marked as TODO.

ACKs for top commit:
  jp1ac4:
    ACK c14c55beee.

Tree-SHA512: d4acafda399e9645cb5a80474a46290b6fac1e9695bb6ce04ce1eec7f68209ae67c70f858cd8f4d3ea5371818c2d5f68f9bcb3e4da349f5f86e53c0ec1123883
2024-11-19 10:27:39 +01:00
edouardparis
c14c55beee remove daemonize from config 2024-11-18 18:36:23 +01:00
edouardparis
c8112ab027 move rpc code to its own module 2024-11-18 18:36:23 +01:00
edouardparis
a636cda2f7 liana: remove the daemon feature
We expect user to use systemd service to manage a daemon or
to handle their process by themself.

The json-rpc server is exposed only for unix systems through
unix sockets, it is moved to its own module while the implementation
for windows is marked as TODO.
2024-11-18 18:36:23 +01:00
edouardparis
d83f34c876
Merge #1468: tests: notifyAll() is deprecated, replace w/ notify_all()
5c088b2eb69bdc6f868131a60c46ac4a219d2cb5 tests: notifyAll() is deprecated, replace w/ notify_all() (pythcoiner)

Pull request description:

  closes #1253

ACKs for top commit:
  edouardparis:
    ACK 5c088b2eb69bdc6f868131a60c46ac4a219d2cb5

Tree-SHA512: 86e87277b77aa3be3159cb4337bedaf5206cac6d1610e93c9ec0c4223e00791d121bdd49fc60a08e18c0d983e6c4e8efd76046bcab78459073101ae775f9c54e
2024-11-18 11:51:06 +01:00
pythcoiner
5c088b2eb6 tests: notifyAll() is deprecated, replace w/ notify_all() 2024-11-18 11:35:12 +01:00
edouardparis
1b00cdfd75
Merge #1452: descriptors: fix unsigned tx max satisfaction weight
e4ae6dc368d6600fbbdd5adaea1d52feb0f4b2a9 descriptors: include segwit marker and flag (Michael Mallan)
03a3230a67e9bf09e556d10550d9cdd08fb805d6 descriptors: add method to get max tx weight (Michael Mallan)

Pull request description:

  This fixes #1406, building on the fix from #1451 for estimating the weight of each input.

  An extra 2 is added to the unsigned transaction's weight to account for the Segwit marker and flag.

ACKs for top commit:
  edouardparis:
    utACK e4ae6dc368d6600fbbdd5adaea1d52feb0f4b2a9

Tree-SHA512: de78763d85ed38d5e2797d6f95b1ef293bbedf3cd4d5d1f69085bd134a117ae270a24c3487d738398191fb4126c4f8319bba53b902cec1625dad1c501f3f2aa9
2024-11-18 09:32:18 +01:00
edouardparis
35e2ffde53
Merge #1453: Update usage references
a36544c69e48796d8e2ef4526b7d9bef8862b9a6 Update usage references (Emmanuel Ferdman)

Pull request description:

  # PR Summary
  PR fixes the broken references found in the `doc/USAGE.md` file.

ACKs for top commit:
  jp1ac4:
    Tested ACK a36544c69e48796d8e2ef4526b7d9bef8862b9a6.

Tree-SHA512: 3f8df14c584f110b654d5f6d595b4c896c02f96261e837bbbd1d7f57759941e66b279069a0927700dec8fe438f08750246f7f74b570a0c44302eb89bc8779de1
2024-11-18 09:29:51 +01:00
edouardparis
27dce54c13
Merge #1437: gui: reload home if wallet is not syncing
71ad55e06bfc804754983debd7502db02b6bc524 gui: reload home if wallet is not syncing (Michael Mallan)

Pull request description:

  Following #1386, this PR will show past payments on the home page while the blockchain is still syncing. Currently, these are not loaded until the wallet has finished syncing.

  This change won't apply if the wallet itself is still syncing. The reason is that this is not expected to take so long and so it's better to wait for the updated data. Furthermore, the DB may be locked if the poller is running, in which case we wouldn't be able to load past transactions until the wallet has synced anyway. The home page reloads automatically as soon as the wallet finishes syncing.

ACKs for top commit:
  edouardparis:
    utACK 71ad55e06bfc804754983debd7502db02b6bc524

Tree-SHA512: 5fcf179ec859616ff1d7150597e73e20cb2ef0aa3ad882eeea37d6149754e58b44e37d6553ecb690a60383a95228f9724ec812dc4ae825d2620d377861c31e19
2024-11-18 09:22:08 +01:00
edouardparis
8e1831366d
Merge #1465: Use 2 decimal for sync progression in home page
5d65a4e1253a7f8312641523981ec90344ffb9ac Use 2 decimal for sync progression in home page (thomas)

Pull request description:

  Solves #907

ACKs for top commit:
  pythcoiner:
    ACK [5d65a4e](5d65a4e125)

Tree-SHA512: 677a132d42f426a37e30829e8a91bc6e7f258d3cfe808d4f0b5cadd1951b3cccd75527574200cf5e2319cf90e6ff5e6e88f387c457123cb9d556c81da458fe12
2024-11-18 09:16:52 +01:00
edouardparis
5133137d49
Merge #1425: gui(send): display max calculated amount w/ 8 decimals
7ab6d05f0bc0c00cfe9a160e8320f4c7de1ae212 gui(send): display max calculated amount w/ 8 decimals (pythcoiner)

Pull request description:

  fixes #1424
  ![image](https://github.com/user-attachments/assets/ffdfc45e-3162-4bc9-ae80-cd4379cb0981)

ACKs for top commit:
  edouardparis:
    utACK 7ab6d05f0bc0c00cfe9a160e8320f4c7de1ae212

Tree-SHA512: 9c4dc7f2ccf2a8c2e6b62a0d628f70bc9a357b70960d215b64d3c695e32610158ee875c78d41e6c942c87cc9fe9633f77e509056d4cf85614c98ee05bf926eab
2024-11-18 09:15:28 +01:00
edouardparis
326064b107
Merge #1153: clippyfy
376621abdfc15e7ee00286338c932298a980517c clippyfy (pythcoiner)

Pull request description:

  Clippy was yelling on Win10 & macOS:

  ![image](https://github.com/wizardsardine/liana/assets/124568858/5f1fe3b0-aaed-4056-8a4f-ce5ca5a9b6cb)

  ![image](https://github.com/wizardsardine/liana/assets/124568858/3ceddc7c-f2c1-43e5-a48d-82792de2fcb8)

ACKs for top commit:
  edouardparis:
    ACK 376621abdfc15e7ee00286338c932298a980517c

Tree-SHA512: 2f447176a1260fdcc11afcd1c3c7b444fb148bafc417e3244c3c8f3283ec272b90af5f997c66a226ccb7703a7f0ec70ee02a30801a35854aab97579028a0c478
2024-11-18 09:10:26 +01:00
pythcoiner
376621abdf clippyfy 2024-11-18 08:00:08 +01:00
pythcoiner
7ab6d05f0b gui(send): display max calculated amount w/ 8 decimals 2024-11-18 06:28:08 +01:00
thomas
5d65a4e125 Use 2 decimal for sync progression in home page 2024-11-15 17:18:36 +01:00
Michael Mallan
71ad55e06b
gui: reload home if wallet is not syncing 2024-11-15 13:47:23 +00:00
Michael Mallan
e4ae6dc368
descriptors: include segwit marker and flag 2024-11-15 13:44:31 +00:00
Michael Mallan
03a3230a67
descriptors: add method to get max tx weight
Errors in the weight calculation could be hidden when converting
to vbytes. This separate method will make it easier to spot any
such errors.
2024-11-15 13:44:28 +00:00
edouardparis
327f0ea665
Merge #1464: fix link logo in README.md
a8c3612d271c8a9e73010b04e6230e037e00d161 fix link logo in README.md (edouardparis)

Pull request description:

ACKs for top commit:
  edouardparis:
    Self-ACK a8c3612d271c8a9e73010b04e6230e037e00d161

Tree-SHA512: 105bd63245db514f2dc1914762858d61d04d3130ebbb73bbca6ee3c4a33e90c2ea0143e1581e6c8e6a6bfb3cbe6d339170b537809802635d23aadb537239a049
2024-11-15 13:48:32 +01:00
edouardparis
a8c3612d27 fix link logo in README.md 2024-11-15 13:47:06 +01:00
edouardparis
89a4187a80
Merge #1448: Refac workspace to follow rust guidelines.
6175ca7b58324a19ba7d8309fac4f18e6a07c178 fix doc (edouardparis)
f32b6aa30dc68623361f7884111707edd0bf3b42 fix the reproducible build to include the workspace change (edouardparis)
8973ee0c7c7b8df37378dde3f1a73b2447147200 fix test not building on windows (edouardparis)
f28b40fe8df967364f2201e3bea84c081b18cac6 fix fuzz, build and tests (edouardparis)
2ab6e40c9399942e2ef756f63e07ff76fb1496b9 refac workspace: move files (edouardparis)

Pull request description:

  This PR clarifies the rust workspace with its members:
  - `liana`: The `lianad` and `liana-cli` crate
  - `liana-gui`: The gui crate to build the graphical interface
  - `liana-ui`: A crate to quickly iterate on a design system

  It allows to have coordination across crates easier, consistent build and shared dependency versions.
  As a result the build processes in the guix container and the macos container are way faster as the dependencies are built only once.

  The overall MSRV is changed for rust 1.71.1, which is the `liana-gui` MSRV.
  Only one rust version is used for all the crates.

  This PR is also a change of vision of the project. The liana daemon is not used as it is. It is too much cumbersome. It should be at the service of the future applications and for now at the service of the GUI.
  The security aspects of the project should be aware of what the end user is using and in reality it is the `liana-gui` binary.

ACKs for top commit:
  pythcoiner:
    ACK 6175ca7b58324a19ba7d8309fac4f18e6a07c178
  jp1ac4:
    ACK 6175ca7b58.

Tree-SHA512: 4b193ed92d3108672d785b28ed54ff95168d365f163235b72cd7e24a7023a7293853ddb458930fb4640d7b1c60a8965e1b38cc060a426474d50b29e2eec4a6d2
2024-11-15 13:45:09 +01:00
edouardparis
6175ca7b58 fix doc 2024-11-15 13:26:13 +01:00
edouardparis
f32b6aa30d fix the reproducible build to include the workspace change 2024-11-15 13:26:13 +01:00
edouardparis
8973ee0c7c fix test not building on windows 2024-11-15 13:26:13 +01:00
edouardparis
f28b40fe8d fix fuzz, build and tests 2024-11-15 13:26:13 +01:00
edouardparis
2ab6e40c93 refac workspace: move files 2024-11-15 13:26:13 +01:00
edouardparis
cfe653f631
Merge #1451: descriptors: fix max satisfaction weight for Taproot multisig primary path spends
6e74a96e12feb00fcf0f6974f56002c0356e0960 Revert "spend: add 10 sats to fee for 1 sat/vb txs" (Michael Mallan)
cf88aca3aee0fed9a817dd4946db7ad3c1b080a7 descriptors: fix satisfaction size for Taproot (Michael Mallan)
e9c699570669e9723bec47b1fcd6df66257a8128 qa: add threshold paramater for multisig descs (Michael Mallan)

Pull request description:

  This is a fix to #1371 and the related #1322.

  As per https://github.com/wizardsardine/liana/issues/1371#issuecomment-2446921093, this adds the varint length for the script and control block elements of a Taproot primary path spend.

  I think this is what caused #1322 and so I have reverted the change from #1323.

ACKs for top commit:
  edouardparis:
    utACK 6e74a96e12feb00fcf0f6974f56002c0356e0960

Tree-SHA512: 754e5c2186de853cde9006aeab7989141a4d363b9e3d8adb3f0264bcbca7e3b56a94822d434f6f7d8108e7c0e3023959fa407643e5868082f8981c5ce10b9a1e
2024-11-15 13:21:40 +01:00
edouardparis
b46efc6cf4
Merge #1457: Fix blockchain sync progress
439af752a57410f4667664a2d5de93ddb9fa705e Fix blockchain sync precision, add tests (thomas)

Pull request description:

  I've merged `roundup_progress` in `rounded_up_progress` since was in utils and was no longer used by any other method.
  I also added some tests to verify the precision's update but also for specific cases that we manage. By the way tests has been moved in the related file.

  Solves #907

ACKs for top commit:
  pythcoiner:
    ACK 439af75
  jp1ac4:
    Tested ACK 439af752a5.

Tree-SHA512: a87998d1e25c47d751dabc38f641f05f2544bf17cbdcf95d24e829a0aa9dd8ce2de3bdc72a52aced04ffd777412ca206641f914d9a083241d98ceea33d4c10cc
2024-11-13 13:36:53 +01:00
thomas
439af752a5 Fix blockchain sync precision, add tests 2024-11-13 11:15:58 +01:00
edouardparis
387f431c3b
Merge #1459: gui(installer): fix typo in remote backend description
eba3b616b90bdafb6bc21e2c404f85d251f9f947 gui(installer): fix typo in remote backend description (pythcoiner)

Pull request description:

  closes #1458

ACKs for top commit:
  edouardparis:
    ACK eba3b616b90bdafb6bc21e2c404f85d251f9f947

Tree-SHA512: 226d8c57ce5b8f72c31cc13f079486b53419d8ec345ba87cc1b2ab1a4afd5d02be35f7baae46329a433217c9352ccd73182686160c3dc17dc08186321fac4540
2024-11-13 10:09:23 +01:00
pythcoiner
eba3b616b9 gui(installer): fix typo in remote backend description 2024-11-13 01:45:51 +01:00
Emmanuel Ferdman
a36544c69e
Update usage references
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2024-11-09 05:16:25 -08:00
Michael Mallan
6e74a96e12
Revert "spend: add 10 sats to fee for 1 sat/vb txs"
This reverts commit 74a53baa39c409d8a39a27affc5ebac34128cb24.

I also removed the extra sats being added in the functional test.
2024-11-08 15:27:25 +00:00
Michael Mallan
cf88aca3ae
descriptors: fix satisfaction size for Taproot
This includes the sizes of the script and control block elements.
2024-11-08 15:27:23 +00:00
Michael Mallan
e9c6995706
qa: add threshold paramater for multisig descs 2024-11-08 15:26:36 +00:00
edouardparis
f3206f9dfa
Merge #1446: gui(installer): list wallets using secondary buttons
ef55e8f01e65f67faff5bd2f07c2c1302d562dd9 gui(installer): list wallets using secondary buttons (Michael Mallan)

Pull request description:

  This is to fix #1445:

  ![image](https://github.com/user-attachments/assets/007ec779-f5b5-468b-825b-865106716f31)

ACKs for top commit:
  edouardparis:
    ACK ef55e8f01e65f67faff5bd2f07c2c1302d562dd9

Tree-SHA512: 4bad1cb94f43d69c0e4da79ce251ca73c529f1e093ab65b78a8054b187f9f7072d2527f112ecfe7670c279e275c9d16b183ac4c3ce2d62bd4896ce763b33df04
2024-11-07 11:11:09 +01:00