Skip to content

Commit 73cd5a8

Browse files
committed
Update to 0.28.0-rc.1
There are a few wierd changes that are waiting on upstream changes, but we should be good for 0.28.0 release. These changes would be caught by compiler after they are fixed upstream
1 parent bb63808 commit 73cd5a8

File tree

15 files changed

+69
-48
lines changed

15 files changed

+69
-48
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rand = ["bitcoin/rand"]
1717

1818
[dependencies]
1919
# bitcoin = "0.27"
20-
bitcoin = {git = "https://github.com/rust-bitcoin/rust-bitcoin", rev = "0e2e55971275da64ceb62e8991a0a5fa962cb8b1"}
20+
bitcoin = "0.28.0-rc.1"
2121

2222
[dependencies.serde]
2323
version = "1.0"

examples/verify_tx.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ fn main() {
167167

168168
let iter = interpreter.iter(|pk, ecdsa_sig| {
169169
ecdsa_sig.hash_ty == bitcoin::EcdsaSigHashType::All
170-
&& secp.verify_ecdsa(&message, &ecdsa_sig.sig, &pk.key).is_ok()
170+
&& secp
171+
.verify_ecdsa(&message, &ecdsa_sig.sig, &pk.inner)
172+
.is_ok()
171173
});
172174
println!("\nExample three");
173175
for elem in iter {

integration_test/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ authors = ["Steven Roose <[email protected]>", "Sanket K <sanket1729@gmail.
77
miniscript = {path = "../"}
88

99
# Until 0.26 support is released on rust-bitcoincore-rpc
10-
bitcoincore-rpc = {git = "https://github.com/sanket1729/rust-bitcoincore-rpc",rev = "ae3ad6cac0a83454f267cb7d5191f6607bb80297"}
11-
bitcoin = {git = "https://github.com/rust-bitcoin/rust-bitcoin", rev = "0e2e55971275da64ceb62e8991a0a5fa962cb8b1"}
10+
bitcoincore-rpc = {git = "https://github.com/sanket1729/rust-bitcoincore-rpc",rev = "bcc35944b3dd636cdff9710f90f8e0cfcab28f27"}
11+
bitcoin = "0.28.0-rc.1"
1212
log = "0.4"

src/descriptor/key.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ use bitcoin::{
44
self,
55
hashes::Hash,
66
hashes::{hex::FromHex, HashEngine},
7-
schnorr::XOnlyPublicKey,
87
secp256k1,
98
secp256k1::{Secp256k1, Signing},
109
util::bip32,
11-
XpubIdentifier,
10+
XOnlyPublicKey, XpubIdentifier,
1211
};
1312

1413
use {MiniscriptKey, ToPublicKey};

src/descriptor/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,10 +1011,7 @@ mod tests {
10111011
let secp = secp256k1::Secp256k1::new();
10121012
let sk =
10131013
secp256k1::SecretKey::from_slice(&b"sally was a secret key, she said"[..]).unwrap();
1014-
let pk = bitcoin::PublicKey {
1015-
key: secp256k1::PublicKey::from_secret_key(&secp, &sk),
1016-
compressed: true,
1017-
};
1014+
let pk = bitcoin::PublicKey::new(secp256k1::PublicKey::from_secret_key(&secp, &sk));
10181015
let msg = secp256k1::Message::from_slice(&b"michael was a message, amusingly"[..])
10191016
.expect("32 bytes");
10201017
let sig = secp.sign_ecdsa(&msg, &sk);

src/descriptor/sortedmulti.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> SortedMultiVec<Pk, Ctx> {
140140
// Sort pubkeys lexicographically according to BIP 67
141141
pks.sort_by(|a, b| {
142142
a.to_public_key()
143-
.key
143+
.inner
144144
.serialize()
145-
.partial_cmp(&b.to_public_key().key.serialize())
145+
.partial_cmp(&b.to_public_key().inner.serialize())
146146
.unwrap()
147147
});
148148
Terminal::Multi(self.k, pks)

src/interpreter/inner.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub fn from_txdata<'txin>(
154154
match wit_stack.pop() {
155155
Some(elem) => {
156156
let pk = pk_from_stackelem(&elem, true)?;
157-
if *spk == bitcoin::Script::new_v0_wpkh(&pk.to_pubkeyhash().into()) {
157+
if *spk == bitcoin::Script::new_v0_p2wpkh(&pk.to_pubkeyhash().into()) {
158158
Ok((
159159
Inner::PublicKey(pk, PubkeyType::Wpkh),
160160
wit_stack,
@@ -177,7 +177,7 @@ pub fn from_txdata<'txin>(
177177
let miniscript = script_from_stackelem(&elem)?;
178178
let script = miniscript.encode();
179179
let scripthash = sha256::Hash::hash(&script[..]);
180-
if *spk == bitcoin::Script::new_v0_wsh(&scripthash.into()) {
180+
if *spk == bitcoin::Script::new_v0_p2wsh(&scripthash.into()) {
181181
Ok((
182182
Inner::Script(miniscript, ScriptType::Wsh),
183183
wit_stack,
@@ -208,8 +208,9 @@ pub fn from_txdata<'txin>(
208208
} else {
209209
let pk = pk_from_stackelem(&elem, true)?;
210210
if slice
211-
== &bitcoin::Script::new_v0_wpkh(&pk.to_pubkeyhash().into())
212-
[..]
211+
== &bitcoin::Script::new_v0_p2wpkh(
212+
&pk.to_pubkeyhash().into(),
213+
)[..]
213214
{
214215
Ok((
215216
Inner::PublicKey(pk, PubkeyType::ShWpkh),
@@ -233,7 +234,8 @@ pub fn from_txdata<'txin>(
233234
let miniscript = script_from_stackelem(&elem)?;
234235
let script = miniscript.encode();
235236
let scripthash = sha256::Hash::hash(&script[..]);
236-
if slice == &bitcoin::Script::new_v0_wsh(&scripthash.into())[..]
237+
if slice
238+
== &bitcoin::Script::new_v0_p2wsh(&scripthash.into())[..]
237239
{
238240
Ok((
239241
Inner::Script(miniscript, ScriptType::ShWsh),
@@ -322,7 +324,7 @@ mod tests {
322324

323325
let pkhash = key.to_pubkeyhash().into();
324326
let wpkhash = key.to_pubkeyhash().into();
325-
let wpkh_spk = bitcoin::Script::new_v0_wpkh(&wpkhash);
327+
let wpkh_spk = bitcoin::Script::new_v0_p2wpkh(&wpkhash);
326328
let wpkh_scripthash = hash160::Hash::hash(&wpkh_spk[..]).into();
327329

328330
KeyTestData {
@@ -670,7 +672,7 @@ mod tests {
670672
let wit_hash = sha256::Hash::hash(&witness_script[..]).into();
671673
let wit_stack = Witness::from_vec(vec![witness_script.to_bytes()]);
672674

673-
let spk = Script::new_v0_wsh(&wit_hash);
675+
let spk = Script::new_v0_p2wsh(&wit_hash);
674676
let blank_script = bitcoin::Script::new();
675677

676678
// wsh without witness
@@ -708,7 +710,7 @@ mod tests {
708710
let wit_hash = sha256::Hash::hash(&witness_script[..]).into();
709711
let wit_stack = Witness::from_vec(vec![witness_script.to_bytes()]);
710712

711-
let redeem_script = Script::new_v0_wsh(&wit_hash);
713+
let redeem_script = Script::new_v0_p2wsh(&wit_hash);
712714
let script_sig = script::Builder::new()
713715
.push_slice(&redeem_script[..])
714716
.into_script();

src/interpreter/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ impl<'txin> Interpreter<'txin> {
244244
bitcoin::EcdsaSigHashType::NonePlusAnyoneCanPay => sighashes[4],
245245
bitcoin::EcdsaSigHashType::SinglePlusAnyoneCanPay => sighashes[5],
246246
};
247-
secp.verify_ecdsa(&sighash, &ecdsa_sig.sig, &pk.key).is_ok()
247+
secp.verify_ecdsa(&sighash, &ecdsa_sig.sig, &pk.inner)
248+
.is_ok()
248249
},
249250
)
250251
}
@@ -825,7 +826,7 @@ mod tests {
825826

826827
let sk = secp256k1::SecretKey::from_slice(&sk[..]).expect("secret key");
827828
let pk = bitcoin::PublicKey {
828-
key: secp256k1::PublicKey::from_secret_key(&secp_sign, &sk),
829+
inner: secp256k1::PublicKey::from_secret_key(&secp_sign, &sk),
829830
compressed: true,
830831
};
831832
let sig = secp_sign.sign_ecdsa(&msg, &sk);
@@ -842,7 +843,8 @@ mod tests {
842843
fn sat_constraints() {
843844
let (pks, der_sigs, secp_sigs, sighash, secp) = setup_keys_sigs(10);
844845
let vfyfn_ = |pk: &bitcoin::PublicKey, ecdsa_sig: bitcoin::EcdsaSig| {
845-
secp.verify_ecdsa(&sighash, &ecdsa_sig.sig, &pk.key).is_ok()
846+
secp.verify_ecdsa(&sighash, &ecdsa_sig.sig, &pk.inner)
847+
.is_ok()
846848
};
847849

848850
fn from_stack<'txin, 'elem, F>(

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub trait ToPublicKey: MiniscriptKey {
197197
/// Convert an object to x-only pubkey
198198
fn to_x_only_pubkey(&self) -> bitcoin::secp256k1::XOnlyPublicKey {
199199
let pk = self.to_public_key();
200-
bitcoin::secp256k1::XOnlyPublicKey::from(pk.key)
200+
bitcoin::secp256k1::XOnlyPublicKey::from(pk.inner)
201201
}
202202

203203
/// Converts a hashed version of the public key to a `hash160` hash.

src/miniscript/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ pub mod test {
473473
pub fn gen_bitcoin_pubkeys(n: usize, compressed: bool) -> Vec<bitcoin::PublicKey> {
474474
gen_secp_pubkeys(n)
475475
.into_iter()
476-
.map(|key| bitcoin::PublicKey { key, compressed })
476+
.map(|inner| bitcoin::PublicKey { inner, compressed })
477477
.collect()
478478
}
479479

0 commit comments

Comments
 (0)