Helper for u32_copy_zip
(mut a: u32, mut b: u32)
| 35 | |
| 36 | /// Helper for u32_copy_zip |
| 37 | pub fn _u32_copy_zip(mut a: u32, mut b: u32) -> Script { |
| 38 | assert!(a < b); |
| 39 | a = (a + 1) * 4 - 1; |
| 40 | b = (b + 1) * 4 - 1; |
| 41 | |
| 42 | script! { |
| 43 | {a} OP_PICK {b+1} OP_ROLL |
| 44 | {a+1} OP_PICK {b+2} OP_ROLL |
| 45 | {a+2} OP_PICK {b+3} OP_ROLL |
| 46 | {a+3} OP_PICK {b+4} OP_ROLL |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | ///Helper for u32_copy_zip |
| 51 | pub fn _u32_zip_copy(mut a: u32, mut b: u32) -> Script { |