Skip to content

Commit

Permalink
Use sp_client bitcoin dependency instead of direct import
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnet3 committed Sep 18, 2024
1 parent 1b7e6a8 commit 0353f19
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ hex = { version = "0.4.3", features = ["serde"] }
serde_with = "3.6.0"
log = "0.4.20"
simplelog = "0.12.1"
bitcoin = { version = "0.31.1", features = ["serde", "rand", "base64"] }
reqwest = { version = "0.12.4", features = ["rustls-tls"], default-features = false }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
pushtx = { git = "https://github.com/cygnet3/pushtx", branch = "master" }
Expand Down
3 changes: 2 additions & 1 deletion rust/src/api/psbt.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::{collections::HashMap, str::FromStr};

use bip39::rand::RngCore;
use bitcoin::{consensus::encode::serialize_hex, OutPoint, Psbt};
use log::info;
use pushtx::Network;
use sp_client::bitcoin;
use sp_client::bitcoin::{consensus::encode::serialize_hex, OutPoint, Psbt};
use sp_client::spclient::{SpClient, SpWallet};

use super::structs::{Amount, OwnedOutput, Recipient};
Expand Down
2 changes: 1 addition & 1 deletion rust/src/api/structs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashMap, str::FromStr};

use bitcoin::{absolute::Height, OutPoint, Txid};
use serde::{Deserialize, Serialize};
use sp_client::bitcoin::{self, absolute::Height, OutPoint, Txid};

type SpendingTxId = String;
type MinedInBlock = String;
Expand Down
4 changes: 2 additions & 2 deletions rust/src/api/wallet.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use std::str::FromStr;

use anyhow::{Error, Result};
use bitcoin::{
use reqwest::Url;
use sp_client::bitcoin::{
absolute::Height,
secp256k1::{PublicKey, SecretKey},
Network, OutPoint, Txid,
};
use reqwest::Url;
use sp_client::spclient::{derive_keys_from_seed, SpClient, SpWallet, SpendKey};

use crate::blindbit;
Expand Down
2 changes: 1 addition & 1 deletion rust/src/blindbit/client.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![allow(dead_code)]
use std::time::Duration;

use bitcoin::{secp256k1::PublicKey, BlockHash, ScriptBuf, Txid};
use reqwest::{Client, Url};
use serde::Deserialize;
use sp_client::bitcoin::{secp256k1::PublicKey, BlockHash, ScriptBuf, Txid};

use anyhow::Result;

Expand Down
8 changes: 4 additions & 4 deletions rust/src/blindbit/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ use std::{
};

use anyhow::{Error, Result};
use bitcoin::{
use futures::{stream, StreamExt};
use log::info;
use reqwest::Url;
use sp_client::bitcoin::{
absolute::Height,
bip158::BlockFilter,
hashes::{sha256, Hash},
secp256k1::{PublicKey, Scalar},
Amount, BlockHash, OutPoint, Txid, XOnlyPublicKey,
};
use futures::{stream, StreamExt};
use log::info;
use reqwest::Url;
use sp_client::spclient::{OutputSpendStatus, OwnedOutput, SpClient};
use sp_client::{
silentpayments::receiving::Label,
Expand Down

0 comments on commit 0353f19

Please sign in to comment.