Update sp-client to spdk
This commit is contained in:
parent
43b117bc9a
commit
0c8f4f0232
@ -8,7 +8,7 @@ crate-type = ["cdylib", "rlib"]
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
parallel = ["sp-client/parallel"]
|
parallel = ["spdk-core/parallel"]
|
||||||
blindbit-backend = ["backend-blindbit-native"]
|
blindbit-backend = ["backend-blindbit-native"]
|
||||||
blindbit-wasm = ["backend-blindbit-wasm", "dep:js-sys", "dep:serde-wasm-bindgen", "dep:futures"]
|
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"
|
rs_merkle = "1.4.2"
|
||||||
zstd = "0.13.3"
|
zstd = "0.13.3"
|
||||||
getrandom = { version = "0.2", features = ["js"] }
|
getrandom = { version = "0.2", features = ["js"] }
|
||||||
sp-client = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", default-features = false }
|
spdk-core = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm" }
|
||||||
backend-blindbit-native = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", optional = true }
|
backend-blindbit-native = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm", optional = true }
|
||||||
backend-blindbit-wasm = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", 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" }
|
tsify = { git = "https://github.com/Sosthene00/tsify", branch = "next" }
|
||||||
wasm-bindgen = "0.2.91"
|
wasm-bindgen = "0.2.91"
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use rs_merkle::{algorithms::Sha256, MerkleProof};
|
use rs_merkle::{algorithms::Sha256, MerkleProof};
|
||||||
use sp_client::silentpayments::{
|
use spdk_core::silentpayments::{
|
||||||
bitcoin_hashes::{sha256t_hash_newtype, Hash, HashEngine},
|
bitcoin_hashes::{sha256t_hash_newtype, Hash, HashEngine},
|
||||||
secp256k1::PublicKey,
|
secp256k1::PublicKey,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use tsify::Tsify;
|
use tsify::Tsify;
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
use sp_client::{
|
use spdk_core::{
|
||||||
bitcoin::{
|
bitcoin::{
|
||||||
absolute::Height, hashes::Hash, secp256k1::PublicKey, Amount, OutPoint, Transaction,
|
absolute::Height, hashes::Hash, secp256k1::PublicKey, Amount, OutPoint, Transaction,
|
||||||
XOnlyPublicKey,
|
XOnlyPublicKey,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use sp_client::bitcoin::{
|
use spdk_core::bitcoin::{
|
||||||
consensus::{serialize, Encodable},
|
consensus::{serialize, Encodable},
|
||||||
hashes::{sha256t_hash_newtype, Hash, HashEngine},
|
hashes::{sha256t_hash_newtype, Hash, HashEngine},
|
||||||
OutPoint,
|
OutPoint,
|
||||||
|
|||||||
@ -8,7 +8,7 @@ pub use log;
|
|||||||
pub use rand;
|
pub use rand;
|
||||||
pub use serde;
|
pub use serde;
|
||||||
pub use serde_json;
|
pub use serde_json;
|
||||||
pub use sp_client;
|
pub use spdk_core;
|
||||||
pub use tsify;
|
pub use tsify;
|
||||||
pub use wasm_bindgen;
|
pub use wasm_bindgen;
|
||||||
pub use zstd;
|
pub use zstd;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use rand::{thread_rng, RngCore};
|
use rand::{thread_rng, RngCore};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sp_client::bitcoin::hex::DisplayHex;
|
use spdk_core::bitcoin::hex::DisplayHex;
|
||||||
use sp_client::bitcoin::OutPoint;
|
use spdk_core::bitcoin::OutPoint;
|
||||||
use tsify::Tsify;
|
use tsify::Tsify;
|
||||||
|
|
||||||
use crate::error::AnkError;
|
use crate::error::AnkError;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ use std::io::Write;
|
|||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use sp_client::{
|
use spdk_core::{
|
||||||
bitcoin::{hashes::Hash, secp256k1::PublicKey, OutPoint},
|
bitcoin::{hashes::Hash, secp256k1::PublicKey, OutPoint},
|
||||||
silentpayments::SilentPaymentAddress,
|
silentpayments::SilentPaymentAddress,
|
||||||
};
|
};
|
||||||
@ -663,7 +663,7 @@ impl Roles {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use sp_client::{
|
use spdk_core::{
|
||||||
bitcoin::{secp256k1::SecretKey, Network},
|
bitcoin::{secp256k1::SecretKey, Network},
|
||||||
SpClient, SpendKey,
|
SpClient, SpendKey,
|
||||||
};
|
};
|
||||||
|
|||||||
10
src/prd.rs
10
src/prd.rs
@ -4,11 +4,11 @@ use anyhow::Result;
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use serde_json::{Map, Value};
|
use serde_json::{Map, Value};
|
||||||
use sp_client::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
|
use spdk_core::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
|
||||||
use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey};
|
use spdk_core::bitcoin::secp256k1::{PublicKey, SecretKey};
|
||||||
use sp_client::bitcoin::OutPoint;
|
use spdk_core::bitcoin::OutPoint;
|
||||||
use sp_client::silentpayments::SilentPaymentAddress;
|
use spdk_core::silentpayments::SilentPaymentAddress;
|
||||||
use sp_client::SpClient;
|
use spdk_core::SpClient;
|
||||||
use tsify::Tsify;
|
use tsify::Tsify;
|
||||||
|
|
||||||
use crate::pcd::{Pcd, PcdCommitments, Roles};
|
use crate::pcd::{Pcd, PcdCommitments, Roles};
|
||||||
|
|||||||
@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap, HashSet};
|
|||||||
use std::sync::{Mutex, MutexGuard, OnceLock};
|
use std::sync::{Mutex, MutexGuard, OnceLock};
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sp_client::{
|
use spdk_core::{
|
||||||
bitcoin::{OutPoint, Transaction},
|
bitcoin::{OutPoint, Transaction},
|
||||||
silentpayments::SilentPaymentAddress,
|
silentpayments::SilentPaymentAddress,
|
||||||
};
|
};
|
||||||
@ -703,7 +703,7 @@ mod tests {
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use sp_client::{
|
use spdk_core::{
|
||||||
bitcoin::{secp256k1::SecretKey, Network, Txid},
|
bitcoin::{secp256k1::SecretKey, Network, Txid},
|
||||||
silentpayments::SilentPaymentAddress,
|
silentpayments::SilentPaymentAddress,
|
||||||
SpClient, SpendKey,
|
SpClient, SpendKey,
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
use crate::aes_gcm::aead::{Aead, Payload};
|
use crate::aes_gcm::aead::{Aead, Payload};
|
||||||
use crate::aes_gcm::Nonce;
|
use crate::aes_gcm::Nonce;
|
||||||
use crate::crypto::{Aes256Gcm, AnkSharedSecretHash, KeyInit, AAD};
|
use crate::crypto::{Aes256Gcm, AnkSharedSecretHash, KeyInit, AAD};
|
||||||
use crate::sp_client::bitcoin::hashes::Hash;
|
use crate::spdk_core::bitcoin::hashes::Hash;
|
||||||
use crate::sp_client::silentpayments::SilentPaymentAddress;
|
use crate::spdk_core::silentpayments::SilentPaymentAddress;
|
||||||
use anyhow::{Error, Result};
|
use anyhow::{Error, Result};
|
||||||
use serde::ser::SerializeStruct;
|
use serde::ser::SerializeStruct;
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
use crate::{pcd::Member, process::Process};
|
use crate::{pcd::Member, process::Process};
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
use sp_client::bitcoin::hex::{DisplayHex, FromHex};
|
use spdk_core::bitcoin::hex::{DisplayHex, FromHex};
|
||||||
use sp_client::bitcoin::OutPoint;
|
use spdk_core::bitcoin::OutPoint;
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
use tsify::Tsify;
|
use tsify::Tsify;
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use rand::{thread_rng, RngCore};
|
use rand::{thread_rng, RngCore};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sp_client::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
|
use spdk_core::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
|
||||||
use sp_client::bitcoin::key::Secp256k1;
|
use spdk_core::bitcoin::key::Secp256k1;
|
||||||
use sp_client::bitcoin::secp256k1::schnorr::Signature;
|
use spdk_core::bitcoin::secp256k1::schnorr::Signature;
|
||||||
use sp_client::bitcoin::secp256k1::{Keypair, Message, PublicKey, SecretKey};
|
use spdk_core::bitcoin::secp256k1::{Keypair, Message, PublicKey, SecretKey};
|
||||||
|
|
||||||
sha256t_hash_newtype! {
|
sha256t_hash_newtype! {
|
||||||
pub struct AnkMessageTag = hash_str("4nk/Message");
|
pub struct AnkMessageTag = hash_str("4nk/Message");
|
||||||
|
|||||||
@ -2,15 +2,15 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use anyhow::{Error, Result};
|
use anyhow::{Error, Result};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sp_client::bitcoin::absolute::Height;
|
use spdk_core::bitcoin::absolute::Height;
|
||||||
use sp_client::bitcoin::hashes::Hash;
|
use spdk_core::bitcoin::hashes::Hash;
|
||||||
use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey};
|
use spdk_core::bitcoin::secp256k1::{PublicKey, SecretKey};
|
||||||
use tsify::Tsify;
|
use tsify::Tsify;
|
||||||
|
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use sp_client::bitcoin::{Amount, BlockHash, OutPoint, Transaction, TxOut, Txid, XOnlyPublicKey};
|
use spdk_core::bitcoin::{Amount, BlockHash, OutPoint, Transaction, TxOut, Txid, XOnlyPublicKey};
|
||||||
use sp_client::silentpayments::utils::receiving::calculate_ecdh_shared_secret;
|
use spdk_core::silentpayments::utils::receiving::calculate_ecdh_shared_secret;
|
||||||
use sp_client::{
|
use spdk_core::{
|
||||||
FeeRate, OutputSpendStatus, OwnedOutput, Recipient, SilentPaymentUnsignedTransaction, SpClient,
|
FeeRate, OutputSpendStatus, OwnedOutput, Recipient, SilentPaymentUnsignedTransaction, SpClient,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ pub fn create_transaction(
|
|||||||
}
|
}
|
||||||
|
|
||||||
recipients.push(Recipient {
|
recipients.push(Recipient {
|
||||||
address: sp_client::RecipientAddress::Data(commitment.to_vec()),
|
address: spdk_core::RecipientAddress::Data(commitment.to_vec()),
|
||||||
amount: Amount::ZERO,
|
amount: Amount::ZERO,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use sp_client::{
|
use spdk_core::{
|
||||||
bitcoin::{absolute::Height, BlockHash, OutPoint},
|
bitcoin::{absolute::Height, BlockHash, OutPoint},
|
||||||
OwnedOutput, Updater,
|
OwnedOutput, Updater,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user