wizardsardine / liana

The missing safety net for your coins
https://wizardsardine.com/liana
BSD 3-Clause "New" or "Revised" License
329 stars 58 forks source link

Refac workspace to follow rust guidelines. #1448

Closed edouardparis closed 1 week ago

edouardparis commented 2 weeks ago

This PR clarifies the rust workspace with its members:

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.

pythcoiner commented 1 week ago

reviewed bc774e95 commit with this command to sort out move-only changes: git diff --diff-filter=M b46efc6 bc774e95

```diff diff --git a/Cargo.toml b/Cargo.toml index c348d97..fdb819a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,75 +1,7 @@ -[package] -name = "liana" -version = "8.0.0" -authors = ["Antoine Poinsot "] -edition = "2018" -repository = "https://github.com/wizardsardine/liana" -license-file = "LICENCE" -keywords = ["bitcoin", "wallet", "miniscript", "inheritance", "recovery"] -description = "Liana wallet daemon" -exclude = [".github/", ".cirrus.yml", "tests/", "test_data/", "contrib/", "pyproject.toml"] - -[[bin]] -name = "lianad" -path = "src/bin/daemon.rs" -required-features = ["daemon"] - -[[bin]] -name = "liana-cli" -path = "src/bin/cli.rs" -required-features = ["daemon"] - -[features] -default = ["daemon"] -daemon = ["libc"] -nonblocking_shutdown = [] - -[dependencies] -# For managing transactions (it re-exports the bitcoin crate) -miniscript = { version = "11.0", features = ["serde", "compiler", "base64"] } - -# Coin selection algorithms for spend transaction creation. -bdk_coin_select = "0.3" - -# For Electrum backend. This is the latest version with the same bitcoin version as -# the miniscript dependency. -bdk_electrum = { version = "0.14" } - -# Don't reinvent the wheel -dirs = "5.0" - -# We use TOML for the config, and JSON for RPC -serde = { version = "1.0", features = ["derive"] } -toml = "0.5" -serde_json = { version = "1.0", features = ["raw_value"] } - -# Logging stuff -log = "0.4" -fern = "0.6" - -# In order to have a backtrace on panic, because the -# stdlib does not have a programmatic interface yet -# to work with our custom panic hook. -backtrace = "0.3" - -# Pinned to this version because they keep breaking their MSRV in point releases... -# FIXME: this is unfortunate, we don't receive the updates (sometimes critical) from SQLite. -rusqlite = { version = "0.30", features = ["bundled", "unlock_notify"] } - -# To talk to bitcoind -jsonrpc = { version = "0.17", features = ["minreq_http"], default-features = false } - -# Used for daemonization -libc = { version = "0.2", optional = true } - -# Used for generating mnemonics -getrandom = "0.2" - -# Used for the hot signer -bip39 = "2.0" - -# Additional entropy for generating mnemonics -[target.'cfg(target_arch = "x86")'.dependencies] -rdrand = "0.8" -[target.'cfg(target_arch = "x86_64")'.dependencies] -rdrand = "0.8" +[workspace] +resolver = "2" +members = [ + "liana", + "liana-gui", + "liana-ui", +] ```
pythcoiner commented 1 week ago

Do you think the Python tests should be in liana/?

i think so, i'd keep the /tests folder to integrations tests implemented in rust if we want to do so in the future.

pythcoiner commented 1 week ago

ACK 6175ca7b58324a19ba7d8309fac4f18e6a07c178