Skip to content

Commit

Permalink
wip-vote
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoukoul committed Mar 1, 2024
1 parent 8e6a7ce commit c9c9794
Show file tree
Hide file tree
Showing 31 changed files with 621 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ class WalletRepositoryImpl @Inject constructor() : WalletRepository {
return Result.success(balance)
}

override suspend fun getVote(address: String): Result<Vote> {
val addresses = walletAPI.getWalletBalances(true)
for (addr in addresses.addrs) {
if (addr.address == address) {
return Result.success(addr.vote)
}
}
return Result.failure(Exception("Address not found"))
}

//Get wallet balance, if address is empty then return total balance of all addresses
override suspend fun getWalletBalance(address: String): Result<Long> =
runCatching {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import co.anode.anodium.integration.presentation.settings.WalletInfoActivity
import com.pkt.core.presentation.createwallet.CreateWalletMode
import com.pkt.core.presentation.main.wallet.transaction.details.TransactionDetailsExtra
import com.pkt.core.presentation.navigation.AppNavigationHandler
import com.pkt.domain.dto.Vote
import javax.inject.Inject

class ActivityNavigationHandler @Inject constructor() : AppNavigationHandler() {
Expand Down Expand Up @@ -70,7 +71,7 @@ class ActivityNavigationHandler @Inject constructor() : AppNavigationHandler() {
override fun openSendTransaction(fragment: Fragment, fromaddress: String) {
TODO("Not yet implemented")
}
override fun openVote(fragment: Fragment, fromaddress: String) {
override fun openVote(fragment: Fragment, fromaddress: String, isCandidate: Boolean) {
TODO("Not yet implemented")
}
override fun openConfirmTransactionVPNPremium(fragment: Fragment, fromaddress: String, toAddress: String, amount: Double) {
Expand All @@ -90,6 +91,10 @@ class ActivityNavigationHandler @Inject constructor() : AppNavigationHandler() {
TODO("Not yet implemented")
}

override fun openVoteDetails(fragment: Fragment, vote: Vote) {
TODO("Not yet implemented")
}

override fun openWebView(fragment: Fragment, html: String) {
TODO("Not yet implemented")
}
Expand Down
Loading

0 comments on commit c9c9794

Please sign in to comment.