We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 733bedd commit 84d1ad5Copy full SHA for 84d1ad5
src/miniscript/lex.rs
@@ -213,14 +213,9 @@ pub fn lex(script: &'_ script::Script) -> Result<Vec<Token<'_>>, Error> {
213
33 => ret.push(Token::Bytes33(bytes.as_bytes())),
214
65 => ret.push(Token::Bytes65(bytes.as_bytes())),
215
_ => {
216
+ // check minimality of the number
217
match script::read_scriptint(bytes.as_bytes()) {
218
Ok(v) if v >= 0 => {
- // check minimality of the number
219
- if script::Builder::new().push_int(v).into_script()[1..].as_bytes()
220
- != bytes.as_bytes()
221
- {
222
- return Err(Error::InvalidPush(bytes.to_owned().into()));
223
- }
224
ret.push(Token::Num(v as u32));
225
}
226
Ok(_) => return Err(Error::InvalidPush(bytes.to_owned().into())),
0 commit comments