Skip to content

Commit

Permalink
Additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xrtm000 committed Oct 16, 2023
1 parent 262578f commit c5f374c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -642,13 +642,16 @@ object Functions {
}
case arg :: _ =>
errorF(s"Unexpected recipient arg $arg")
case args =>
errorF(s"Unexpected args $args")
}
)
name <- EitherT[F, ExecutionError, String](
args match {
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)]](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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",
Expand Down

0 comments on commit c5f374c

Please sign in to comment.