Comment out ExpModInteger since it's not live on testnets yet
This commit is contained in:
parent
1105dbf3c6
commit
ebc7d89d5d
|
@ -982,12 +982,11 @@ pub fn from_default_function(builtin: DefaultFunction, id_gen: &IdGenerator) ->
|
|||
let tipo = Type::function(vec![Type::byte_array()], Type::byte_array());
|
||||
|
||||
(tipo, 1)
|
||||
}
|
||||
DefaultFunction::ExpModInteger => {
|
||||
let tipo = Type::function(vec![Type::int(), Type::int(), Type::int()], Type::int());
|
||||
} // DefaultFunction::ExpModInteger => {
|
||||
// let tipo = Type::function(vec![Type::int(), Type::int(), Type::int()], Type::int());
|
||||
|
||||
(tipo, 3)
|
||||
}
|
||||
// (tipo, 3)
|
||||
// }
|
||||
};
|
||||
|
||||
ValueConstructor::public(
|
||||
|
|
|
@ -119,7 +119,7 @@ pub enum DefaultFunction {
|
|||
FindFirstSetBit = 85,
|
||||
// Ripemd_160
|
||||
Ripemd_160 = 86,
|
||||
ExpModInteger = 87,
|
||||
// ExpModInteger = 87,
|
||||
// Match
|
||||
// CaseList = 88,
|
||||
// CaseData = 89,
|
||||
|
@ -395,7 +395,7 @@ impl FromStr for DefaultFunction {
|
|||
"countSetBits" => Ok(CountSetBits),
|
||||
"findFirstSetBit" => Ok(FindFirstSetBit),
|
||||
"ripemd_160" => Ok(Ripemd_160),
|
||||
"expModInteger" => Ok(ExpModInteger),
|
||||
// "expModInteger" => Ok(ExpModInteger),
|
||||
// "caseList" => Ok(CaseList),
|
||||
// "caseData" => Ok(CaseData),
|
||||
rest => Err(format!("Default Function not found - {rest}")),
|
||||
|
@ -495,7 +495,7 @@ impl Display for DefaultFunction {
|
|||
CountSetBits => write!(f, "countSetBits"),
|
||||
FindFirstSetBit => write!(f, "findFirstSetBit"),
|
||||
Ripemd_160 => write!(f, "ripemd_160"),
|
||||
ExpModInteger => write!(f, "expModInteger"),
|
||||
// ExpModInteger => write!(f, "expModInteger"),
|
||||
// CaseList => write!(f, "caseList"),
|
||||
// CaseData => write!(f, "caseData"),
|
||||
}
|
||||
|
@ -594,7 +594,7 @@ impl DefaultFunction {
|
|||
CountSetBits => "count_set_bits",
|
||||
FindFirstSetBit => "find_first_set_bit",
|
||||
Ripemd_160 => "ripemd_160",
|
||||
ExpModInteger => "exp_mod_integer",
|
||||
// ExpModInteger => "exp_mod_integer",
|
||||
// CaseList => "case_list",
|
||||
// CaseData => "case_data",
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use super::{value::integer_log2, Error, Value};
|
||||
use super::{Error, Value};
|
||||
use crate::builtins::DefaultFunction;
|
||||
use num_traits::Signed;
|
||||
use pallas_primitives::conway::Language;
|
||||
|
@ -2676,31 +2676,31 @@ impl BuiltinCosts {
|
|||
mem: self.ripemd_160.mem.cost(args[0].to_ex_mem()),
|
||||
cpu: self.ripemd_160.cpu.cost(args[0].to_ex_mem()),
|
||||
},
|
||||
DefaultFunction::ExpModInteger => {
|
||||
let arg3 = args[2].unwrap_integer()?;
|
||||
if arg3.lt(&(0.into())) {
|
||||
return Err(Error::OutsideNaturalBounds(arg3.clone()));
|
||||
}
|
||||
// DefaultFunction::ExpModInteger => {
|
||||
// let arg3 = args[2].unwrap_integer()?;
|
||||
// if arg3.lt(&(0.into())) {
|
||||
// return Err(Error::OutsideNaturalBounds(arg3.clone()));
|
||||
// }
|
||||
|
||||
let arg3_exmem = if *arg3 == 0.into() {
|
||||
1
|
||||
} else {
|
||||
(integer_log2(arg3.abs()) / 64) + 1
|
||||
};
|
||||
// let arg3_exmem = if *arg3 == 0.into() {
|
||||
// 1
|
||||
// } else {
|
||||
// (integer_log2(arg3.abs()) / 64) + 1
|
||||
// };
|
||||
|
||||
ExBudget {
|
||||
mem: self.exp_mod_int.mem.cost(
|
||||
args[0].to_ex_mem(),
|
||||
args[1].to_ex_mem(),
|
||||
arg3_exmem,
|
||||
),
|
||||
cpu: self.exp_mod_int.cpu.cost(
|
||||
args[0].to_ex_mem(),
|
||||
args[1].to_ex_mem(),
|
||||
arg3_exmem,
|
||||
),
|
||||
}
|
||||
}
|
||||
// ExBudget {
|
||||
// mem: self.exp_mod_int.mem.cost(
|
||||
// args[0].to_ex_mem(),
|
||||
// args[1].to_ex_mem(),
|
||||
// arg3_exmem,
|
||||
// ),
|
||||
// cpu: self.exp_mod_int.cpu.cost(
|
||||
// args[0].to_ex_mem(),
|
||||
// args[1].to_ex_mem(),
|
||||
// arg3_exmem,
|
||||
// ),
|
||||
// }
|
||||
// }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,8 +191,8 @@ impl DefaultFunction {
|
|||
| DefaultFunction::RotateByteString
|
||||
| DefaultFunction::CountSetBits
|
||||
| DefaultFunction::FindFirstSetBit
|
||||
| DefaultFunction::Ripemd_160
|
||||
| DefaultFunction::ExpModInteger => false,
|
||||
| DefaultFunction::Ripemd_160 => false,
|
||||
// | DefaultFunction::ExpModInteger
|
||||
// | DefaultFunction::CaseList
|
||||
// | DefaultFunction::CaseData
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ impl DefaultFunction {
|
|||
DefaultFunction::CountSetBits => 1,
|
||||
DefaultFunction::FindFirstSetBit => 1,
|
||||
DefaultFunction::Ripemd_160 => 1,
|
||||
DefaultFunction::ExpModInteger => 3,
|
||||
// DefaultFunction::ExpModInteger => 3,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,7 +380,7 @@ impl DefaultFunction {
|
|||
DefaultFunction::CountSetBits => 0,
|
||||
DefaultFunction::FindFirstSetBit => 0,
|
||||
DefaultFunction::Ripemd_160 => 0,
|
||||
DefaultFunction::ExpModInteger => 0,
|
||||
// DefaultFunction::ExpModInteger => 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1761,8 +1761,7 @@ impl DefaultFunction {
|
|||
let value = Value::byte_string(bytes);
|
||||
|
||||
Ok(value)
|
||||
}
|
||||
DefaultFunction::ExpModInteger => todo!(),
|
||||
} // DefaultFunction::ExpModInteger => todo!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue