Skip to content

Commit a7c5013

Browse files
committed
Merge #205: Fix CI
8d58ec3 clippy: use u32::MAX rather than u32::max_value (Andrew Poelstra) 172e36b clippy: fix indentation in documentation (Andrew Poelstra) 4ab1b77 blech32: delete unconstructable iterator struct (Andrew Poelstra) a89ff6e fix a couple feature gates (Andrew Poelstra) Pull request description: Do some cleanups and get CI working again. Will rebase #203 on this. ACKs for top commit: delta1: ACK 8d58ec3 Tree-SHA512: 62ca188d031e71e39279b7407cef746ea4bec2c72baad633603fd67834efa6774027b060d20fddbb9bfff609b676b1b6d2f20a1c663e7fea207a3b08772e3e0c
2 parents 487f31b + 8d58ec3 commit a7c5013

File tree

7 files changed

+11
-22
lines changed

7 files changed

+11
-22
lines changed

examples/pset_blind_coinjoin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//! 6. A signs it's input
99
//! 7. A finalizes the pset
1010
//! 8. A extracts and broadcasts the transaction
11+
//!
1112
//! During the entire interaction, the output blinding factors for A and B are not
1213
//! shared with each other.
1314
extern crate bitcoin;

src/blech32/decode.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -452,19 +452,6 @@ impl<'s> ExactSizeIterator for ByteIter<'s> {
452452
fn len(&self) -> usize { self.iter.len() }
453453
}
454454

455-
/// An iterator over a parsed HRP string data as field elements.
456-
pub struct Fe32Iter<'s> {
457-
iter: AsciiToFe32Iter<iter::Copied<slice::Iter<'s, u8>>>,
458-
}
459-
460-
impl<'s> Iterator for Fe32Iter<'s> {
461-
type Item = Fe32;
462-
#[inline]
463-
fn next(&mut self) -> Option<Fe32> { self.iter.next() }
464-
#[inline]
465-
fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }
466-
}
467-
468455
/// Helper iterator adaptor that maps an iterator of valid bech32 character ASCII bytes to an
469456
/// iterator of field elements.
470457
///
@@ -889,13 +876,12 @@ mod tests {
889876
}
890877

891878
#[test]
892-
#[cfg(feature = "alloc")]
893879
fn check_hrp_max_length() {
894880
let hrps =
895881
"an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio";
896882

897883
let hrp = Hrp::parse_unchecked(hrps);
898-
let s = crate::encode::<Blech32>(hrp, &[]).expect("failed to encode empty buffer");
884+
let s = crate::bech32::encode::<Blech32>(hrp, &[]).expect("failed to encode empty buffer");
899885

900886
let unchecked = UncheckedHrpstring::new(&s).expect("failed to parse address");
901887
assert_eq!(unchecked.hrp(), hrp);

src/block.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,15 @@ mod tests {
434434
000000000000000000000000000000000000\
435435
";
436436

437-
#[cfg(feature = "serde-feature")]
437+
#[cfg(feature = "serde")]
438438
#[test]
439439
fn blockheader_serde() {
440440
let block: Block = hex_deserialize!(&SIMPLE_BLOCK);
441441
roundtrip_header(&block.header);
442442
let block: Block = hex_deserialize!(&DYNAFED_BLOCK);
443443
roundtrip_header(&block.header);
444444
}
445-
#[cfg(feature = "serde-feature")]
445+
#[cfg(feature = "serde")]
446446
fn roundtrip_header(header: &BlockHeader) {
447447
let header_ser = serde_json::to_string(header).unwrap();
448448
let header_deser: BlockHeader = serde_json::from_str(&header_ser).unwrap();

src/opcodes.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,10 @@ pub mod all {
459459
pub const OP_INSPECTINPUTVALUE: All = All {code: 0xc9};
460460
/// Pop a CScriptNum input index idx and push the following depending the type of scriptPubkey:
461461
/// - If the scriptPubKey is not a native segwit program, push a single sha256
462-
/// hash of the scriptPubKey on stack top. Next, push a CScriptNum(-1) to
463-
/// indicate a non-native segwit scriptPubKey.
462+
/// hash of the scriptPubKey on stack top. Next, push a CScriptNum(-1) to
463+
/// indicate a non-native segwit scriptPubKey.
464464
/// - If the scriptPubKey is a native segwit program, push the witness program(2-40)
465-
/// followed by a push for segwit version(0-1).
465+
/// followed by a push for segwit version(0-1).
466466
pub const OP_INSPECTINPUTSCRIPTPUBKEY: All = All {code: 0xca};
467467
/// Pop a CScriptNum input index idx and push the nSequence(4) as little-endian number.
468468
pub const OP_INSPECTINPUTSEQUENCE: All = All {code: 0xcb};
@@ -544,6 +544,7 @@ pub mod all {
544544
/// 1) a 32 byte big endian, unsigned scalar k.
545545
/// 2) Compressed EC point P, and
546546
/// 3) compressed EC point Q.
547+
///
547548
/// Abort if P, Q is invalid or k is not 32 bytes and outside of secp256k1 curve order.
548549
/// Abort if Q != k*P.
549550
pub const OP_ECMULSCALARVERIFY: All = All {code: 0xe3};

src/schnorr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ impl TapTweak for UntweakedKeypair {
116116
/// * p is the internal private key
117117
/// * H is the hash function
118118
/// * c is the commitment data
119+
///
119120
/// The public key is generated from a private key by multiplying with generator point, Q = qG.
120121
///
121122
/// # Returns

src/taproot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ impl ControlBlock {
621621
///
622622
/// # Errors:
623623
/// - If the control block size is not of the form 33 + 32m where
624-
/// 0 <= m <= 128, InvalidControlBlock is returned
624+
/// 0 <= m <= 128, InvalidControlBlock is returned
625625
pub fn from_slice(sl: &[u8]) -> Result<ControlBlock, TaprootError> {
626626
if sl.len() < TAPROOT_CONTROL_BASE_SIZE
627627
|| (sl.len() - TAPROOT_CONTROL_BASE_SIZE) % TAPROOT_CONTROL_NODE_SIZE != 0

src/transaction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl OutPoint {
9999
pub fn null() -> OutPoint {
100100
OutPoint {
101101
txid: Txid::all_zeros(),
102-
vout: u32::max_value(),
102+
vout: u32::MAX,
103103
}
104104
}
105105

0 commit comments

Comments
 (0)