Update sp-client to spdk

This commit is contained in:
Sosthene 2025-11-27 16:54:00 +01:00
parent 43b117bc9a
commit 0c8f4f0232
14 changed files with 35 additions and 35 deletions

View File

@ -8,7 +8,7 @@ crate-type = ["cdylib", "rlib"]
[features]
default = []
parallel = ["sp-client/parallel"]
parallel = ["spdk-core/parallel"]
blindbit-backend = ["backend-blindbit-native"]
blindbit-wasm = ["backend-blindbit-wasm", "dep:js-sys", "dep:serde-wasm-bindgen", "dep:futures"]
@ -23,9 +23,9 @@ serde_json = { version = "1.0.108" }
rs_merkle = "1.4.2"
zstd = "0.13.3"
getrandom = { version = "0.2", features = ["js"] }
sp-client = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", default-features = false }
backend-blindbit-native = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", optional = true }
backend-blindbit-wasm = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", optional = true }
spdk-core = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm" }
backend-blindbit-native = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm", optional = true }
backend-blindbit-wasm = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm", optional = true }
tsify = { git = "https://github.com/Sosthene00/tsify", branch = "next" }
wasm-bindgen = "0.2.91"

View File

@ -1,6 +1,6 @@
use anyhow::Result;
use rs_merkle::{algorithms::Sha256, MerkleProof};
use sp_client::silentpayments::{
use spdk_core::silentpayments::{
bitcoin_hashes::{sha256t_hash_newtype, Hash, HashEngine},
secp256k1::PublicKey,
};

View File

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
use tsify::Tsify;
use wasm_bindgen::prelude::*;
use sp_client::{
use spdk_core::{
bitcoin::{
absolute::Height, hashes::Hash, secp256k1::PublicKey, Amount, OutPoint, Transaction,
XOnlyPublicKey,

View File

@ -1,4 +1,4 @@
use sp_client::bitcoin::{
use spdk_core::bitcoin::{
consensus::{serialize, Encodable},
hashes::{sha256t_hash_newtype, Hash, HashEngine},
OutPoint,

View File

@ -8,7 +8,7 @@ pub use log;
pub use rand;
pub use serde;
pub use serde_json;
pub use sp_client;
pub use spdk_core;
pub use tsify;
pub use wasm_bindgen;
pub use zstd;

View File

@ -1,8 +1,8 @@
use anyhow::Result;
use rand::{thread_rng, RngCore};
use serde::{Deserialize, Serialize};
use sp_client::bitcoin::hex::DisplayHex;
use sp_client::bitcoin::OutPoint;
use spdk_core::bitcoin::hex::DisplayHex;
use spdk_core::bitcoin::OutPoint;
use tsify::Tsify;
use crate::error::AnkError;

View File

@ -9,7 +9,7 @@ use std::io::Write;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use sp_client::{
use spdk_core::{
bitcoin::{hashes::Hash, secp256k1::PublicKey, OutPoint},
silentpayments::SilentPaymentAddress,
};
@ -663,7 +663,7 @@ impl Roles {
#[cfg(test)]
mod tests {
use serde_json::json;
use sp_client::{
use spdk_core::{
bitcoin::{secp256k1::SecretKey, Network},
SpClient, SpendKey,
};

View File

@ -4,11 +4,11 @@ use anyhow::Result;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use sp_client::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey};
use sp_client::bitcoin::OutPoint;
use sp_client::silentpayments::SilentPaymentAddress;
use sp_client::SpClient;
use spdk_core::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
use spdk_core::bitcoin::secp256k1::{PublicKey, SecretKey};
use spdk_core::bitcoin::OutPoint;
use spdk_core::silentpayments::SilentPaymentAddress;
use spdk_core::SpClient;
use tsify::Tsify;
use crate::pcd::{Pcd, PcdCommitments, Roles};

View File

@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap, HashSet};
use std::sync::{Mutex, MutexGuard, OnceLock};
use serde::{Deserialize, Serialize};
use sp_client::{
use spdk_core::{
bitcoin::{OutPoint, Transaction},
silentpayments::SilentPaymentAddress,
};
@ -703,7 +703,7 @@ mod tests {
use std::str::FromStr;
use serde_json::{json, Value};
use sp_client::{
use spdk_core::{
bitcoin::{secp256k1::SecretKey, Network, Txid},
silentpayments::SilentPaymentAddress,
SpClient, SpendKey,

View File

@ -1,8 +1,8 @@
use crate::aes_gcm::aead::{Aead, Payload};
use crate::aes_gcm::Nonce;
use crate::crypto::{Aes256Gcm, AnkSharedSecretHash, KeyInit, AAD};
use crate::sp_client::bitcoin::hashes::Hash;
use crate::sp_client::silentpayments::SilentPaymentAddress;
use crate::spdk_core::bitcoin::hashes::Hash;
use crate::spdk_core::silentpayments::SilentPaymentAddress;
use anyhow::{Error, Result};
use serde::ser::SerializeStruct;
use serde::{Deserialize, Deserializer, Serialize, Serializer};

View File

@ -1,8 +1,8 @@
use crate::{pcd::Member, process::Process};
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use sp_client::bitcoin::hex::{DisplayHex, FromHex};
use sp_client::bitcoin::OutPoint;
use spdk_core::bitcoin::hex::{DisplayHex, FromHex};
use spdk_core::bitcoin::OutPoint;
use std::collections::{BTreeMap, HashMap};
use tsify::Tsify;

View File

@ -1,10 +1,10 @@
use anyhow::Result;
use rand::{thread_rng, RngCore};
use serde::{Deserialize, Serialize};
use sp_client::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
use sp_client::bitcoin::key::Secp256k1;
use sp_client::bitcoin::secp256k1::schnorr::Signature;
use sp_client::bitcoin::secp256k1::{Keypair, Message, PublicKey, SecretKey};
use spdk_core::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
use spdk_core::bitcoin::key::Secp256k1;
use spdk_core::bitcoin::secp256k1::schnorr::Signature;
use spdk_core::bitcoin::secp256k1::{Keypair, Message, PublicKey, SecretKey};
sha256t_hash_newtype! {
pub struct AnkMessageTag = hash_str("4nk/Message");

View File

@ -2,15 +2,15 @@ use std::collections::HashMap;
use anyhow::{Error, Result};
use serde::{Deserialize, Serialize};
use sp_client::bitcoin::absolute::Height;
use sp_client::bitcoin::hashes::Hash;
use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey};
use spdk_core::bitcoin::absolute::Height;
use spdk_core::bitcoin::hashes::Hash;
use spdk_core::bitcoin::secp256k1::{PublicKey, SecretKey};
use tsify::Tsify;
use rand::{thread_rng, Rng};
use sp_client::bitcoin::{Amount, BlockHash, OutPoint, Transaction, TxOut, Txid, XOnlyPublicKey};
use sp_client::silentpayments::utils::receiving::calculate_ecdh_shared_secret;
use sp_client::{
use spdk_core::bitcoin::{Amount, BlockHash, OutPoint, Transaction, TxOut, Txid, XOnlyPublicKey};
use spdk_core::silentpayments::utils::receiving::calculate_ecdh_shared_secret;
use spdk_core::{
FeeRate, OutputSpendStatus, OwnedOutput, Recipient, SilentPaymentUnsignedTransaction, SpClient,
};
@ -209,7 +209,7 @@ pub fn create_transaction(
}
recipients.push(Recipient {
address: sp_client::RecipientAddress::Data(commitment.to_vec()),
address: spdk_core::RecipientAddress::Data(commitment.to_vec()),
amount: Amount::ZERO,
});

View File

@ -1,7 +1,7 @@
use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::mem;
use sp_client::{
use spdk_core::{
bitcoin::{absolute::Height, BlockHash, OutPoint},
OwnedOutput, Updater,
};