-
Notifications
You must be signed in to change notification settings - Fork 46
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 #152 from muun/52-release-branch
Apollo: Release source code for 52
- Loading branch information
Showing
24 changed files
with
365 additions
and
73 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
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
32 changes: 32 additions & 0 deletions
32
android/apollo/src/main/java/io/muun/apollo/domain/action/user/DeleteWalletAction.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,32 @@ | ||
package io.muun.apollo.domain.action.user | ||
|
||
import io.muun.apollo.data.net.HoustonClient | ||
import io.muun.apollo.domain.action.base.BaseAsyncAction0 | ||
import io.muun.apollo.domain.action.challenge_keys.SignChallengeAction | ||
import io.muun.common.Optional | ||
import io.muun.common.crypto.ChallengeType | ||
import io.muun.common.model.challenge.Challenge | ||
import rx.Observable | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class DeleteWalletAction @Inject constructor( | ||
private val signChallenge: SignChallengeAction, | ||
private val houstonClient: HoustonClient, | ||
) : BaseAsyncAction0<Void>() { | ||
|
||
override fun action(): Observable<Void> { | ||
return Observable.defer { | ||
houstonClient.requestChallenge(ChallengeType.USER_KEY) | ||
.map { maybeChallenge: Optional<Challenge> -> | ||
val challenge = maybeChallenge.orElseThrow() // empty only for legacy apps | ||
signChallenge.signWithUserKey(challenge) | ||
} | ||
.flatMap { challengeSignature -> | ||
houstonClient.deleteWallet(challengeSignature) | ||
.andThen(Observable.just(null)) | ||
} | ||
} | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
...src/main/java/io/muun/apollo/domain/errors/delete_wallet/NonEmptyWalletDeleteException.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,5 @@ | ||
package io.muun.apollo.domain.errors.delete_wallet | ||
|
||
import io.muun.apollo.domain.errors.MuunError | ||
|
||
class NonEmptyWalletDeleteException(cause: Throwable) : MuunError(cause) |
5 changes: 5 additions & 0 deletions
5
...va/io/muun/apollo/domain/errors/delete_wallet/UnsettledOperationsWalletDeleteException.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,5 @@ | ||
package io.muun.apollo.domain.errors.delete_wallet | ||
|
||
import io.muun.apollo.domain.errors.MuunError | ||
|
||
class UnsettledOperationsWalletDeleteException(cause: Throwable) : MuunError(cause) |
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
Oops, something went wrong.