Skip to content

Commit

Permalink
Add UT
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Oct 25, 2024
1 parent 8df00ae commit 47ae4fe
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 47ae4fe

Please sign in to comment.