Skip to content

Commit

Permalink
fix needs margin test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed May 23, 2024
1 parent f36d285 commit a8f476e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ internal class TradeInputCalculator(
): Map<String, Any>? {
fields?.let { fields ->
val options = mutableMapOf<String, Any>(
"needsMarginMode" to false,
"needsSize" to false,
"needsLeverage" to false,
"needsTargetLeverage" to false,
Expand Down Expand Up @@ -1188,6 +1189,10 @@ internal class TradeInputCalculator(
"marginModeOptions",
parser.asNativeList(field["options"]),
)
options.safeSet(
parser.asNativeList(field["options"]),
true,
)
}

"reduceOnly" -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) {
"current": "trade",
"trade": {
"marginMode": "ISOLATED",
"targetLeverage": 1.0
"targetLeverage": 1.0,
"options": {
"needsMarginMode": true
Expand All @@ -300,7 +299,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) {
"input": {
"current": "trade",
"trade": {
"marginMode": "CROSS"
"marginMode": "CROSS",
"options": {
"needsMarginMode": true
Expand All @@ -320,7 +318,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) {
"input": {
"current": "trade",
"trade": {
"marginMode": "ISOLATED"
"marginMode": "ISOLATED",
"options": {
"needsMarginMode": true
Expand All @@ -340,7 +337,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) {
"input": {
"current": "trade",
"trade": {
"marginMode": "CROSS"
"marginMode": "CROSS",
"options": {
"needsMarginMode": true
Expand All @@ -360,7 +356,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) {
"input": {
"current": "trade",
"trade": {
"marginMode": "ISOLATED"
"marginMode": "ISOLATED",
"options": {
"needsMarginMode": true
Expand All @@ -380,7 +375,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) {
"input": {
"current": "trade",
"trade": {
"marginMode": "CROSS"
"marginMode": "CROSS",
"options": {
"needsMarginMode": true
Expand Down

0 comments on commit a8f476e

Please sign in to comment.