-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1773 from novasamatech/myth_staking/select_collator
Myth staking/select collator
- Loading branch information
Showing
52 changed files
with
1,253 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 18 additions & 1 deletion
19
...vafoundation/nova/app/root/navigation/navigators/staking/mythos/MythosStakingNavigator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
package io.novafoundation.nova.app.root.navigation.navigators.staking.mythos | ||
|
||
import io.novafoundation.nova.app.R | ||
import io.novafoundation.nova.app.root.navigation.navigators.BaseNavigator | ||
import io.novafoundation.nova.app.root.navigation.navigators.NavigationHoldersRegistry | ||
import io.novafoundation.nova.feature_staking_impl.presentation.MythosStakingRouter | ||
import io.novafoundation.nova.feature_staking_impl.presentation.validators.details.StakeTargetDetailsPayload | ||
import io.novafoundation.nova.feature_staking_impl.presentation.validators.details.ValidatorDetailsFragment | ||
|
||
class MythosStakingNavigator( | ||
navigationHoldersRegistry: NavigationHoldersRegistry, | ||
) : BaseNavigator(navigationHoldersRegistry), MythosStakingRouter | ||
) : BaseNavigator(navigationHoldersRegistry), MythosStakingRouter { | ||
|
||
override fun openCollatorDetails(payload: StakeTargetDetailsPayload) { | ||
navigationBuilder() | ||
.action(R.id.open_validator_details) | ||
.setArgs(ValidatorDetailsFragment.getBundle(payload)) | ||
.navigateInFirstAttachedContext() | ||
} | ||
|
||
override fun returnToStartStaking() { | ||
navigationBuilder() | ||
.action(R.id.action_return_to_start_staking) | ||
.navigateInFirstAttachedContext() | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...gation/navigators/staking/mythos/SelectMythCollatorSettingsInterScreenCommunicatorImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.novafoundation.nova.app.root.navigation.navigators.staking.mythos | ||
|
||
import io.novafoundation.nova.app.R | ||
import io.novafoundation.nova.app.root.navigation.NavStackInterScreenCommunicator | ||
import io.novafoundation.nova.app.root.navigation.navigators.NavigationHoldersRegistry | ||
import io.novafoundation.nova.feature_staking_impl.presentation.mythos.start.selectCollatorSettings.SelectMythCollatorSettingsFragment | ||
import io.novafoundation.nova.feature_staking_impl.presentation.mythos.start.selectCollatorSettings.SelectMythCollatorSettingsInterScreenCommunicator | ||
import io.novafoundation.nova.feature_staking_impl.presentation.mythos.start.selectCollatorSettings.model.MythCollatorRecommendationConfigParcel | ||
|
||
class SelectMythCollatorSettingsInterScreenCommunicatorImpl(navigationHoldersRegistry: NavigationHoldersRegistry) : | ||
SelectMythCollatorSettingsInterScreenCommunicator, | ||
NavStackInterScreenCommunicator<MythCollatorRecommendationConfigParcel, MythCollatorRecommendationConfigParcel>(navigationHoldersRegistry) { | ||
|
||
override fun openRequest(request: MythCollatorRecommendationConfigParcel) { | ||
super.openRequest(request) | ||
|
||
val bundle = SelectMythCollatorSettingsFragment.getBundle(request) | ||
navController.navigate(R.id.action_selectMythosCollatorFragment_to_selectMythCollatorSettingsFragment, bundle) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...t/navigation/navigators/staking/mythos/SelectMythosCollatorInterScreenCommunicatorImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.novafoundation.nova.app.root.navigation.navigators.staking.mythos | ||
|
||
import io.novafoundation.nova.app.R | ||
import io.novafoundation.nova.app.root.navigation.NavStackInterScreenCommunicator | ||
import io.novafoundation.nova.app.root.navigation.navigators.NavigationHoldersRegistry | ||
import io.novafoundation.nova.feature_staking_impl.presentation.mythos.SelectMythosInterScreenCommunicator | ||
import io.novafoundation.nova.feature_staking_impl.presentation.mythos.SelectMythosInterScreenCommunicator.Request | ||
import io.novafoundation.nova.feature_staking_impl.presentation.mythos.start.selectCollator.model.MythosCollatorParcel | ||
|
||
class SelectMythosCollatorInterScreenCommunicatorImpl(navigationHoldersRegistry: NavigationHoldersRegistry) : | ||
SelectMythosInterScreenCommunicator, | ||
NavStackInterScreenCommunicator<Request, MythosCollatorParcel>(navigationHoldersRegistry) { | ||
|
||
override fun respond(response: MythosCollatorParcel) { | ||
val responseEntry = navController.getBackStackEntry(R.id.startMythosStakingFragment) | ||
saveResultTo(responseEntry, response) | ||
} | ||
|
||
override fun openRequest(request: Request) { | ||
super.openRequest(request) | ||
|
||
navController.navigate(R.id.action_startMythosStakingFragment_to_selectMythosCollatorFragment) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
common/src/main/java/io/novafoundation/nova/common/address/AccountIdParcel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.novafoundation.nova.common.address | ||
|
||
import android.os.Parcelable | ||
import io.novasama.substrate_sdk_android.extensions.fromHex | ||
import io.novasama.substrate_sdk_android.runtime.AccountId | ||
import kotlinx.android.parcel.Parcelize | ||
|
||
@Parcelize | ||
class AccountIdParcel(private val value: AccountId) : Parcelable { | ||
|
||
companion object { | ||
|
||
fun fromHex(hexAccountId: String): AccountIdParcel { | ||
return AccountIdParcel(hexAccountId.fromHex()) | ||
} | ||
} | ||
|
||
val accountId: AccountIdKey | ||
get() = value.intoKey() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...taking_impl/domain/common/singleSelect/recommendations/SingleSelectRecommendatorConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package io.novafoundation.nova.feature_staking_impl.domain.common.singleSelect.recommendations | ||
|
||
typealias SingleSelectRecommendatorConfig<T> = Comparator<T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.