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

ergoplatform / sigma-rust / 19957094785

05 Dec 2025 08:23AM UTC coverage: 86.918% (+8.5%) from 78.463%
19957094785

Pull #837

github

web-flow
Merge dec08367a into 2f840d387
Pull Request #837: Split TransactionHintsBag hints properly

44 of 53 new or added lines in 13 files covered. (83.02%)

1621 existing lines in 221 files now uncovered.

27453 of 31585 relevant lines covered (86.92%)

253204.4 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>(
1✔
11
        &self,
1✔
12
        env: &mut Env<'ctx>,
1✔
13
        ctx: &Context<'ctx>,
1✔
14
    ) -> Result<Value<'ctx>, EvalError> {
1✔
15
        let input_v = self.input.eval(env, ctx)?;
1✔
16
        match input_v {
1✔
17
            Value::CBox(b) => Ok(b.script_bytes()?.into()),
1✔
18
            _ => Err(EvalError::UnexpectedValue(format!(
×
19
                "Expected ExtractScriptBytes input to be Value::CBox, got {0:?}",
×
20
                input_v
×
UNCOV
21
            ))),
×
22
        }
23
    }
1✔
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() {
1✔
39
        let e: Expr = ExtractScriptBytes {
1✔
40
            input: Box::new(GlobalVars::SelfBox.into()),
1✔
41
        }
1✔
42
        .into();
1✔
43
        let ctx = force_any_val::<Context>();
1✔
44
        assert_eq!(
1✔
45
            eval_out::<Vec<i8>>(&e, &ctx),
1✔
46
            ctx.self_box.script_bytes().unwrap()
1✔
47
        );
48
    }
1✔
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