From 47ae4fe3e1f5c94127293c5264da727e2e8d211c Mon Sep 17 00:00:00 2001 From: Rui Date: Fri, 25 Oct 2024 10:05:41 -0700 Subject: [PATCH] Add UT --- .../validation/TransferRequiredInputTests.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/validation/TransferRequiredInputTests.kt b/src/commonTest/kotlin/exchange.dydx.abacus/validation/TransferRequiredInputTests.kt index e3a30f892..5055a9a67 100644 --- a/src/commonTest/kotlin/exchange.dydx.abacus/validation/TransferRequiredInputTests.kt +++ b/src/commonTest/kotlin/exchange.dydx.abacus/validation/TransferRequiredInputTests.kt @@ -1,6 +1,7 @@ package exchange.dydx.abacus.validation import exchange.dydx.abacus.output.input.ErrorType +import exchange.dydx.abacus.output.input.InputType import exchange.dydx.abacus.output.input.TransferType import exchange.dydx.abacus.payload.v4.V4BaseTests import exchange.dydx.abacus.state.model.TransferInputField @@ -38,9 +39,19 @@ class TransferRequiredInputTests : V4BaseTests() { override fun reset() { super.reset() - test({ + + if (perp.staticTyping) { perp.transfer(null, null, environment = mock.v4Environment) - }, null) + + assertEquals(InputType.TRANSFER, perp.internalState.input.currentType) + + val transfer = perp.internalState.input.transfer + assertEquals(TransferType.deposit, transfer.type) + } else { + test({ + perp.transfer(null, null, environment = mock.v4Environment) + }, null) + } } private fun testTransferInputDeposit() {