Repository: ergoplatform/sigma-rust (language: rust)

Issue:
Rename `UnaryOp*` traits to `OneArgOp*`
### Motivation
When introducing similar traits for IR nodes that have two arguments one would expect to name them `BinaryOp*`, but we already have `BinOp` that serves a completely different purpose. Instead, the names `TwoArgOp*` were used in #292. So, in order to be consistent, I suggest we rename `UnaryOp*` traits to `OneArgOp*`.




Discussion / hints:
@Shimuuar What do you think?
Overall I deeply apathetic about it, but since BinOp is taken such renaming does make sense

Fix patch:
diff --git a/ergotree-interpreter/src/eval/bit_inversion.rs b/ergotree-interpreter/src/eval/bit_inversion.rs
index 31bce72aa..61bd51653 100644
--- a/ergotree-interpreter/src/eval/bit_inversion.rs
+++ b/ergotree-interpreter/src/eval/bit_inversion.rs
@@ -33,7 +33,7 @@ mod tests {
     use ergotree_ir::mir::constant::Constant;
     use ergotree_ir::mir::constant::TryExtractFrom;
     use ergotree_ir::mir::expr::Expr;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use num_traits::Num;
 
     fn run_eval<T: Num + Into<Constant> + TryExtractFrom<Value>>(input: T) -> T {
diff --git a/ergotree-interpreter/src/eval/coll_filter.rs b/ergotree-interpreter/src/eval/coll_filter.rs
index 9bd0766c7..b4a4c70a9 100644
--- a/ergotree-interpreter/src/eval/coll_filter.rs
+++ b/ergotree-interpreter/src/eval/coll_filter.rs
@@ -87,7 +87,7 @@ mod tests {
     use ergotree_ir::mir::func_value::FuncArg;
     use ergotree_ir::mir::func_value::FuncValue;
     use ergotree_ir::mir::property_call::PropertyCall;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use ergotree_ir::mir::val_use::ValUse;
     use ergotree_ir::types::scontext;
     use ergotree_ir::types::stype::SType;
diff --git a/ergotree-interpreter/src/eval/coll_fold.rs b/ergotree-interpreter/src/eval/coll_fold.rs
index 6173089f7..ea45907b4 100644
--- a/ergotree-interpreter/src/eval/coll_fold.rs
+++ b/ergotree-interpreter/src/eval/coll_fold.rs
@@ -69,7 +69,7 @@ mod tests {
     use ergotree_ir::mir::func_value::FuncValue;
     use ergotree_ir::mir::property_call::PropertyCall;
     use ergotree_ir::mir::select_field::SelectField;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use ergotree_ir::mir::val_use::ValUse;
     use ergotree_ir::types::scontext;
     use ergotree_ir::types::stuple::STuple;
diff --git a/ergotree-interpreter/src/eval/coll_map.rs b/ergotree-interpreter/src/eval/coll_map.rs
index 30098331e..bdb913552 100644
--- a/ergotree-interpreter/src/eval/coll_map.rs
+++ b/ergotree-interpreter/src/eval/coll_map.rs
@@ -80,7 +80,7 @@ mod tests {
     use ergotree_ir::mir::func_value::FuncArg;
     use ergotree_ir::mir::func_value::FuncValue;
     use ergotree_ir::mir::property_call::PropertyCall;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use ergotree_ir::mir::val_use::ValUse;
     use ergotree_ir::types::scontext;
     use ergotree_ir::types::stype::SType;
diff --git a/ergotree-interpreter/src/eval/coll_size.rs b/ergotree-interpreter/src/eval/coll_size.rs
index 9b21ac7d0..87db1e37c 100644
--- a/ergotree-interpreter/src/eval/coll_size.rs
+++ b/ergotree-interpreter/src/eval/coll_size.rs
@@ -28,7 +28,7 @@ mod tests {
     use crate::eval::tests::eval_out;
     use ergotree_ir::mir::expr::Expr;
     use ergotree_ir::mir::global_vars::GlobalVars;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use sigma_test_util::force_any_val;
     use std::rc::Rc;
 
diff --git a/ergotree-interpreter/src/eval/extract_creation_info.rs b/ergotree-interpreter/src/eval/extract_creation_info.rs
index bb22feb3b..13fd62a87 100644
--- a/ergotree-interpreter/src/eval/extract_creation_info.rs
+++ b/ergotree-interpreter/src/eval/extract_creation_info.rs
@@ -28,7 +28,7 @@ mod tests {
 
     use ergotree_ir::mir::expr::Expr;
     use ergotree_ir::mir::global_vars::GlobalVars;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use sigma_test_util::force_any_val;
 
     use super::*;
diff --git a/ergotree-interpreter/src/eval/extract_reg_as.rs b/ergotree-interpreter/src/eval/extract_reg_as.rs
index 2d59e20d6..e57a44968 100644
--- a/ergotree-interpreter/src/eval/extract_reg_as.rs
+++ b/ergotree-interpreter/src/eval/extract_reg_as.rs
@@ -30,7 +30,7 @@ mod tests {
     use ergotree_ir::mir::expr::Expr;
     use ergotree_ir::mir::global_vars::GlobalVars;
     use ergotree_ir::mir::option_get::OptionGet;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use ergotree_ir::types::stype::SType;
     use sigma_test_util::force_any_val;
     use std::rc::Rc;
diff --git a/ergotree-interpreter/src/eval/method_call.rs b/ergotree-interpreter/src/eval/method_call.rs
index ad7745761..67693c314 100644
--- a/ergotree-interpreter/src/eval/method_call.rs
+++ b/ergotree-interpreter/src/eval/method_call.rs
@@ -26,7 +26,7 @@ mod tests {
     use ergotree_ir::mir::expr::Expr;
     use ergotree_ir::mir::global_vars::GlobalVars;
     use ergotree_ir::mir::option_get::OptionGet;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use ergotree_ir::types::sbox;
     use sigma_test_util::force_any_val;
 
diff --git a/ergotree-interpreter/src/eval/negation.rs b/ergotree-interpreter/src/eval/negation.rs
index 3da3ac23e..dc58a609b 100644
--- a/ergotree-interpreter/src/eval/negation.rs
+++ b/ergotree-interpreter/src/eval/negation.rs
@@ -43,7 +43,7 @@ mod tests {
     use ergotree_ir::mir::constant::Constant;
     use ergotree_ir::mir::constant::TryExtractFrom;
     use ergotree_ir::mir::expr::Expr;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use num_traits::{Bounded, Num};
 
     fn try_run_eval<T: Num + Into<Constant> + TryExtractFrom<Value>>(
diff --git a/ergotree-interpreter/src/eval/option_get.rs b/ergotree-interpreter/src/eval/option_get.rs
index 975e6a070..d835255a1 100644
--- a/ergotree-interpreter/src/eval/option_get.rs
+++ b/ergotree-interpreter/src/eval/option_get.rs
@@ -30,7 +30,7 @@ mod tests {
     use ergotree_ir::mir::expr::Expr;
     use ergotree_ir::mir::extract_reg_as::ExtractRegisterAs;
     use ergotree_ir::mir::global_vars::GlobalVars;
-    use ergotree_ir::mir::unary_op::UnaryOpTryBuild;
+    use ergotree_ir::mir::unary_op::OneArgOpTryBuild;
     use ergotree_ir::types::stype::SType;
     use sigma_test_util::force_any_val;
     use std::rc::Rc;
diff --git a/ergotree-ir/src/mir/bit_inversion.rs b/ergotree-ir/src/mir/bit_inversion.rs
index b4ceb1871..8ae8f4e0e 100644
--- a/ergotree-ir/src/mir/bit_inversion.rs
+++ b/ergotree-ir/src/mir/bit_inversion.rs
@@ -1,7 +1,7 @@
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 use crate::serialization::op_code::OpCode;
 use crate::types::stype::SType;
@@ -24,13 +24,13 @@ impl HasStaticOpCode for BitInversion {
     const OP_CODE: OpCode = OpCode::BIT_INVERSION;
 }
 
-impl UnaryOp for BitInversion {
+impl OneArgOp for BitInversion {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for BitInversion {
+impl OneArgOpTryBuild for BitInversion {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         let post_eval_tpe = input.post_eval_tpe();
         if !post_eval_tpe.is_numeric() {
diff --git a/ergotree-ir/src/mir/bool_to_sigma.rs b/ergotree-ir/src/mir/bool_to_sigma.rs
index d7abe8714..851e85008 100644
--- a/ergotree-ir/src/mir/bool_to_sigma.rs
+++ b/ergotree-ir/src/mir/bool_to_sigma.rs
@@ -1,7 +1,7 @@
 //! Embedding of Boolean values to SigmaProp
 use crate::has_opcode::HasStaticOpCode;
-use crate::mir::unary_op::UnaryOp;
-use crate::mir::unary_op::UnaryOpTryBuild;
+use crate::mir::unary_op::OneArgOp;
+use crate::mir::unary_op::OneArgOpTryBuild;
 use crate::serialization::op_code::OpCode;
 use crate::types::stype::SType;
 
@@ -29,13 +29,13 @@ impl HasStaticOpCode for BoolToSigmaProp {
     const OP_CODE: OpCode = OpCode::BOOL_TO_SIGMA_PROP;
 }
 
-impl UnaryOp for BoolToSigmaProp {
+impl OneArgOp for BoolToSigmaProp {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for BoolToSigmaProp {
+impl OneArgOpTryBuild for BoolToSigmaProp {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SBoolean)?;
         Ok(Self {
diff --git a/ergotree-ir/src/mir/byte_array_to_bigint.rs b/ergotree-ir/src/mir/byte_array_to_bigint.rs
index 843098f08..f52314440 100644
--- a/ergotree-ir/src/mir/byte_array_to_bigint.rs
+++ b/ergotree-ir/src/mir/byte_array_to_bigint.rs
@@ -4,8 +4,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Convert byte array to SBigInt
@@ -26,13 +26,13 @@ impl HasStaticOpCode for ByteArrayToBigInt {
     const OP_CODE: OpCode = OpCode::BYTE_ARRAY_TO_BIGINT;
 }
 
-impl UnaryOp for ByteArrayToBigInt {
+impl OneArgOp for ByteArrayToBigInt {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for ByteArrayToBigInt {
+impl OneArgOpTryBuild for ByteArrayToBigInt {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SColl(Box::new(SType::SByte)))?;
         Ok(ByteArrayToBigInt {
diff --git a/ergotree-ir/src/mir/byte_array_to_long.rs b/ergotree-ir/src/mir/byte_array_to_long.rs
index bbc0ec1d2..d0ca41fbf 100644
--- a/ergotree-ir/src/mir/byte_array_to_long.rs
+++ b/ergotree-ir/src/mir/byte_array_to_long.rs
@@ -4,8 +4,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Convert byte array to SLong
@@ -26,13 +26,13 @@ impl HasStaticOpCode for ByteArrayToLong {
     const OP_CODE: OpCode = OpCode::BYTE_ARRAY_TO_LONG;
 }
 
-impl UnaryOp for ByteArrayToLong {
+impl OneArgOp for ByteArrayToLong {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for ByteArrayToLong {
+impl OneArgOpTryBuild for ByteArrayToLong {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SColl(Box::new(SType::SByte)))?;
         Ok(ByteArrayToLong {
diff --git a/ergotree-ir/src/mir/calc_blake2b256.rs b/ergotree-ir/src/mir/calc_blake2b256.rs
index 52a1edd8a..d86db8f1b 100644
--- a/ergotree-ir/src/mir/calc_blake2b256.rs
+++ b/ergotree-ir/src/mir/calc_blake2b256.rs
@@ -4,8 +4,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 
 /// Calc Blake2b 256-bit hash
 #[derive(PartialEq, Eq, Debug, Clone)]
@@ -25,13 +25,13 @@ impl HasStaticOpCode for CalcBlake2b256 {
     const OP_CODE: OpCode = OpCode::CALC_BLAKE2B256;
 }
 
-impl UnaryOp for CalcBlake2b256 {
+impl OneArgOp for CalcBlake2b256 {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for CalcBlake2b256 {
+impl OneArgOpTryBuild for CalcBlake2b256 {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SColl(Box::new(SType::SByte)))?;
         Ok(CalcBlake2b256 {
diff --git a/ergotree-ir/src/mir/calc_sha256.rs b/ergotree-ir/src/mir/calc_sha256.rs
index 275423208..2cbe5f2fd 100644
--- a/ergotree-ir/src/mir/calc_sha256.rs
+++ b/ergotree-ir/src/mir/calc_sha256.rs
@@ -4,8 +4,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 
 /// Calc Sha 256-bit hash
 #[derive(PartialEq, Eq, Debug, Clone)]
@@ -25,13 +25,13 @@ impl HasStaticOpCode for CalcSha256 {
     const OP_CODE: OpCode = OpCode::CALC_SHA256;
 }
 
-impl UnaryOp for CalcSha256 {
+impl OneArgOp for CalcSha256 {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for CalcSha256 {
+impl OneArgOpTryBuild for CalcSha256 {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SColl(Box::new(SType::SByte)))?;
         Ok(CalcSha256 {
diff --git a/ergotree-ir/src/mir/coll_size.rs b/ergotree-ir/src/mir/coll_size.rs
index fe61f2a67..ef676b6e6 100644
--- a/ergotree-ir/src/mir/coll_size.rs
+++ b/ergotree-ir/src/mir/coll_size.rs
@@ -3,8 +3,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Collection size
@@ -25,13 +25,13 @@ impl HasStaticOpCode for SizeOf {
     const OP_CODE: OpCode = OpCode::SIZE_OF;
 }
 
-impl UnaryOp for SizeOf {
+impl OneArgOp for SizeOf {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for SizeOf {
+impl OneArgOpTryBuild for SizeOf {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         match input.post_eval_tpe() {
             SType::SColl(_) => Ok(Self {
diff --git a/ergotree-ir/src/mir/create_provedlog.rs b/ergotree-ir/src/mir/create_provedlog.rs
index 37dbf0162..f73f13820 100644
--- a/ergotree-ir/src/mir/create_provedlog.rs
+++ b/ergotree-ir/src/mir/create_provedlog.rs
@@ -3,8 +3,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Create ProveDlog from PK
@@ -25,13 +25,13 @@ impl HasStaticOpCode for CreateProveDlog {
     const OP_CODE: OpCode = OpCode::PROVE_DLOG;
 }
 
-impl UnaryOp for CreateProveDlog {
+impl OneArgOp for CreateProveDlog {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for CreateProveDlog {
+impl OneArgOpTryBuild for CreateProveDlog {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SGroupElement)?;
         Ok(CreateProveDlog {
diff --git a/ergotree-ir/src/mir/decode_point.rs b/ergotree-ir/src/mir/decode_point.rs
index 5c3d80ce6..2cbe5e3e3 100644
--- a/ergotree-ir/src/mir/decode_point.rs
+++ b/ergotree-ir/src/mir/decode_point.rs
@@ -5,8 +5,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Decode byte array to EC point
@@ -27,13 +27,13 @@ impl HasStaticOpCode for DecodePoint {
     const OP_CODE: OpCode = OpCode::DECODE_POINT;
 }
 
-impl UnaryOp for DecodePoint {
+impl OneArgOp for DecodePoint {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for DecodePoint {
+impl OneArgOpTryBuild for DecodePoint {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SColl(Box::new(SType::SByte)))?;
         Ok(Self {
diff --git a/ergotree-ir/src/mir/extract_amount.rs b/ergotree-ir/src/mir/extract_amount.rs
index 1f04fd8f9..9b8166733 100644
--- a/ergotree-ir/src/mir/extract_amount.rs
+++ b/ergotree-ir/src/mir/extract_amount.rs
@@ -3,8 +3,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Box value
@@ -25,13 +25,13 @@ impl HasStaticOpCode for ExtractAmount {
     const OP_CODE: OpCode = OpCode::EXTRACT_AMOUNT;
 }
 
-impl UnaryOp for ExtractAmount {
+impl OneArgOp for ExtractAmount {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for ExtractAmount {
+impl OneArgOpTryBuild for ExtractAmount {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SBox)?;
         Ok(ExtractAmount {
diff --git a/ergotree-ir/src/mir/extract_creation_info.rs b/ergotree-ir/src/mir/extract_creation_info.rs
index c2fac2177..099e9eb13 100644
--- a/ergotree-ir/src/mir/extract_creation_info.rs
+++ b/ergotree-ir/src/mir/extract_creation_info.rs
@@ -4,8 +4,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Tuple of height when block got included into the blockchain and transaction identifier with
@@ -27,13 +27,13 @@ impl HasStaticOpCode for ExtractCreationInfo {
     const OP_CODE: OpCode = OpCode::EXTRACT_CREATION_INFO;
 }
 
-impl UnaryOp for ExtractCreationInfo {
+impl OneArgOp for ExtractCreationInfo {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for ExtractCreationInfo {
+impl OneArgOpTryBuild for ExtractCreationInfo {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SBox)?;
         Ok(ExtractCreationInfo {
diff --git a/ergotree-ir/src/mir/extract_id.rs b/ergotree-ir/src/mir/extract_id.rs
index b8c839e62..6900446dd 100644
--- a/ergotree-ir/src/mir/extract_id.rs
+++ b/ergotree-ir/src/mir/extract_id.rs
@@ -3,8 +3,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Box id, Blake2b256 hash of this box's content, basically equals to `blake2b256(bytes)`
@@ -25,13 +25,13 @@ impl HasStaticOpCode for ExtractId {
     const OP_CODE: OpCode = OpCode::EXTRACT_ID;
 }
 
-impl UnaryOp for ExtractId {
+impl OneArgOp for ExtractId {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for ExtractId {
+impl OneArgOpTryBuild for ExtractId {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SBox)?;
         Ok(ExtractId {
diff --git a/ergotree-ir/src/mir/extract_script_bytes.rs b/ergotree-ir/src/mir/extract_script_bytes.rs
index d4c56388e..5912c2def 100644
--- a/ergotree-ir/src/mir/extract_script_bytes.rs
+++ b/ergotree-ir/src/mir/extract_script_bytes.rs
@@ -3,8 +3,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Serialized box guarding script
@@ -25,13 +25,13 @@ impl HasStaticOpCode for ExtractScriptBytes {
     const OP_CODE: OpCode = OpCode::EXTRACT_SCRIPT_BYTES;
 }
 
-impl UnaryOp for ExtractScriptBytes {
+impl OneArgOp for ExtractScriptBytes {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for ExtractScriptBytes {
+impl OneArgOpTryBuild for ExtractScriptBytes {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SBox)?;
         Ok(ExtractScriptBytes {
diff --git a/ergotree-ir/src/mir/logical_not.rs b/ergotree-ir/src/mir/logical_not.rs
index 5d4b3f386..7418d8d95 100644
--- a/ergotree-ir/src/mir/logical_not.rs
+++ b/ergotree-ir/src/mir/logical_not.rs
@@ -1,7 +1,7 @@
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 use crate::serialization::op_code::OpCode;
 use crate::types::stype::SType;
@@ -24,13 +24,13 @@ impl HasStaticOpCode for LogicalNot {
     const OP_CODE: OpCode = OpCode::LOGICAL_NOT;
 }
 
-impl UnaryOp for LogicalNot {
+impl OneArgOp for LogicalNot {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for LogicalNot {
+impl OneArgOpTryBuild for LogicalNot {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SBoolean)?;
         Ok(Self {
diff --git a/ergotree-ir/src/mir/long_to_byte_array.rs b/ergotree-ir/src/mir/long_to_byte_array.rs
index 00319c5db..2c858d90c 100644
--- a/ergotree-ir/src/mir/long_to_byte_array.rs
+++ b/ergotree-ir/src/mir/long_to_byte_array.rs
@@ -4,8 +4,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Convert SLong to byte array
@@ -26,13 +26,13 @@ impl HasStaticOpCode for LongToByteArray {
     const OP_CODE: OpCode = OpCode::LONG_TO_BYTE_ARRAY;
 }
 
-impl UnaryOp for LongToByteArray {
+impl OneArgOp for LongToByteArray {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for LongToByteArray {
+impl OneArgOpTryBuild for LongToByteArray {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError>
     where
         Self: Sized,
diff --git a/ergotree-ir/src/mir/negation.rs b/ergotree-ir/src/mir/negation.rs
index a5a487e3f..c64f971b1 100644
--- a/ergotree-ir/src/mir/negation.rs
+++ b/ergotree-ir/src/mir/negation.rs
@@ -1,7 +1,7 @@
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 use crate::serialization::op_code::OpCode;
 use crate::types::stype::SType;
@@ -24,13 +24,13 @@ impl HasStaticOpCode for Negation {
     const OP_CODE: OpCode = OpCode::NEGATION;
 }
 
-impl UnaryOp for Negation {
+impl OneArgOp for Negation {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for Negation {
+impl OneArgOpTryBuild for Negation {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         let post_eval_tpe = input.post_eval_tpe();
         if !post_eval_tpe.is_numeric() {
diff --git a/ergotree-ir/src/mir/option_get.rs b/ergotree-ir/src/mir/option_get.rs
index 3b567d821..76dd316fb 100644
--- a/ergotree-ir/src/mir/option_get.rs
+++ b/ergotree-ir/src/mir/option_get.rs
@@ -1,7 +1,7 @@
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 use crate::serialization::op_code::OpCode;
 use crate::types::stype::SType;
@@ -26,13 +26,13 @@ impl HasStaticOpCode for OptionGet {
     const OP_CODE: OpCode = OpCode::OPTION_GET;
 }
 
-impl UnaryOp for OptionGet {
+impl OneArgOp for OptionGet {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for OptionGet {
+impl OneArgOpTryBuild for OptionGet {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         match input.post_eval_tpe() {
             SType::SOption(elem_tpe) => Ok(OptionGet {
diff --git a/ergotree-ir/src/mir/option_is_defined.rs b/ergotree-ir/src/mir/option_is_defined.rs
index db9228347..98e8df6ef 100644
--- a/ergotree-ir/src/mir/option_is_defined.rs
+++ b/ergotree-ir/src/mir/option_is_defined.rs
@@ -1,7 +1,7 @@
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 use crate::serialization::op_code::OpCode;
 use crate::types::stype::SType;
@@ -24,13 +24,13 @@ impl HasStaticOpCode for OptionIsDefined {
     const OP_CODE: OpCode = OpCode::OPTION_IS_DEFINED;
 }
 
-impl UnaryOp for OptionIsDefined {
+impl OneArgOp for OptionIsDefined {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for OptionIsDefined {
+impl OneArgOpTryBuild for OptionIsDefined {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError>
     where
         Self: Sized,
diff --git a/ergotree-ir/src/mir/sigma_prop_bytes.rs b/ergotree-ir/src/mir/sigma_prop_bytes.rs
index 4c89512f3..f63b56ab8 100644
--- a/ergotree-ir/src/mir/sigma_prop_bytes.rs
+++ b/ergotree-ir/src/mir/sigma_prop_bytes.rs
@@ -3,8 +3,8 @@ use crate::types::stype::SType;
 
 use super::expr::Expr;
 use super::expr::InvalidArgumentError;
-use super::unary_op::UnaryOp;
-use super::unary_op::UnaryOpTryBuild;
+use super::unary_op::OneArgOp;
+use super::unary_op::OneArgOpTryBuild;
 use crate::has_opcode::HasStaticOpCode;
 
 /// Extract serialized bytes of a SigmaProp value
@@ -25,13 +25,13 @@ impl HasStaticOpCode for SigmaPropBytes {
     const OP_CODE: OpCode = OpCode::SIGMA_PROP_BYTES;
 }
 
-impl UnaryOp for SigmaPropBytes {
+impl OneArgOp for SigmaPropBytes {
     fn input(&self) -> &Expr {
         &self.input
     }
 }
 
-impl UnaryOpTryBuild for SigmaPropBytes {
+impl OneArgOpTryBuild for SigmaPropBytes {
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError> {
         input.check_post_eval_tpe(&SType::SSigmaProp)?;
         Ok(SigmaPropBytes {
diff --git a/ergotree-ir/src/mir/unary_op.rs b/ergotree-ir/src/mir/unary_op.rs
index 24d090619..6cbb6823a 100644
--- a/ergotree-ir/src/mir/unary_op.rs
+++ b/ergotree-ir/src/mir/unary_op.rs
@@ -10,18 +10,18 @@ use super::expr::Expr;
 use super::expr::InvalidArgumentError;
 
 /// IR nodes with one input value(expr)
-pub trait UnaryOp {
+pub trait OneArgOp {
     /// Input value(expr) of the IR node
     fn input(&self) -> &Expr;
 }
 
 /// Constructor for unary IR nodes that check the validity of the argument
-pub trait UnaryOpTryBuild: Sized {
+pub trait OneArgOpTryBuild: Sized {
     /// Create new IR node, returns an error if any of the requirements failed
     fn try_build(input: Expr) -> Result<Self, InvalidArgumentError>;
 }
 
-impl<T: UnaryOp + UnaryOpTryBuild> SigmaSerializable for T {
+impl<T: OneArgOp + OneArgOpTryBuild> SigmaSerializable for T {
     fn sigma_serialize<W: SigmaByteWrite>(&self, w: &mut W) -> SigmaSerializeResult {
         self.input().sigma_serialize(w)
     }


Test patch: