From: github-actions Date: Sun, 5 Jun 2022 17:31:03 +0000 (+0000) Subject: Publish autogenerated nightly docs X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CodeLengthError.html?a=commitdiff_plain;h=d9103daec161d4e6eb764ae418175ca9da4f484a;p=bitcoindevkit.org Publish autogenerated nightly docs --- diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/database/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/database/index.html index 1930cb485e..8fce81499f 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/database/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/database/index.html @@ -6,7 +6,7 @@ logo

Module database

logo
-

Module bdk::database

source · []
Expand description

Database types

+

Module bdk::database

source · []
Expand description

Database types

This module provides the implementation of some defaults database types, along with traits that can be implemented externally to let Wallets use customized databases.

It’s important to note that the databases defined here only contains “blockchain-related” data. diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/mod.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/mod.rs.html index 58a75a025e..f245b588bc 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/mod.rs.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/mod.rs.html @@ -429,6 +429,34 @@ 422 423 424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452

// Bitcoin Dev Kit
 // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
 //
@@ -807,6 +835,34 @@
         );
     }
 
+    pub fn test_list_transaction<D: Database>(mut tree: D) {
+        let hex_tx = Vec::<u8>::from_hex("0100000001a15d57094aa7a21a28cb20b59aab8fc7d1149a3bdbcddba9c622e4f5f6a99ece010000006c493046022100f93bb0e7d8db7bd46e40132d1f8242026e045f03a0efe71bbb8e3f475e970d790221009337cd7f1f929f00cc6ff01f03729b069a7c21b59b1736ddfee5db5946c5da8c0121033b9b137ee87d5a812d6f506efdd37f0affa7ffc310711c06c7f3e097c9447c52ffffffff0100e1f505000000001976a9140389035a9225b3839e2bbf32d826a1e222031fd888ac00000000").unwrap();
+        let tx: Transaction = deserialize(&hex_tx).unwrap();
+        let txid = tx.txid();
+        let mut tx_details = TransactionDetails {
+            transaction: Some(tx),
+            txid,
+            received: 1337,
+            sent: 420420,
+            fee: Some(140),
+            confirmation_time: Some(BlockTime {
+                timestamp: 123456,
+                height: 1000,
+            }),
+        };
+
+        tree.set_tx(&tx_details).unwrap();
+
+        // get raw tx
+        assert_eq!(tree.iter_txs(true).unwrap(), vec![tx_details.clone()]);
+
+        // now get without raw tx
+        tx_details.transaction = None;
+
+        // get not raw tx
+        assert_eq!(tree.iter_txs(false).unwrap(), vec![tx_details.clone()]);
+    }
+
     pub fn test_last_index<D: Database>(mut tree: D) {
         tree.set_last_index(KeychainKind::External, 1337).unwrap();
 
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/sqlite.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/sqlite.rs.html
index 4958db56f4..c3af715da1 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/sqlite.rs.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/database/sqlite.rs.html
@@ -1038,6 +1038,11 @@
 1031
 1032
 1033
+1034
+1035
+1036
+1037
+1038
 
// Bitcoin Dev Kit
 // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
 //
@@ -1440,7 +1445,7 @@
             let sent: u64 = row.get(3)?;
             let fee: Option<u64> = row.get(4)?;
             let height: Option<u32> = row.get(5)?;
-            let raw_tx: Option<Vec<u8>> = row.get(7)?;
+            let raw_tx: Option<Vec<u8>> = row.get(6)?;
             let tx: Option<Transaction> = match raw_tx {
                 Some(raw_tx) => {
                     let tx: Transaction = deserialize(&raw_tx)?;
@@ -2070,6 +2075,11 @@
     fn test_sync_time() {
         crate::database::test::test_sync_time(get_database());
     }
+
+    #[test]
+    fn test_txs() {
+        crate::database::test::test_list_transaction(get_database());
+    }
 }