File tree Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -118,28 +118,12 @@ as follows:
118
118
```
119
119
#[cfg(test)]
120
120
mod tests {
121
- fn extend_vec_from_hex(hex: &str, out: &mut Vec<u8>) {
122
- let mut b = 0;
123
- for (idx, c) in hex.as_bytes().iter().enumerate() {
124
- b <<= 4;
125
- match *c {
126
- b'A'...b'F' => b |= c - b'A' + 10,
127
- b'a'...b'f' => b |= c - b'a' + 10,
128
- b'0'...b'9' => b |= c - b'0',
129
- _ => panic!("Bad hex"),
130
- }
131
- if (idx & 1) == 1 {
132
- out.push(b);
133
- b = 0;
134
- }
135
- }
136
- }
121
+ use miniscript::bitcoin::hex::FromHex;
137
122
138
123
#[test]
139
124
fn duplicate_crash() {
140
- let mut a = Vec::new();
141
- extend_vec_from_hex("048531e80700ae6400670000af5168", &mut a);
142
- super::do_test(&a);
125
+ let v = Vec::from_hex("abcd").unwrap();
126
+ super::do_test(&v);
143
127
}
144
128
}
145
129
```
You can’t perform that action at this time.
0 commit comments