Skip to content
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

Closed
wants to merge 118 commits into from

Conversation

ruixhuang
Copy link
Contributor

@ruixhuang ruixhuang commented Aug 28, 2024

  • 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)

ruixhuang and others added 30 commits August 1, 2024 14:11
# 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
…4-abacus into feature/markets_4"

This reverts commit 60d8eb6, reversing
changes made to d52adce.
ruixhuang and others added 13 commits August 27, 2024 04:50
# 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
@ruixhuang ruixhuang marked this pull request as ready for review August 28, 2024 01:27
@@ -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"]))
Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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 :-(

Base automatically changed from feature/trade_8 to main August 28, 2024 15:22
@@ -100,18 +101,3 @@ internal fun TradingStateMachine.findOrder(
} ?: return null
return order
}

internal fun TradingStateMachine.findOrderInData(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

completely unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

jaredvu
jaredvu previously approved these changes Sep 3, 2024
@ruixhuang ruixhuang closed this Sep 8, 2024
@ruixhuang ruixhuang deleted the feature/trade_9 branch September 10, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants