MCPcopy Create free account
hub / github.com/BitVM/BitVM / verify_n

Function verify_n

bitvm/src/u4/u4_std.rs:43–51  ·  view source on GitHub ↗

Checks if the top 2n elements have the period n, i.e. are in the form a, b, c ..., a, b, c ...

(n: u32)

Source from the content-addressed store, hash-verified

41
42/// Checks if the top 2n elements have the period n, i.e. are in the form a, b, c ..., a, b, c ...
43pub 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
54pub fn u4_u32_verify_from_altstack() -> Script {

Callers 3

test_arrange_stackFunction · 0.85
test_add_internal_stackFunction · 0.85
test_add_for_blakeFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_arrange_stackFunction · 0.68
test_add_internal_stackFunction · 0.68
test_add_for_blakeFunction · 0.68