klvmr 0.12.1

Implementation of `klvm` for Chik Network's cryptocurrency
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::allocator::Allocator;
use crate::reduction::EvalErr;

pub type Cost = u64;

pub fn check_cost(a: &Allocator, cost: Cost, max_cost: Cost) -> Result<(), EvalErr> {
    if cost > max_cost {
        Err(EvalErr(a.nil(), "cost exceeded".into()))
    } else {
        Ok(())
    }
}