-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static Typing: Updating existing tests and bug fixes (2/n) #605
Conversation
ruixhuang
commented
Aug 28, 2024
•
edited
Loading
edited
- Updating all remaining tests other than those for transfers
- Updating PositionsNotificationProvider for static typing
- Fixing a trigger order calculation bug with the old codepath (see comment below)
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/state/internalstate/InternalState.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Trades.kt
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/processor/markets/MarketProcessor.kt # src/commonMain/kotlin/exchange.dydx.abacus/processor/markets/MarketsProcessor.kt # src/commonMain/kotlin/exchange.dydx.abacus/processor/markets/MarketsSummaryProcessor.kt # src/commonTest/kotlin/exchange.dydx.abacus/processor/markets/MarketProcessorTests.kt # src/commonTest/kotlin/exchange.dydx.abacus/processor/markets/MarketsProcessorTests.kt # src/commonTest/kotlin/exchange.dydx.abacus/tests/mock/processor/markets/MarketProcessorMock.kt
… into feature/markets_4
This reverts commit d52adce.
…to feature/calc_1
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/processor/input/ClosePositionInputProcessor.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/internalstate/InternalState.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt
# Conflicts: # src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4TradeInputTests.kt
@@ -284,7 +290,7 @@ internal class TriggerOrdersInputCalculator(val parser: ParserProtocol) { | |||
OrderType.TakeProfitMarket, OrderType.StopMarket -> { | |||
val triggerPrice = | |||
parser.asDouble(parser.value(triggerOrder, "price.triggerPrice")) | |||
val majorMarket = MAJOR_MARKETS.contains(parser.asString(triggerOrder["marketId"])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"marketId" is located at the one level above instead of here. @moo-onthelawn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah marketId
doesn't exist in data class TriggerOrder
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so the calculation is not correct :-(
@@ -100,18 +101,3 @@ internal fun TradingStateMachine.findOrder( | |||
} ?: return null | |||
return order | |||
} | |||
|
|||
internal fun TradingStateMachine.findOrderInData( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
completely unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes