Skip to content

Commit

Permalink
[Legacy - FileBased] Remove Shielded Transactions Support (#400)
Browse files Browse the repository at this point in the history
## Purpose
Remove Shielded Transactions Support

## Changes
- Removed related to the shielded transfers logic. Removed TransferType
cases related the shielded transfers
- Add shielded transactions sunset pop up
  • Loading branch information
ramakser authored Jul 23, 2024
1 parent f57dcfe commit 640e538
Show file tree
Hide file tree
Showing 35 changed files with 299 additions and 804 deletions.
152 changes: 18 additions & 134 deletions ConcordiumWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions ConcordiumWallet/Model/Database/TransferEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ extension TransferDataType {
balanceChange = Int(cost) ?? 0
default:
switch transferType {
case .simpleTransfer, .transferToSecret: // transfer to public is included even if not finalized
case .simpleTransfer:
balanceChange = amountAsInt() + (Int(cost) ?? 0)
case .transferToPublic:
balanceChange = -amountAsInt() + (Int(cost) ?? 0)
case .encryptedTransfer:
balanceChange = (Int(cost) ?? 0)
case .registerDelegation, .removeDelegation, .updateDelegation:
balanceChange = (Int(cost) ?? 0)
case .registerBaker, .updateBakerKeys, .updateBakerPool, .updateBakerStake, .removeBaker, .configureBaker:
Expand All @@ -93,10 +89,6 @@ extension TransferDataType {
switch transferType {
case .simpleTransfer:
balanceChange = 0
case .transferToSecret:
balanceChange = -amountAsInt()// shielding is included even if not finalized
case .encryptedTransfer, .transferToPublic:
balanceChange = amountAsInt() + 0 // the cost is taken from the public balance
case .registerDelegation, .removeDelegation, .updateDelegation:
balanceChange = 0
case .registerBaker, .updateBakerKeys, .updateBakerPool, .updateBakerStake, .removeBaker, .configureBaker:
Expand Down
3 changes: 0 additions & 3 deletions ConcordiumWallet/Model/TransferType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import Foundation

enum TransferType: String, Codable {
case simpleTransfer
case encryptedTransfer
case transferToSecret
case transferToPublic

case registerDelegation
case updateDelegation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "ico_unshield.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions ConcordiumWallet/Service/MobileWallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ class MobileWallet: MobileWalletProtocol {
let revealedAttributes = account.revealedAttributes.map({
$0.key
})

// return requestPasswordDelegate.requestUserPassword(keychain: keychain)
// .flatMap { (pwHash) -> AnyPublisher<CreateCredentialRequest, Error> in
return self.createCredential(global: global,
account: account,
revealedAttributes: revealedAttributes,
Expand Down Expand Up @@ -244,9 +241,6 @@ class MobileWallet: MobileWalletProtocol {
let privateAccountKeys = try getPrivateAccountKeys(for: fromAccount, pwHash: pwHash).get()

var secretEncryptionKey: String?
if transferType == .transferToPublic || transferType == .encryptedTransfer {
secretEncryptionKey = try getSecretEncryptionKey(for: fromAccount, pwHash: pwHash).get()
}

let makeCreateTransferRequest = MakeCreateTransferRequest(from: fromAccount.address,
to: toAccount,
Expand Down Expand Up @@ -276,12 +270,6 @@ class MobileWallet: MobileWalletProtocol {
switch transferType {
case .simpleTransfer:
return try CreateTransferRequest(walletFacade.createTransfer(input: input))
case .transferToSecret:
return try CreateTransferRequest(walletFacade.createShielding(input: input))
case .transferToPublic:
return try CreateTransferRequest(walletFacade.createUnshielding(input: input))
case .encryptedTransfer:
return try CreateTransferRequest(walletFacade.createEncrypted(input: input))
case .registerDelegation, .removeDelegation, .updateDelegation:
return try CreateTransferRequest(walletFacade.createConfigureDelegation(input: input))
case .registerBaker, .updateBakerKeys, .updateBakerPool, .updateBakerStake, .removeBaker, .configureBaker:
Expand Down
Loading

0 comments on commit 640e538

Please sign in to comment.