simplicityhl 0.7.0

Rust-like language that compiles to Simplicity bytecode.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use merkle::build_root::{get_root, hash as and_hash};
use base_math::simple_op::hash as or_hash;

pub fn get_block_value_hash(prev_hash: u32, tx1: u32, tx2: u32) -> u32 {
    let root: u32 = get_root(tx1, tx2);
    or_hash(prev_hash, root)
}

fn main() {
    let block_val_hash: u32 = get_block_value_hash(5, 10, 20);
    assert!(jet::eq_32(block_val_hash, 27));
    
    let first_value: u32 = 15;
    let second_value: u32 = 22;
    assert!(jet::eq_32(and_hash(first_value, second_value), 6));
}