2025-04-20 automated rustfmt nightly
This commit is contained in:
parent
c85648cfd4
commit
2c1ce53deb
|
@ -84,9 +84,7 @@ impl Builder {
|
||||||
match bytes[0] {
|
match bytes[0] {
|
||||||
0x81 => self.push_opcode(OP_PUSHNUM_NEG1),
|
0x81 => self.push_opcode(OP_PUSHNUM_NEG1),
|
||||||
0 => self.push_opcode(OP_PUSHBYTES_0),
|
0 => self.push_opcode(OP_PUSHBYTES_0),
|
||||||
1..=16 => {
|
1..=16 => self.push_opcode(Opcode::from(bytes[0] + (OP_PUSHNUM_1.to_u8() - 1))),
|
||||||
self.push_opcode(Opcode::from(bytes[0] + (OP_PUSHNUM_1.to_u8() - 1)))
|
|
||||||
}
|
|
||||||
_ => self, // unreachable arm
|
_ => self, // unreachable arm
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -99,10 +97,7 @@ impl Builder {
|
||||||
/// Standardness rules require push minimality according to [CheckMinimalPush] of core.
|
/// Standardness rules require push minimality according to [CheckMinimalPush] of core.
|
||||||
///
|
///
|
||||||
/// [CheckMinimalPush]: <https://github.com/bitcoin/bitcoin/blob/99a4ddf5ab1b3e514d08b90ad8565827fda7b63b/src/script/script.cpp#L366>
|
/// [CheckMinimalPush]: <https://github.com/bitcoin/bitcoin/blob/99a4ddf5ab1b3e514d08b90ad8565827fda7b63b/src/script/script.cpp#L366>
|
||||||
pub fn push_slice_non_minimal<T: AsRef<PushBytes>>(
|
pub fn push_slice_non_minimal<T: AsRef<PushBytes>>(mut self, data: T) -> Builder {
|
||||||
mut self,
|
|
||||||
data: T,
|
|
||||||
) -> Builder {
|
|
||||||
self.0.push_slice_non_minimal(data);
|
self.0.push_slice_non_minimal(data);
|
||||||
self.1 = None;
|
self.1 = None;
|
||||||
self
|
self
|
||||||
|
|
|
@ -916,7 +916,7 @@ mod tests {
|
||||||
assert!(formatted_script.contains("<unexpected end>"));
|
assert!(formatted_script.contains("<unexpected end>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn legacy_opcode() {
|
fn legacy_opcode() {
|
||||||
let script = Script::from_bytes(&[0x03, 0xaa, 0xbb, 0xcc]);
|
let script = Script::from_bytes(&[0x03, 0xaa, 0xbb, 0xcc]);
|
||||||
assert_eq!(format!("{}", script), "OP_PUSHBYTES_3 aabbcc");
|
assert_eq!(format!("{}", script), "OP_PUSHBYTES_3 aabbcc");
|
||||||
|
|
Loading…
Reference in New Issue