Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matthias/sqlx #11

Open
wants to merge 29 commits into
base: matthias/sqlx
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7b5657e
docs(electrum): enhance API docs for fetch_prev_txouts argument
thunderbiscuit Jun 28, 2024
f965f95
feat: enable selecting use-rustls-ring feature on electrum client
thunderbiscuit Jun 26, 2024
1adf63c
fix(example_cli): add bitcoin and rand dependencies
notmandatory Aug 12, 2024
3675a9e
ci: add job to build example-crates independently
notmandatory Aug 12, 2024
9db0d19
Merge bitcoindevkit/bdk#1494: Add documentation for Electrum's full_s…
evanlinjin Aug 13, 2024
74b24d3
Merge bitcoindevkit/bdk#1491: Enable selecting use-rustls-ring featur…
notmandatory Aug 13, 2024
75155b7
feat(wallet): Add method `Wallet::create_single`
ValuedMammal Aug 6, 2024
31f1c2d
fix(wallet): Change FromSql type to `Option<_>`
ValuedMammal Aug 6, 2024
2ca8b6f
test(wallet): Add tests for single descriptor wallet
ValuedMammal Aug 6, 2024
b802714
example(wallet): simplify miniscript compiler example
ValuedMammal Aug 6, 2024
3951110
fix(wallet)!: Change method `LoadParams::descriptors`
ValuedMammal Aug 9, 2024
13e7008
doc(wallet): clarify docs for `Wallet::load`
ValuedMammal Aug 14, 2024
76aec62
Merge bitcoindevkit/bdk#1533: [wallet] Enable support for single desc…
evanlinjin Aug 14, 2024
cad3533
feat(esplora): make ext traits more flexible
evanlinjin Jun 16, 2024
c93e6fd
feat(esplora): always fetch prevouts
evanlinjin Jul 2, 2024
16c1c2c
docs(esplora): Simplify crate docs
evanlinjin Jul 21, 2024
44e2a79
feat!: rework `FullScanRequest` and `SyncRequest`
evanlinjin Aug 1, 2024
38f86fe
fix: no premature collect
evanlinjin Aug 2, 2024
0234f70
docs(esplora): Fix typo
evanlinjin Aug 3, 2024
96023c0
docs(chain): improve `SyncRequestBuilder::spks_with_labels` docs
evanlinjin Aug 12, 2024
3eb5dd1
fix(chain): correct `Iterator::size_hint` impl
evanlinjin Aug 12, 2024
584b10a
docs(esplora): README example, uncomment async import
evanlinjin Aug 12, 2024
6d77e2e
refactor(chain)!: Rename `spks_with_labels` to `spks_with_indices`
evanlinjin Aug 13, 2024
cc84872
Merge bitcoindevkit/bdk#1478: Allow opting out of getting `LocalChain…
notmandatory Aug 14, 2024
2391b76
refactor(wallet)!: rename LoadParams methods
thunderbiscuit Aug 6, 2024
9695296
Merge bitcoindevkit/bdk#1537: Use explicit names for wallet builder m…
notmandatory Aug 14, 2024
e0822d7
Merge bitcoindevkit/bdk#1549: fix(example_cli): add bitcoin and rand …
notmandatory Aug 14, 2024
295b979
fix(wallet)!: make `LoadParams` implicitly satisfy `Send`
evanlinjin Aug 16, 2024
857c03c
sqlx lifetimes issue
matthiasdebernardini Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,32 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings

build-examples:
name: Build Examples
runs-on: ubuntu-latest
strategy:
matrix:
example-dir:
- example_cli
- example_bitcoind_rpc_polling
- example_electrum
- example_esplora
- wallet_electrum
- wallet_esplora_async
- wallet_esplora_blocking
- wallet_rpc
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Build
working-directory: example-crates/${{ matrix.example-dir }}
run: cargo build
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"example-crates/wallet_electrum",
"example-crates/wallet_esplora_blocking",
"example-crates/wallet_esplora_async",
"example-crates/wallet_esplora_async_sqlx",
"example-crates/wallet_rpc",
]

Expand Down
2 changes: 2 additions & 0 deletions crates/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ miniscript = { version = "12.0.0", optional = true, default-features = false }
# Feature dependencies
rusqlite = { version = "0.31.0", features = ["bundled"], optional = true }
serde_json = {version = "1", optional = true }
sqlx = { version = "0.8.0", default-features = false, features = ["runtime-tokio-rustls", "postgres", "json", "chrono", "uuid", "sqlx-macros", "migrate"], optional= true }

[dev-dependencies]
rand = "0.8"
Expand All @@ -33,3 +34,4 @@ default = ["std", "miniscript"]
std = ["bitcoin/std", "miniscript?/std"]
serde = ["dep:serde", "bitcoin/serde", "miniscript?/serde"]
rusqlite = ["std", "dep:rusqlite", "serde", "serde_json"]
sqlx = ["std", "dep:sqlx", "serde", "serde_json"]
11 changes: 11 additions & 0 deletions crates/chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ pub use indexer::keychain_txout;
pub use spk_iter::*;
#[cfg(feature = "rusqlite")]
pub mod rusqlite_impl;
#[cfg(feature = "sqlx")]
pub mod sqlx_impl;
pub mod spk_client;

#[allow(unused_imports)]
#[macro_use]
extern crate alloc;
#[cfg(feature = "rusqlite")]
pub extern crate rusqlite;
#[cfg(feature = "sqlx")]
pub extern crate sqlx;
#[cfg(feature = "serde")]
pub extern crate serde;

Expand Down Expand Up @@ -113,6 +117,13 @@ pub type KeychainIndexed<K, T> = ((K, u32), T);
/// A wrapper that we use to impl remote traits for types in our crate or dependency crates.
pub struct Impl<T>(pub T);

impl<T> Impl<T> {
/// Returns the inner `T`.
pub fn into_inner(self) -> T {
self.0
}
}

impl<T> From<T> for Impl<T> {
fn from(value: T) -> Self {
Self(value)
Expand Down
2 changes: 1 addition & 1 deletion crates/chain/src/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub trait PersistWith<Db>: Staged + Sized {
) -> Result<(), Self::PersistError>;
}

type FutureResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'a>>;
pub type FutureResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'a>>;

/// Trait that persists the type with an async `Db`.
pub trait PersistAsyncWith<Db>: Staged + Sized {
Expand Down
Loading