Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-3432 added new tx types #3433

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Multisig/Data/Services/Safe Client Gateway Service/SCGModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ extension SCGModels {
case rejection(Rejection)
case creation(Creation)
case swapOrder(SwapOrder)
case swapTransfer(SwapOrder)
case twapOrder(TwapOrder)
case unknown

init(from decoder: Decoder) throws {
Expand All @@ -200,6 +202,10 @@ extension SCGModels {
self = try .creation(Creation(from: decoder))
case "SwapOrder":
self = try .swapOrder(SwapOrder(from: decoder))
case "SwapTransfer":
self = try .swapTransfer(SwapOrder(from: decoder))
case "TwapOrder":
self = try .twapOrder(TwapOrder(from: decoder))
case "Unknown":
fallthrough
default:
Expand Down Expand Up @@ -379,10 +385,13 @@ extension SCGModels {

struct SwapOrder: Decodable {
var uid: String
var status: String
var kind: String
var explorerUrl: URL
}

struct TwapOrder: Codable {
var kind: String
var status: String
}
}

struct DataDecoded: Decodable {
Expand Down
2 changes: 1 addition & 1 deletion Multisig/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
<key>CLAIMING_DATA_URL</key>
<string>$(CLAIMING_DATA_URL)</string>
<key>CLAIM_CHAT_URL</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ class TransactionDetailCellBuilder {
case .swapOrder(let orderInfo):
text("Swap order", title: "Contract Interaction", expandableTitle: nil, copyText: nil)
externalURL(text: "Order details", url: orderInfo.explorerUrl)
case .swapTransfer(let orderInfo):
text("Swap transfer", title: "Contract Interaction", expandableTitle: nil, copyText: nil)
externalURL(text: "Order details", url: orderInfo.explorerUrl)
case .twapOrder(_):
text("Twap order", title: "Contract Interaction", expandableTitle: nil, copyText: nil)
case .creation(_):
// ignore
fallthrough
Expand Down Expand Up @@ -664,6 +669,12 @@ class TransactionDetailCellBuilder {
case .swapOrder(_):
type = "Swap order"
icon = UIImage(named: "ico-custom-tx")
case .swapTransfer(_):
type = "Swap transfer"
icon = UIImage(named: "ico-custom-tx")
case .twapOrder(_):
type = "Twap order"
icon = UIImage(named: "ico-custom-tx")
case .unknown:
type = "Unknown operation"
icon = UIImage(named: "ico-custom-tx")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ class TransactionListViewController: LoadableViewController, UITableViewDelegate
case .swapOrder(_):
image = UIImage(named: "ico-custom-tx")
title = "Swap order"
case .swapTransfer(_):
image = UIImage(named: "ico-custom-tx")
title = "Swap transfer"
case .twapOrder(_):
image = UIImage(named: "ico-custom-tx")
title = "Twap order"
case .unknown:
image = UIImage(named: "ico-custom-tx")
title = "Unknown operation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class WCIncomingTransactionRequestViewController: ReviewSafeTransactionViewContr
case .settingsChange(let settingsChangeInfo):
name = settingsChangeInfo.dataDecoded.method
imageName = "ico-settings-tx"
case .custom(let _):
case .custom(_):
name = "Contract interaction"
imageName = "ico-custom-tx"
case .rejection(_):
Expand All @@ -140,6 +140,12 @@ class WCIncomingTransactionRequestViewController: ReviewSafeTransactionViewContr
case .swapOrder(_):
imageName = "ico-custom-tx"
name = "Swap order"
case .swapTransfer(_):
imageName = "ico-custom-tx"
name = "Swap transfer"
case .twapOrder(_):
imageName = "ico-custom-tx"
name = "Twap transfer"
case .unknown:
imageName = "ico-custom-tx"
name = "Unknown operation"
Expand Down
2 changes: 1 addition & 1 deletion MultisigIntegrationTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<key>CFBundleShortVersionString</key>
<string>3.26.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion MultisigTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<key>CFBundleShortVersionString</key>
<string>3.26.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>3.26.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
Loading