Repository: wizardsardine/liana
Pull request #931 (2024-01-23 10:51:12)

gui: async-hwi 0.0.14


Patch:
diff --git a/doc/API.md b/doc/API.md
index e0ea64d2..d629bc7c 100644
--- a/doc/API.md
+++ b/doc/API.md
@@ -53,15 +53,14 @@ This command does not take any parameter for now.
 
 #### Response
 
-| Field                | Type          | Description                                                                                  |
-| -------------------- | ------------- | -------------------------------------------------------------------------------------------- |
+| Field                | Type    | Description                                                                                        |
+| -------------------- | ------- | -------------------------------------------------------------------------------------------------- |
 | `version`            | string        | Version following the [SimVer](http://www.simver.org/) format                                |
 | `network`            | string        | Answer can be `mainnet`, `testnet`, `regtest`                                                |
 | `block_height`       | integer       | The block height we are synced at.                                                           |
 | `sync`               | float         | The synchronization progress as percentage (`0 < sync < 1`)                                  |
 | `descriptors`        | object        | Object with the name of the descriptor as key and the descriptor string as value             |
 | `rescan_progress`    | float or null | Progress of an ongoing rescan as a percentage (between 0 and 1) if there is any              |
-| `timestamp`          | integer       | Unix timestamp of wallet creation date                                                       |
 
 ### `getnewaddress`
 
diff --git a/gui/Cargo.lock b/gui/Cargo.lock
index dac79185..17f0f2bd 100644
--- a/gui/Cargo.lock
+++ b/gui/Cargo.lock
@@ -224,8 +224,9 @@ dependencies = [
 
 [[package]]
 name = "async-hwi"
-version = "0.0.13"
-source = "git+https://github.com/wizardsardine/async-hwi?branch=master#beea72ddc4f8db8d64bea2cf5c4a4d327148222f"
+version = "0.0.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38b9ba5d4bd59fea79a70a375da2fe077b2b17ce26ace805d6939275719ad66e"
 dependencies = [
  "async-trait",
  "bitbox-api",
@@ -365,8 +366,9 @@ checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
 
 [[package]]
 name = "bitbox-api"
-version = "0.2.2"
-source = "git+https://github.com/edouardparis/bitbox-api-rs.git?branch=bitcoin-0.31#4591054a26eb3b9a12a9bc22d600b5cd6a81561d"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1c0e1d593628bd289304902364f69c24686734d1825c54e03d89e003aa87b4f"
 dependencies = [
  "async-trait",
  "base32",
diff --git a/gui/Cargo.toml b/gui/Cargo.toml
index f0c025c2..09d471c1 100644
--- a/gui/Cargo.toml
+++ b/gui/Cargo.toml
@@ -14,7 +14,7 @@ name = "liana-gui"
 path = "src/main.rs"
 
 [dependencies]
-async-hwi = { git = "https://github.com/wizardsardine/async-hwi", branch = "master"}
+async-hwi = "0.0.14"
 liana = { git = "https://github.com/wizardsardine/liana", branch = "master", default-features = false, features = ["nonblocking_shutdown"] }
 liana_ui = { path = "ui" }
 backtrace = "0.3"
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index d4fecbc4..751726fa 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -294,7 +294,6 @@ impl DaemonControl {
                 main: self.config.main_descriptor.clone(),
             },
             rescan_progress,
-            timestamp: db_conn.timestamp(),
         }
     }
 
@@ -1031,8 +1030,6 @@ pub struct GetInfoResult {
     pub descriptors: GetInfoDescriptors,
     /// The progress as a percentage (between 0 and 1) of an ongoing rescan if there is any
     pub rescan_progress: Option<f64>,
-    /// Timestamp at wallet creation date
-    pub timestamp: u32,
 }
 
 #[derive(Debug, Clone, Serialize, Deserialize)]
diff --git a/src/database/mod.rs b/src/database/mod.rs
index 050581d5..9c2be7c6 100644
--- a/src/database/mod.rs
+++ b/src/database/mod.rs
@@ -46,9 +46,6 @@ pub trait DatabaseConnection {
     /// The network we are operating on.
     fn network(&mut self) -> bitcoin::Network;
 
-    /// The timestamp at wallet creation time
-    fn timestamp(&mut self) -> u32;
-
     /// Update our best chain seen.
     fn update_tip(&mut self, tip: &BlockChainTip);
 
@@ -164,10 +161,6 @@ impl DatabaseConnection for SqliteConn {
         self.db_tip().network
     }
 
-    fn timestamp(&mut self) -> u32 {
-        self.db_wallet().timestamp
-    }
-
     fn update_tip(&mut self, tip: &BlockChainTip) {
         self.update_tip(tip)
     }


Test patch:
diff --git a/src/testutils.rs b/src/testutils.rs
index 9034aaec..c175c156 100644
--- a/src/testutils.rs
+++ b/src/testutils.rs
@@ -5,13 +5,11 @@ use crate::{
     descriptors, DaemonHandle,
 };
 
-use std::convert::TryInto;
 use std::{
     collections::{HashMap, HashSet},
     env, fs, io, path, process,
     str::FromStr,
     sync, thread, time,
-    time::{SystemTime, UNIX_EPOCH},
 };
 
 use miniscript::{
@@ -131,7 +129,6 @@ struct DummyDbState {
     curr_tip: Option<BlockChainTip>,
     coins: HashMap<bitcoin::OutPoint, Coin>,
     spend_txs: HashMap<bitcoin::Txid, (Psbt, Option<u32>)>,
-    timestamp: u32,
 }
 
 pub struct DummyDatabase {
@@ -148,13 +145,6 @@ impl DatabaseInterface for DummyDatabase {
 
 impl DummyDatabase {
     pub fn new() -> DummyDatabase {
-        let now: u32 = SystemTime::now()
-            .duration_since(UNIX_EPOCH)
-            .unwrap()
-            .as_secs()
-            .try_into()
-            .unwrap();
-
         DummyDatabase {
             db: sync::Arc::new(sync::RwLock::new(DummyDbState {
                 deposit_index: 0.into(),
@@ -162,7 +152,6 @@ impl DummyDatabase {
                 curr_tip: None,
                 coins: HashMap::new(),
                 spend_txs: HashMap::new(),
-                timestamp: now,
             })),
         }
     }
@@ -183,10 +172,6 @@ impl DatabaseConnection for DummyDatabase {
         self.db.read().unwrap().curr_tip
     }
 
-    fn timestamp(&mut self) -> u32 {
-        self.db.read().unwrap().timestamp
-    }
-
     fn update_tip(&mut self, tip: &BlockChainTip) {
         self.db.write().unwrap().curr_tip = Some(*tip);
     }
diff --git a/tests/test_rpc.py b/tests/test_rpc.py
index 18476c97..65c26429 100644
--- a/tests/test_rpc.py
+++ b/tests/test_rpc.py
@@ -22,7 +22,6 @@ from test_framework.utils import (
 
 def test_getinfo(lianad):
     res = lianad.rpc.getinfo()
-    assert 'timestamp' in res.keys()
     assert res["version"] == "4.0.0-dev"
     assert res["network"] == "regtest"
     wait_for(lambda: lianad.rpc.getinfo()["block_height"] == 101)