We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da3f3eb commit 63a0304Copy full SHA for 63a0304
src/blockdata/script.rs
@@ -1448,5 +1448,23 @@ mod test {
1448
assert!(instructions.next().is_none());
1449
1450
}
1451
+
1452
+ #[test]
1453
+ fn read_scriptbool_zero_is_false() {
1454
+ let v: Vec<u8> = vec![0x00, 0x00, 0x00, 0x00];
1455
+ assert!(!read_scriptbool(&v));
1456
1457
+ let v: Vec<u8> = vec![0x00, 0x00, 0x00, 0x80]; // With sign bit set.
1458
1459
+ }
1460
1461
1462
+ fn read_scriptbool_non_zero_is_true() {
1463
+ let v: Vec<u8> = vec![0x01, 0x00, 0x00, 0x00];
1464
+ assert!(read_scriptbool(&v));
1465
1466
+ let v: Vec<u8> = vec![0x01, 0x00, 0x00, 0x80]; // With sign bit set.
1467
1468
1469
1470
0 commit comments