• 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

48.0
/src/error.rs
1
use crate::NodePtr;
2
use thiserror::Error;
3

4
pub type Result<T> = std::result::Result<T, EvalErr>;
5

6
#[derive(Debug, Error, PartialEq)]
7
pub enum EvalErr {
8
    #[error("bad encoding")]
9
    SerializationError,
10

11
    #[error("invalid backreference during deserialisation")]
12
    SerializationBackreferenceError,
13

14
    #[error("Out of Memory")]
15
    OutOfMemory,
16

17
    #[error("path into atom")]
18
    PathIntoAtom,
19

20
    #[error("too many pairs")]
21
    TooManyPairs,
22

23
    #[error("Too Many Atoms")]
24
    TooManyAtoms,
25

26
    #[error("cost exceeded or below zero")]
27
    CostExceeded,
28

29
    #[error("unknown softfork extension")]
30
    UnknownSoftforkExtension,
31

32
    #[error("softfork specified cost mismatch")]
33
    SoftforkCostMismatch,
34

35
    #[error("Internal Error: {1}")]
36
    InternalError(NodePtr, String),
37

38
    #[error("klvm raise")]
39
    Raise(NodePtr),
40

41
    #[error("Invalid Nil Terminator in operand list")]
42
    InvalidNilTerminator(NodePtr),
43

44
    #[error("Division by zero")]
45
    DivisionByZero(NodePtr),
46

47
    #[error("Value Stack Limit Reached")]
48
    ValueStackLimitReached(NodePtr),
49

50
    #[error("Environment Stack Limit Reached")]
51
    EnvironmentStackLimitReached(NodePtr),
52

53
    #[error("Shift too large")]
54
    ShiftTooLarge(NodePtr),
55

56
    #[error("Reserved operator")]
57
    Reserved(NodePtr),
58

59
    #[error("invalid operator")]
60
    Invalid(NodePtr),
61

62
    #[error("unimplemented operator")]
63
    Unimplemented(NodePtr),
64

65
    #[error("InvalidOperatorArg: {1}")]
66
    InvalidOpArg(NodePtr, String),
67

68
    #[error("InvalidAllocatorArg: {1}")]
69
    InvalidAllocArg(NodePtr, String),
70

71
    #[error("bls_pairing_identity failed")]
72
    BLSPairingIdentityFailed(NodePtr),
73

74
    #[error("bls_verify failed")]
75
    BLSVerifyFailed(NodePtr),
76

77
    #[error("Secp256 Verify Error: failed")]
78
    Secp256Failed(NodePtr),
79
}
80
impl From<std::io::Error> for EvalErr {
81
    fn from(_: std::io::Error) -> Self {
11✔
82
        EvalErr::SerializationError
11✔
83
    }
11✔
84
}
85

86
impl EvalErr {
87
    fn node(&self) -> Option<NodePtr> {
92✔
88
        match self {
92✔
NEW
89
            EvalErr::InternalError(node, _) => Some(*node),
×
90
            EvalErr::Raise(node) => Some(*node),
4✔
NEW
91
            EvalErr::InvalidNilTerminator(node) => Some(*node),
×
NEW
92
            EvalErr::DivisionByZero(node) => Some(*node),
×
NEW
93
            EvalErr::ValueStackLimitReached(node) => Some(*node),
×
NEW
94
            EvalErr::EnvironmentStackLimitReached(node) => Some(*node),
×
NEW
95
            EvalErr::ShiftTooLarge(node) => Some(*node),
×
NEW
96
            EvalErr::Reserved(node) => Some(*node),
×
NEW
97
            EvalErr::Invalid(node) => Some(*node),
×
NEW
98
            EvalErr::Unimplemented(node) => Some(*node),
×
NEW
99
            EvalErr::InvalidOpArg(node, _) => Some(*node),
×
100
            EvalErr::InvalidAllocArg(node, _) => Some(*node),
24✔
NEW
101
            EvalErr::BLSPairingIdentityFailed(node) => Some(*node),
×
NEW
102
            EvalErr::BLSVerifyFailed(node) => Some(*node),
×
NEW
103
            EvalErr::Secp256Failed(node) => Some(*node),
×
104
            _ => None,
64✔
105
        }
106
    }
92✔
107

108
    pub fn node_ptr(&self) -> NodePtr {
92✔
109
        // This is a convenience function to get the node pointer
110
        self.node().unwrap_or_default()
92✔
111
    }
92✔
112
}
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