fuzz: fix warnings, clippy lints, 1.48.0 failures
This commit is contained in:
parent
fd88e48696
commit
933ecb19e1
|
@ -82,6 +82,7 @@ To build with the MSRV you will need to pin `serde` (if you have the feature ena
|
|||
```
|
||||
# serde 1.0.157 uses syn 2.0 which requires edition 2021
|
||||
cargo update -p serde --precise 1.0.156
|
||||
cargo update -p half --precise 1.7.1
|
||||
```
|
||||
|
||||
before building. (And if your code is a library, your downstream users will need to run these
|
||||
|
|
|
@ -7,7 +7,7 @@ fn do_test(data: &[u8]) {
|
|||
|
||||
match tx_result {
|
||||
Err(_) => {},
|
||||
Ok(mut tx) => {
|
||||
Ok(tx) => {
|
||||
let ser = bitcoin::consensus::encode::serialize(&tx);
|
||||
assert_eq!(&ser[..], data);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ fn do_test(data: &[u8]) {
|
|||
let w: Result<Witness, _> = deserialize(data);
|
||||
if let Ok(witness) = w {
|
||||
let serialized = serialize(&witness);
|
||||
assert_eq!(data, serialized);
|
||||
assert_eq!(data, &serialized[..]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ impl fmt::Write for NullWriter {
|
|||
|
||||
fn do_test(data: &[u8]) {
|
||||
let mut writer = NullWriter;
|
||||
bitcoin::Script::from_bytes(data).fmt_asm(&mut writer);
|
||||
bitcoin::Script::from_bytes(data).fmt_asm(&mut writer).unwrap();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -37,9 +37,9 @@ mod tests {
|
|||
for (idx, c) in hex.as_bytes().iter().enumerate() {
|
||||
b <<= 4;
|
||||
match *c {
|
||||
b'A'...b'F' => b |= c - b'A' + 10,
|
||||
b'a'...b'f' => b |= c - b'a' + 10,
|
||||
b'0'...b'9' => b |= c - b'0',
|
||||
b'A'..=b'F' => b |= c - b'A' + 10,
|
||||
b'a'..=b'f' => b |= c - b'a' + 10,
|
||||
b'0'..=b'9' => b |= c - b'0',
|
||||
_ => panic!("Bad hex"),
|
||||
}
|
||||
if (idx & 1) == 1 {
|
||||
|
|
|
@ -37,9 +37,9 @@ mod tests {
|
|||
for (idx, c) in hex.as_bytes().iter().enumerate() {
|
||||
b <<= 4;
|
||||
match *c {
|
||||
b'A'...b'F' => b |= c - b'A' + 10,
|
||||
b'a'...b'f' => b |= c - b'a' + 10,
|
||||
b'0'...b'9' => b |= c - b'0',
|
||||
b'A'..=b'F' => b |= c - b'A' + 10,
|
||||
b'a'..=b'f' => b |= c - b'a' + 10,
|
||||
b'0'..=b'9' => b |= c - b'0',
|
||||
_ => panic!("Bad hex"),
|
||||
}
|
||||
if (idx & 1) == 1 {
|
||||
|
|
|
@ -29,9 +29,9 @@ mod tests {
|
|||
for (idx, c) in hex.as_bytes().iter().enumerate() {
|
||||
b <<= 4;
|
||||
match *c {
|
||||
b'A'...b'F' => b |= c - b'A' + 10,
|
||||
b'a'...b'f' => b |= c - b'a' + 10,
|
||||
b'0'...b'9' => b |= c - b'0',
|
||||
b'A'..=b'F' => b |= c - b'A' + 10,
|
||||
b'a'..=b'f' => b |= c - b'a' + 10,
|
||||
b'0'..=b'9' => b |= c - b'0',
|
||||
_ => panic!("Bad hex"),
|
||||
}
|
||||
if (idx & 1) == 1 {
|
||||
|
|
|
@ -29,9 +29,9 @@ mod tests {
|
|||
for (idx, c) in hex.as_bytes().iter().enumerate() {
|
||||
b <<= 4;
|
||||
match *c {
|
||||
b'A'...b'F' => b |= c - b'A' + 10,
|
||||
b'a'...b'f' => b |= c - b'a' + 10,
|
||||
b'0'...b'9' => b |= c - b'0',
|
||||
b'A'..=b'F' => b |= c - b'A' + 10,
|
||||
b'a'..=b'f' => b |= c - b'a' + 10,
|
||||
b'0'..=b'9' => b |= c - b'0',
|
||||
_ => panic!("Bad hex"),
|
||||
}
|
||||
if (idx & 1) == 1 {
|
||||
|
|
|
@ -29,9 +29,9 @@ mod tests {
|
|||
for (idx, c) in hex.as_bytes().iter().enumerate() {
|
||||
b <<= 4;
|
||||
match *c {
|
||||
b'A'...b'F' => b |= c - b'A' + 10,
|
||||
b'a'...b'f' => b |= c - b'a' + 10,
|
||||
b'0'...b'9' => b |= c - b'0',
|
||||
b'A'..=b'F' => b |= c - b'A' + 10,
|
||||
b'a'..=b'f' => b |= c - b'a' + 10,
|
||||
b'0'..=b'9' => b |= c - b'0',
|
||||
_ => panic!("Bad hex"),
|
||||
}
|
||||
if (idx & 1) == 1 {
|
||||
|
|
|
@ -29,9 +29,9 @@ mod tests {
|
|||
for (idx, c) in hex.as_bytes().iter().enumerate() {
|
||||
b <<= 4;
|
||||
match *c {
|
||||
b'A'...b'F' => b |= c - b'A' + 10,
|
||||
b'a'...b'f' => b |= c - b'a' + 10,
|
||||
b'0'...b'9' => b |= c - b'0',
|
||||
b'A'..=b'F' => b |= c - b'A' + 10,
|
||||
b'a'..=b'f' => b |= c - b'a' + 10,
|
||||
b'0'..=b'9' => b |= c - b'0',
|
||||
_ => panic!("Bad hex"),
|
||||
}
|
||||
if (idx & 1) == 1 {
|
||||
|
|
|
@ -29,9 +29,9 @@ mod tests {
|
|||
for (idx, c) in hex.as_bytes().iter().enumerate() {
|
||||
b <<= 4;
|
||||
match *c {
|
||||
b'A'...b'F' => b |= c - b'A' + 10,
|
||||
b'a'...b'f' => b |= c - b'a' + 10,
|
||||
b'0'...b'9' => b |= c - b'0',
|
||||
b'A'..=b'F' => b |= c - b'A' + 10,
|
||||
b'a'..=b'f' => b |= c - b'a' + 10,
|
||||
b'0'..=b'9' => b |= c - b'0',
|
||||
_ => panic!("Bad hex"),
|
||||
}
|
||||
if (idx & 1) == 1 {
|
||||
|
|
Loading…
Reference in New Issue