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

ergoplatform / sigma-rust / 19909456309

03 Dec 2025 09:29PM UTC coverage: 86.947% (+8.5%) from 78.463%
19909456309

Pull #838

github

web-flow
Merge 717ebc4b7 into 2f840d387
Pull Request #838: Fix CI, bump dependencies and rust toolchain

20 of 24 new or added lines in 12 files covered. (83.33%)

1614 existing lines in 221 files now uncovered.

27478 of 31603 relevant lines covered (86.95%)

506307.07 hits per line

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

82.61
/ergotree-interpreter/src/eval/extract_script_bytes.rs
1
use ergotree_ir::mir::extract_script_bytes::ExtractScriptBytes;
2
use ergotree_ir::mir::value::Value;
3

4
use crate::eval::env::Env;
5
use crate::eval::Context;
6
use crate::eval::EvalError;
7
use crate::eval::Evaluable;
8

9
impl Evaluable for ExtractScriptBytes {
10
    fn eval<'ctx>(
2✔
11
        &self,
2✔
12
        env: &mut Env<'ctx>,
2✔
13
        ctx: &Context<'ctx>,
2✔
14
    ) -> Result<Value<'ctx>, EvalError> {
2✔
15
        let input_v = self.input.eval(env, ctx)?;
2✔
16
        match input_v {
2✔
17
            Value::CBox(b) => Ok(b.script_bytes()?.into()),
2✔
18
            _ => Err(EvalError::UnexpectedValue(format!(
×
19
                "Expected ExtractScriptBytes input to be Value::CBox, got {0:?}",
×
20
                input_v
×
UNCOV
21
            ))),
×
22
        }
23
    }
2✔
24
}
25

26
#[allow(clippy::unwrap_used)]
27
#[cfg(test)]
28
#[cfg(feature = "arbitrary")]
29
mod tests {
30
    use super::*;
31
    use crate::eval::test_util::eval_out;
32
    use ergotree_ir::chain::context::Context;
33
    use ergotree_ir::mir::expr::Expr;
34
    use ergotree_ir::mir::global_vars::GlobalVars;
35
    use sigma_test_util::force_any_val;
36

37
    #[test]
38
    fn eval() {
2✔
39
        let e: Expr = ExtractScriptBytes {
2✔
40
            input: Box::new(GlobalVars::SelfBox.into()),
2✔
41
        }
2✔
42
        .into();
2✔
43
        let ctx = force_any_val::<Context>();
2✔
44
        assert_eq!(
2✔
45
            eval_out::<Vec<i8>>(&e, &ctx),
2✔
46
            ctx.self_box.script_bytes().unwrap()
2✔
47
        );
48
    }
2✔
49
}
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