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

0.7.0 release preparation #241

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions dlc-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://github.com/p2pderivatives/rust-dlc"
license-file = "../LICENSE"
name = "dlc-manager"
repository = "https://github.com/p2pderivatives/rust-dlc/tree/master/dlc-manager"
version = "0.6.0"
version = "0.7.0"

[features]
default = ["std"]
Expand All @@ -18,9 +18,9 @@ use-serde = ["serde", "dlc/use-serde", "dlc-messages/use-serde", "dlc-trie/use-s
[dependencies]
async-trait = "0.1.50"
bitcoin = { version = "0.32.2", default-features = false }
dlc = { version = "0.6.0", default-features = false, path = "../dlc" }
dlc-messages = { version = "0.6.0", default-features = false, path = "../dlc-messages" }
dlc-trie = { version = "0.6.0", default-features = false, path = "../dlc-trie" }
dlc = { version = "0.7.0", default-features = false, path = "../dlc" }
dlc-messages = { version = "0.7.0", default-features = false, path = "../dlc-messages" }
dlc-trie = { version = "0.7.0", default-features = false, path = "../dlc-trie" }
hex = { package = "hex-conservative", version = "0.1" }
lightning = { version = "0.0.125", default-features = false, features = ["grind_signatures"] }
log = "0.4.14"
Expand Down
6 changes: 3 additions & 3 deletions dlc-manager/src/contract/contract_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use dlc::{OracleInfo, Payout};
use dlc_messages::oracle_msgs::{EventDescriptor, OracleAnnouncement};
use dlc_trie::{DlcTrie, RangeInfo};
use secp256k1_zkp::{
hashes::sha256, All, EcdsaAdaptorSignature, Message, PublicKey, Secp256k1, SecretKey,
Verification,
All, EcdsaAdaptorSignature, Message, PublicKey, Secp256k1, SecretKey, Verification,
};
use std::ops::Deref;

Expand Down Expand Up @@ -296,7 +295,8 @@ impl ContractInfo {
let mut points = Vec::with_capacity(base);
for j in 0..base {
let hash =
sha256::Hash::hash(j.to_string().as_bytes()).to_byte_array();
bitcoin::hashes::sha256::Hash::hash(j.to_string().as_bytes())
.to_byte_array();
let msg = Message::from_digest(hash);
let sig_point = dlc::secp_utils::schnorrsig_compute_sig_point(
secp, pubkey, nonce, &msg,
Expand Down
2 changes: 1 addition & 1 deletion dlc-manager/src/contract/enum_descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl EnumDescriptor {
.iter()
.map(|x| {
let hash =
secp256k1_zkp::hashes::sha256::Hash::hash(x.outcome.as_bytes()).to_byte_array();
bitcoin::hashes::sha256::Hash::hash(x.outcome.as_bytes()).to_byte_array();
let message = vec![Message::from_digest(hash)];
std::iter::repeat(message).take(threshold).collect()
})
Expand Down
4 changes: 2 additions & 2 deletions dlc-messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage = "https://github.com/p2pderivatives/rust-dlc"
license-file = "../LICENSE"
name = "dlc-messages"
repository = "https://github.com/p2pderivatives/rust-dlc/tree/master/dlc-messages"
version = "0.6.0"
version = "0.7.0"

[features]
default = ["std"]
Expand All @@ -15,7 +15,7 @@ use-serde = ["serde", "secp256k1-zkp/serde", "bitcoin/serde"]

[dependencies]
bitcoin = { version = "0.32.2", default-features = false }
dlc = { version = "0.6.0", path = "../dlc", default-features = false }
dlc = { version = "0.7.0", path = "../dlc", default-features = false }
lightning = { version = "0.0.125", default-features = false }
secp256k1-zkp = {version = "0.11.0"}
serde = {version = "1.0", features = ["derive"], optional = true}
Expand Down
8 changes: 4 additions & 4 deletions dlc-messages/src/oracle_msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl OracleAnnouncement {
.write(&mut event_hex)
.expect("Error writing oracle event");

let hash = secp256k1_zkp::hashes::sha256::Hash::hash(&event_hex);
let hash = bitcoin::hashes::sha256::Hash::hash(&event_hex);
let msg = Message::from_digest(hash.to_byte_array());
secp.verify_schnorr(&self.announcement_signature, &msg, &self.oracle_public_key)?;
self.oracle_event.validate()
Expand Down Expand Up @@ -399,7 +399,7 @@ mod tests {
event
.write(&mut event_hex)
.expect("Error writing oracle event");
let hash = secp256k1_zkp::hashes::sha256::Hash::hash(&event_hex);
let hash = bitcoin::hashes::sha256::Hash::hash(&event_hex);
let msg = Message::from_digest(hash.to_byte_array());
let sig = SECP256K1.sign_schnorr(&msg, &key_pair);
let valid_announcement = OracleAnnouncement {
Expand All @@ -424,7 +424,7 @@ mod tests {
event
.write(&mut event_hex)
.expect("Error writing oracle event");
let hash = secp256k1_zkp::hashes::sha256::Hash::hash(&event_hex);
let hash = bitcoin::hashes::sha256::Hash::hash(&event_hex);
let msg = Message::from_digest(hash.to_byte_array());
let sig = SECP256K1.sign_schnorr(&msg, &key_pair);
let invalid_announcement = OracleAnnouncement {
Expand All @@ -448,7 +448,7 @@ mod tests {
event
.write(&mut event_hex)
.expect("Error writing oracle event");
let hash = secp256k1_zkp::hashes::sha256::Hash::hash(&event_hex);
let hash = bitcoin::hashes::sha256::Hash::hash(&event_hex);
let msg = Message::from_digest(hash.to_byte_array());
let sig = SECP256K1.sign_schnorr(&msg, &key_pair);
let mut sig_hex = *sig.as_ref();
Expand Down
4 changes: 2 additions & 2 deletions dlc-trie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage = "https://github.com/p2pderivatives/rust-dlc"
license-file = "../LICENSE"
name = "dlc-trie"
repository = "https://github.com/p2pderivatives/rust-dlc/tree/master/dlc-trie"
version = "0.6.0"
version = "0.7.0"

[features]
default = ["std"]
Expand All @@ -16,7 +16,7 @@ use-serde = ["serde", "dlc/use-serde"]

[dependencies]
bitcoin = { version = "0.32.2", default-features = false }
dlc = {version = "0.6.0", default-features = false, path = "../dlc"}
dlc = {version = "0.7.0", default-features = false, path = "../dlc"}
rayon = {version = "1.5", optional = true}
secp256k1-zkp = {version = "0.11.0" }
serde = {version = "1.0", optional = true, default-features = false, features = ["derive"]}
2 changes: 1 addition & 1 deletion dlc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage = "https://github.com/p2pderivatives/rust-dlc"
license-file = "../LICENSE"
name = "dlc"
repository = "https://github.com/p2pderivatives/rust-dlc/tree/master/dlc"
version = "0.6.0"
version = "0.7.0"

[dependencies]
bitcoin = { version = "0.32.2", default-features = false }
Expand Down
3 changes: 1 addition & 2 deletions dlc/src/secp_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
//! rust-secp256k1 or rust-secp256k1-zkp.

use crate::Error;
use bitcoin::hashes::sha256t_hash_newtype;
use bitcoin::hashes::{sha256t_hash_newtype, Hash};
use core::ptr;
use secp256k1_sys::{
types::{c_int, c_uchar, c_void, size_t},
CPtr, SchnorrSigExtraParams,
};
use secp256k1_zkp::hashes::Hash;
use secp256k1_zkp::{
schnorr::Signature as SchnorrSignature, Keypair, Message, PublicKey, Scalar, Secp256k1,
Signing, Verification, XOnlyPublicKey,
Expand Down
Loading