From 77a7b11467d21bb4b1a083a8830d98c6d30c4e65 Mon Sep 17 00:00:00 2001 From: rvcas Date: Wed, 20 Jul 2022 23:52:26 -0400 Subject: [PATCH] feat: finish to_ex_mem for constant Co-authored-by: Kasey White --- crates/uplc/src/machine.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/uplc/src/machine.rs b/crates/uplc/src/machine.rs index 540dfd39..2bc28244 100644 --- a/crates/uplc/src/machine.rs +++ b/crates/uplc/src/machine.rs @@ -359,20 +359,16 @@ impl Value { pub fn to_ex_mem(&self) -> i64 { match self { - // TODO: this is not 1 Value::Con(c) => match c { Constant::Integer(i) => { if *i == 0 { 1 } else { - //TODO - // std::mem::size_of( i.abs() - 1 + ((i.abs() as f64).log2().floor() as i64 / 64) + 1 } } Constant::ByteString(b) => (((b.len() - 1) / 8) + 1) as i64, Constant::String(s) => s.chars().count() as i64, - Constant::Char(_) => 1, Constant::Unit => 1, Constant::Bool(_) => 1, },