Checks if the top 2n elements have the period n, i.e. are in the form a, b, c ..., a, b, c ...
(n: u32)
| 41 | |
| 42 | /// Checks if the top 2n elements have the period n, i.e. are in the form a, b, c ..., a, b, c ... |
| 43 | pub fn verify_n(n: u32) -> Script { |
| 44 | script! { |
| 45 | for i in 0..n { |
| 46 | { n - i} |
| 47 | OP_ROLL |
| 48 | OP_EQUALVERIFY |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /// Verifies if the u32 elements on the top of the altstack and the stack is the same |
| 54 | pub fn u4_u32_verify_from_altstack() -> Script { |
no outgoing calls