• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Chik-Network / klvm_rs / 16770817670

06 Aug 2025 07:46AM UTC coverage: 93.355% (-0.3%) from 93.675%
16770817670

push

github

Chik-Network
update 0.16.0

526 of 581 new or added lines in 26 files covered. (90.53%)

1 existing line in 1 file now uncovered.

6294 of 6742 relevant lines covered (93.36%)

29671867.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/runtime_dialect.rs
1
use crate::allocator::{Allocator, NodePtr};
2
use crate::chik_dialect::NO_UNKNOWN_OPS;
3
use crate::cost::Cost;
4
use crate::dialect::{Dialect, OperatorSet};
5
use crate::error::EvalErr;
6
use crate::f_table::{f_lookup_for_hashmap, FLookup};
7
use crate::more_ops::op_unknown;
8
use crate::reduction::Response;
9
use std::collections::HashMap;
10

11
pub struct RuntimeDialect {
12
    f_lookup: FLookup,
13
    quote_kw: Vec<u8>,
14
    apply_kw: Vec<u8>,
15
    softfork_kw: Vec<u8>,
16
    flags: u32,
17
}
18

19
impl RuntimeDialect {
20
    pub fn new(
×
21
        op_map: HashMap<String, Vec<u8>>,
×
22
        quote_kw: Vec<u8>,
×
23
        apply_kw: Vec<u8>,
×
24
        flags: u32,
×
25
    ) -> RuntimeDialect {
×
26
        RuntimeDialect {
×
27
            f_lookup: f_lookup_for_hashmap(op_map),
×
28
            quote_kw,
×
29
            apply_kw,
×
30
            softfork_kw: vec![36], // softfork opcode
×
31
            flags,
×
32
        }
×
33
    }
×
34
}
35

36
impl Dialect for RuntimeDialect {
37
    fn op(
×
38
        &self,
×
39
        allocator: &mut Allocator,
×
40
        o: NodePtr,
×
41
        argument_list: NodePtr,
×
42
        max_cost: Cost,
×
43
        _extensions: OperatorSet,
×
44
    ) -> Response {
×
45
        let atom = allocator.atom(o);
×
46
        let b = atom.as_ref();
×
47

48
        if b.len() == 1 {
×
49
            if let Some(f) = self.f_lookup[b[0] as usize] {
×
50
                return f(allocator, argument_list, max_cost);
×
51
            }
×
52
        }
×
53
        if (self.flags & NO_UNKNOWN_OPS) != 0 {
×
NEW
54
            Err(EvalErr::Unimplemented(o))?
×
55
        } else {
56
            op_unknown(allocator, o, argument_list, max_cost)
×
57
        }
58
    }
×
59

60
    fn quote_kw(&self) -> u32 {
×
61
        self.quote_kw[0] as u32
×
62
    }
×
63
    fn apply_kw(&self) -> u32 {
×
64
        self.apply_kw[0] as u32
×
65
    }
×
66
    fn softfork_kw(&self) -> u32 {
×
67
        self.softfork_kw[0] as u32
×
68
    }
×
69

70
    fn softfork_extension(&self, _ext: u32) -> OperatorSet {
×
71
        OperatorSet::Default
×
72
    }
×
73

74
    fn allow_unknown_ops(&self) -> bool {
×
75
        (self.flags & NO_UNKNOWN_OPS) == 0
×
76
    }
×
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc