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

Function test_arrange_stack

bitvm/src/u4/u4_add_stack.rs:131–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129
130 #[test]
131 fn test_arrange_stack() {
132 let mut stack = StackTracker::new();
133
134 let mut x = stack.number_u32(0x00112233);
135 let y = stack.number_u32(0x99887766);
136 u4_arrange_nibbles_stack(8, &mut stack, vec![y], vec![&mut x], vec![0xaabbccdd]);
137
138 //0x998 877 66
139 //0x001 12 233
140 //0xaa bbc cdd
141
142 stack.number_u32(0x90a90a81);
143 stack.number_u32(0xb81b72c7);
144 stack.number_u32(0x2c63d63d);
145
146 stack.custom(verify_n(24), 24 + 3, false, 0, "verify");
147 stack.drop(y);
148 stack.op_true();
149
150 let res = stack.run();
151 assert!(res.success);
152 }
153
154 #[test]
155 fn test_add_internal_stack() {

Callers

nothing calls this directly

Calls 3

u4_arrange_nibbles_stackFunction · 0.85
verify_nFunction · 0.85
dropMethod · 0.45

Tested by

no test coverage detected