Skip to content

Commit

Permalink
Fix publishToMavenLocal (#381)
Browse files Browse the repository at this point in the history
Co-authored-by: Rui <[email protected]>

fix typo

remove custom setters
  • Loading branch information
prashanDYDX authored and yogurtandjam committed May 31, 2024
1 parent fd9a531 commit e34f7e6
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 13 deletions.
13 changes: 12 additions & 1 deletion src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object AbacusFactory {
stateNotification: StateNotificationProtocol? = null,
dataNotification: DataNotificationProtocol? = null,
presentationProtocol: PresentationProtocol? = null,
): AbacusComponent = AbacusComponent::class.create(
): AbacusComponent = createAbacusComponent(
deploymentUri,
deployment,
appConfigs,
Expand All @@ -61,3 +61,14 @@ abstract class AbacusComponent(
) {
abstract val stateManager: AsyncAbacusStateManagerV2
}

internal expect fun createAbacusComponent(
deploymentUri: DeploymentUri,
deployment: Deployment,
appConfigs: AppConfigsV2,
ioImplementations: IOImplementations,
uiImplementations: UIImplementations,
stateNotification: StateNotificationProtocol?,
dataNotification: DataNotificationProtocol?,
presentationProtocol: PresentationProtocol?,
): AbacusComponent
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class AsyncAbacusStateManager(
override var cosmosWalletConnected: Boolean? = false
set(value) {
field = value
ioImplementations.threading?.async(ThreadingType.main) {
ioImplementations.threading?.async(ThreadingType.abacus) {
adaptor?.cosmosWalletConnected = field
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,6 @@ open class StateManagerAdaptor(
}

var cosmosWalletConnected: Boolean? = false
set(value) {
if (field != value) {
field = value
}
}

private var accountAddressTimer: LocalTimerProtocol? = null
set(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import exchange.dydx.abacus.state.v2.supervisor.commitClosePosition
import exchange.dydx.abacus.state.v2.supervisor.commitPlaceOrder
import exchange.dydx.abacus.state.v2.supervisor.commitTriggerOrders
import exchange.dydx.abacus.state.v2.supervisor.connectedSubaccountNumber
import exchange.dydx.abacus.state.v2.supervisor.cosmosWalletConnected
import exchange.dydx.abacus.state.v2.supervisor.depositPayload
import exchange.dydx.abacus.state.v2.supervisor.faucet
import exchange.dydx.abacus.state.v2.supervisor.marketId
Expand Down Expand Up @@ -261,7 +262,7 @@ internal class StateManagerAdaptorV2(

internal var cosmosWalletConnected: Boolean?
get() {
return return accounts.cosmosWalletConnected
return accounts.cosmosWalletConnected
}
set(value) {
accounts.cosmosWalletConnected = value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ internal open class AccountSupervisor(
}

var cosmosWalletConnected: Boolean? = false
internal set(value) {
if (field != value) {
field = value
}
}

private var sourceAddressRestriction: Restriction? = null
set(value) {
Expand Down
28 changes: 28 additions & 0 deletions src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package exchange.dydx.abacus.di

import exchange.dydx.abacus.protocols.DataNotificationProtocol
import exchange.dydx.abacus.protocols.PresentationProtocol
import exchange.dydx.abacus.protocols.StateNotificationProtocol
import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2
import exchange.dydx.abacus.utils.IOImplementations
import exchange.dydx.abacus.utils.UIImplementations

internal actual fun createAbacusComponent(
deploymentUri: DeploymentUri,
deployment: Deployment,
appConfigs: AppConfigsV2,
ioImplementations: IOImplementations,
uiImplementations: UIImplementations,
stateNotification: StateNotificationProtocol?,
dataNotification: DataNotificationProtocol?,
presentationProtocol: PresentationProtocol?,
): AbacusComponent = AbacusComponent::class.create(
deploymentUri,
deployment,
appConfigs,
ioImplementations,
uiImplementations,
stateNotification,
dataNotification,
presentationProtocol,
)
28 changes: 28 additions & 0 deletions src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package exchange.dydx.abacus.di

import exchange.dydx.abacus.protocols.DataNotificationProtocol
import exchange.dydx.abacus.protocols.PresentationProtocol
import exchange.dydx.abacus.protocols.StateNotificationProtocol
import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2
import exchange.dydx.abacus.utils.IOImplementations
import exchange.dydx.abacus.utils.UIImplementations

internal actual fun createAbacusComponent(
deploymentUri: DeploymentUri,
deployment: Deployment,
appConfigs: AppConfigsV2,
ioImplementations: IOImplementations,
uiImplementations: UIImplementations,
stateNotification: StateNotificationProtocol?,
dataNotification: DataNotificationProtocol?,
presentationProtocol: PresentationProtocol?,
): AbacusComponent = AbacusComponent::class.create(
deploymentUri,
deployment,
appConfigs,
ioImplementations,
uiImplementations,
stateNotification,
dataNotification,
presentationProtocol,
)
28 changes: 28 additions & 0 deletions src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package exchange.dydx.abacus.di

import exchange.dydx.abacus.protocols.DataNotificationProtocol
import exchange.dydx.abacus.protocols.PresentationProtocol
import exchange.dydx.abacus.protocols.StateNotificationProtocol
import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2
import exchange.dydx.abacus.utils.IOImplementations
import exchange.dydx.abacus.utils.UIImplementations

internal actual fun createAbacusComponent(
deploymentUri: DeploymentUri,
deployment: Deployment,
appConfigs: AppConfigsV2,
ioImplementations: IOImplementations,
uiImplementations: UIImplementations,
stateNotification: StateNotificationProtocol?,
dataNotification: DataNotificationProtocol?,
presentationProtocol: PresentationProtocol?,
): AbacusComponent = AbacusComponent::class.create(
deploymentUri,
deployment,
appConfigs,
ioImplementations,
uiImplementations,
stateNotification,
dataNotification,
presentationProtocol,
)
28 changes: 28 additions & 0 deletions src/jvmMain/kotlin/di/AbacusComponent.jvm.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package exchange.dydx.abacus.di

import exchange.dydx.abacus.protocols.DataNotificationProtocol
import exchange.dydx.abacus.protocols.PresentationProtocol
import exchange.dydx.abacus.protocols.StateNotificationProtocol
import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2
import exchange.dydx.abacus.utils.IOImplementations
import exchange.dydx.abacus.utils.UIImplementations

internal actual fun createAbacusComponent(
deploymentUri: DeploymentUri,
deployment: Deployment,
appConfigs: AppConfigsV2,
ioImplementations: IOImplementations,
uiImplementations: UIImplementations,
stateNotification: StateNotificationProtocol?,
dataNotification: DataNotificationProtocol?,
presentationProtocol: PresentationProtocol?,
): AbacusComponent = AbacusComponent::class.create(
deploymentUri,
deployment,
appConfigs,
ioImplementations,
uiImplementations,
stateNotification,
dataNotification,
presentationProtocol,
)

0 comments on commit e34f7e6

Please sign in to comment.