diff --git a/lang/shared/src/main/scala/com/wavesplatform/lang/v1/evaluator/ctx/impl/waves/Functions.scala b/lang/shared/src/main/scala/com/wavesplatform/lang/v1/evaluator/ctx/impl/waves/Functions.scala index 86f30ccac4..cf38917991 100644 --- a/lang/shared/src/main/scala/com/wavesplatform/lang/v1/evaluator/ctx/impl/waves/Functions.scala +++ b/lang/shared/src/main/scala/com/wavesplatform/lang/v1/evaluator/ctx/impl/waves/Functions.scala @@ -642,6 +642,8 @@ object Functions { } case arg :: _ => errorF(s"Unexpected recipient arg $arg") + case args => + errorF(s"Unexpected args $args") } ) name <- EitherT[F, ExecutionError, String]( @@ -649,6 +651,7 @@ object Functions { case _ :: CONST_STRING(name) :: _ => name.asRight[ExecutionError].pure[F] case _ :: CaseObj(UNIT, _) :: _ => "default".asRight[ExecutionError].pure[F] case _ :: arg :: _ => errorF(s"Unexpected name arg $arg") + case args => errorF(s"Unexpected args $args") } ) payments <- EitherT[F, ExecutionError, Seq[(Option[Array[Byte]], Long)]]( diff --git a/node/src/test/scala/com/wavesplatform/state/diffs/smart/RideExceptionsTest.scala b/node/src/test/scala/com/wavesplatform/state/diffs/smart/RideExceptionsTest.scala index 385c9b0e77..18c9497a19 100644 --- a/node/src/test/scala/com/wavesplatform/state/diffs/smart/RideExceptionsTest.scala +++ b/node/src/test/scala/com/wavesplatform/state/diffs/smart/RideExceptionsTest.scala @@ -13,7 +13,7 @@ import com.wavesplatform.lang.script.v1.ExprScript.ExprScriptImpl import com.wavesplatform.lang.v1.FunctionHeader.{Native, User} import com.wavesplatform.lang.v1.compiler.Terms.* import com.wavesplatform.lang.v1.compiler.TestCompiler -import com.wavesplatform.lang.v1.evaluator.FunctionIds.{ACCOUNTWAVESBALANCE, CALLDAPP, CREATE_MERKLE_ROOT} +import com.wavesplatform.lang.v1.evaluator.FunctionIds.* import com.wavesplatform.protobuf.dapp.DAppMeta import com.wavesplatform.test.DomainPresets.{TransactionStateSnapshot, WavesSettingsOps} import com.wavesplatform.test.{PropSpec, produce} @@ -26,6 +26,21 @@ class RideExceptionsTest extends PropSpec with WithDomain { "Unexpected recipient type Unit", rejectBefore = false ) + assert( + FUNCTION_CALL(Native(ACCOUNTASSETONLYBALANCE), List(REF("unit"), CONST_BYTESTR(ByteStr.empty).explicitGet())), + "Unexpected recipient type Unit", + rejectBefore = false + ) + assert( + FUNCTION_CALL(Native(ACCOUNTSCRIPTHASH), List(REF("unit"))), + "Unexpected recipient type Unit", + rejectBefore = false + ) + assert( + FUNCTION_CALL(Native(CALCULATE_LEASE_ID), List(FUNCTION_CALL(User("Lease"), List(REF("unit"))))), + "Unexpected recipient type Unit", + rejectBefore = false + ) assert( FUNCTION_CALL(Native(CALLDAPP), List(CONST_LONG(1), CONST_LONG(1), CONST_LONG(1), CONST_LONG(1))), "Unexpected recipient arg",