Skip to content

Commit 963a687

Browse files
authored
Merge pull request #741 from dashpay/fix/PC-testnet-transactions
fix: clear cached transactions when switching networks
2 parents b016167 + c5a3cf0 commit 963a687

6 files changed

Lines changed: 187 additions & 154 deletions

File tree

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ When the user asks you to make code changes:
2020

2121
**Do NOT commit/push** just because the user asked for code changes. They may want to review first.
2222

23+
### ⚠️ Permission Does NOT Carry Over
24+
25+
**Each set of changes requires its own explicit permission.** If the user gave permission to commit earlier in the conversation, that permission applies ONLY to those specific changes - NOT to any subsequent changes.
26+
27+
**Example scenario:**
28+
1. User: "Fix bug X, then commit and push" → Permission granted for bug X fix only
29+
2. User: "Now fix bug Y" → Make the fix, show diff, **STOP AND WAIT** - no permission to commit yet
30+
3. User: "Looks good, commit it" → NOW permission is granted for bug Y fix
31+
32+
**Common mistake to avoid:** After completing a task like "address review comments" or "fix these issues", do NOT automatically commit. The user needs to test the changes first. Always pause after showing the diff and wait for explicit commit instruction.
33+
2334
## Project Overview
2435

2536
Dash Wallet is an iOS cryptocurrency wallet application built for the Dash network. It's a fork of breadwallet that implements SPV (Simplified Payment Verification) for fast mobile performance. The app includes advanced features like DashPay for user-to-user transactions, CoinJoin for privacy, and integrations with external services like Uphold and Coinbase.

DashWallet.xcodeproj/project.pbxproj

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10477,7 +10477,7 @@
1047710477
"$(inherited)",
1047810478
"@executable_path/Frameworks",
1047910479
);
10480-
MARKETING_VERSION = 8.5.1;
10480+
MARKETING_VERSION = 8.5.2;
1048110481
OTHER_LDFLAGS = (
1048210482
"$(inherited)",
1048310483
"-ObjC",
@@ -10618,7 +10618,7 @@
1061810618
"$(inherited)",
1061910619
"@executable_path/Frameworks",
1062010620
);
10621-
MARKETING_VERSION = 8.5.1;
10621+
MARKETING_VERSION = 8.5.2;
1062210622
OTHER_LDFLAGS = (
1062310623
"$(inherited)",
1062410624
"-ObjC",
@@ -10793,7 +10793,7 @@
1079310793
EXCLUDED_ARCHS = "";
1079410794
IBSC_MODULE = WatchApp_Extension;
1079510795
INFOPLIST_FILE = WatchApp/Info.plist;
10796-
MARKETING_VERSION = 8.5.1;
10796+
MARKETING_VERSION = 8.5.2;
1079710797
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1079810798
PRODUCT_NAME = "$(TARGET_NAME)";
1079910799
SDKROOT = watchos;
@@ -10815,7 +10815,7 @@
1081510815
EXCLUDED_ARCHS = "";
1081610816
IBSC_MODULE = WatchApp_Extension;
1081710817
INFOPLIST_FILE = WatchApp/Info.plist;
10818-
MARKETING_VERSION = 8.5.1;
10818+
MARKETING_VERSION = 8.5.2;
1081910819
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1082010820
PRODUCT_NAME = "$(TARGET_NAME)";
1082110821
SDKROOT = watchos;
@@ -10840,7 +10840,7 @@
1084010840
"@executable_path/Frameworks",
1084110841
"@executable_path/../../Frameworks",
1084210842
);
10843-
MARKETING_VERSION = 8.5.1;
10843+
MARKETING_VERSION = 8.5.2;
1084410844
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1084510845
PRODUCT_NAME = "${TARGET_NAME}";
1084610846
SDKROOT = watchos;
@@ -10867,7 +10867,7 @@
1086710867
"@executable_path/Frameworks",
1086810868
"@executable_path/../../Frameworks",
1086910869
);
10870-
MARKETING_VERSION = 8.5.1;
10870+
MARKETING_VERSION = 8.5.2;
1087110871
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1087210872
PRODUCT_NAME = "${TARGET_NAME}";
1087310873
SDKROOT = watchos;
@@ -10899,7 +10899,7 @@
1089910899
"@executable_path/Frameworks",
1090010900
"@executable_path/../../Frameworks",
1090110901
);
10902-
MARKETING_VERSION = 8.5.1;
10902+
MARKETING_VERSION = 8.5.2;
1090310903
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
1090410904
PRODUCT_NAME = "$(TARGET_NAME)";
1090510905
SKIP_INSTALL = YES;
@@ -10928,7 +10928,7 @@
1092810928
"@executable_path/Frameworks",
1092910929
"@executable_path/../../Frameworks",
1093010930
);
10931-
MARKETING_VERSION = 8.5.1;
10931+
MARKETING_VERSION = 8.5.2;
1093210932
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
1093310933
PRODUCT_NAME = "$(TARGET_NAME)";
1093410934
SKIP_INSTALL = YES;
@@ -10978,7 +10978,7 @@
1097810978
"$(inherited)",
1097910979
"@executable_path/Frameworks",
1098010980
);
10981-
MARKETING_VERSION = 8.5.1;
10981+
MARKETING_VERSION = 8.5.2;
1098210982
OTHER_LDFLAGS = (
1098310983
"$(inherited)",
1098410984
"-ObjC",
@@ -11113,7 +11113,7 @@
1111311113
"$(inherited)",
1111411114
"@executable_path/Frameworks",
1111511115
);
11116-
MARKETING_VERSION = 8.5.1;
11116+
MARKETING_VERSION = 8.5.2;
1111711117
OTHER_LDFLAGS = (
1111811118
"$(inherited)",
1111911119
"-ObjC",
@@ -11259,7 +11259,7 @@
1125911259
"$(inherited)",
1126011260
"@executable_path/Frameworks",
1126111261
);
11262-
MARKETING_VERSION = 8.5.1;
11262+
MARKETING_VERSION = 8.5.2;
1126311263
OTHER_LDFLAGS = (
1126411264
"$(inherited)",
1126511265
"-ObjC",
@@ -11403,7 +11403,7 @@
1140311403
"$(inherited)",
1140411404
"@executable_path/Frameworks",
1140511405
);
11406-
MARKETING_VERSION = 8.5.1;
11406+
MARKETING_VERSION = 8.5.2;
1140711407
OTHER_LDFLAGS = (
1140811408
"$(inherited)",
1140911409
"-ObjC",
@@ -11607,7 +11607,7 @@
1160711607
"$(inherited)",
1160811608
"@executable_path/Frameworks",
1160911609
);
11610-
MARKETING_VERSION = 8.5.1;
11610+
MARKETING_VERSION = 8.5.2;
1161111611
OTHER_LDFLAGS = (
1161211612
"$(inherited)",
1161311613
"-ObjC",
@@ -11721,7 +11721,7 @@
1172111721
"@executable_path/Frameworks",
1172211722
"@executable_path/../../Frameworks",
1172311723
);
11724-
MARKETING_VERSION = 8.5.1;
11724+
MARKETING_VERSION = 8.5.2;
1172511725
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
1172611726
PRODUCT_NAME = "$(TARGET_NAME)";
1172711727
SKIP_INSTALL = YES;
@@ -11777,7 +11777,7 @@
1177711777
EXCLUDED_ARCHS = "";
1177811778
IBSC_MODULE = WatchApp_Extension;
1177911779
INFOPLIST_FILE = WatchApp/Info.plist;
11780-
MARKETING_VERSION = 8.5.1;
11780+
MARKETING_VERSION = 8.5.2;
1178111781
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1178211782
PRODUCT_NAME = "$(TARGET_NAME)";
1178311783
SDKROOT = watchos;
@@ -11802,7 +11802,7 @@
1180211802
"@executable_path/Frameworks",
1180311803
"@executable_path/../../Frameworks",
1180411804
);
11805-
MARKETING_VERSION = 8.5.1;
11805+
MARKETING_VERSION = 8.5.2;
1180611806
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1180711807
PRODUCT_NAME = "${TARGET_NAME}";
1180811808
SDKROOT = watchos;
@@ -11919,7 +11919,7 @@
1191911919
"$(inherited)",
1192011920
"@executable_path/Frameworks",
1192111921
);
11922-
MARKETING_VERSION = 8.5.1;
11922+
MARKETING_VERSION = 8.5.2;
1192311923
OTHER_LDFLAGS = (
1192411924
"$(inherited)",
1192511925
"-ObjC",
@@ -12032,7 +12032,7 @@
1203212032
"@executable_path/Frameworks",
1203312033
"@executable_path/../../Frameworks",
1203412034
);
12035-
MARKETING_VERSION = 8.5.1;
12035+
MARKETING_VERSION = 8.5.2;
1203612036
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
1203712037
PRODUCT_NAME = "$(TARGET_NAME)";
1203812038
SKIP_INSTALL = YES;
@@ -12087,7 +12087,7 @@
1208712087
EXCLUDED_ARCHS = "";
1208812088
IBSC_MODULE = WatchApp_Extension;
1208912089
INFOPLIST_FILE = WatchApp/Info.plist;
12090-
MARKETING_VERSION = 8.5.1;
12090+
MARKETING_VERSION = 8.5.2;
1209112091
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1209212092
PRODUCT_NAME = "$(TARGET_NAME)";
1209312093
SDKROOT = watchos;
@@ -12112,7 +12112,7 @@
1211212112
"@executable_path/Frameworks",
1211312113
"@executable_path/../../Frameworks",
1211412114
);
12115-
MARKETING_VERSION = 8.5.1;
12115+
MARKETING_VERSION = 8.5.2;
1211612116
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1211712117
PRODUCT_NAME = "${TARGET_NAME}";
1211812118
SDKROOT = watchos;

DashWallet/Sources/Models/Explore Dash/Infrastructure/DAO Impl/MerchantDAO.swift

Lines changed: 28 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,31 @@ class MerchantDAO: PointOfUseDAO {
3535
connection = dbConnection
3636
}
3737

38+
/// Extracts sourceId from a database row, handling String, Int64, Int types and nil/empty values
39+
/// - Parameters:
40+
/// - row: The database row (Statement.Element)
41+
/// - index: The column index for sourceId
42+
/// - Returns: The sourceId as a String, or nil if missing/empty/invalid
43+
private func extractSourceId(from row: Statement.Element, at index: Int) -> String? {
44+
guard row.count > index else { return nil }
45+
46+
if let sourceId = row[index] as? String, !sourceId.isEmpty {
47+
return sourceId
48+
} else if let sourceId = row[index] as? Int64 {
49+
return String(sourceId)
50+
} else if let sourceId = row[index] as? Int {
51+
return String(sourceId)
52+
} else if let sourceId = row[index] {
53+
let stringValue = String(describing: sourceId)
54+
if stringValue == "<null>" || stringValue == "nil" {
55+
return nil
56+
}
57+
return stringValue
58+
}
59+
60+
return nil
61+
}
62+
3863
func items(filters: PointOfUseDAOFilters, offset: Int?,
3964
completion: @escaping (Swift.Result<PaginationResult<Item>, Error>) -> Void) { }
4065

@@ -204,21 +229,11 @@ class MerchantDAO: PointOfUseDAO {
204229
let savingsPercentage = row[1] as? Int64,
205230
let denominationsType = row[2] as? String {
206231

207-
// Handle sourceId - it might be String, Int64, or nil
208-
var sourceIdString: String? = nil
209-
if let sourceId = row[3] as? String, !sourceId.isEmpty {
210-
sourceIdString = sourceId
211-
} else if let sourceId = row[3] as? Int64 {
212-
sourceIdString = String(sourceId)
213-
} else if let sourceId = row[3] as? Int {
214-
sourceIdString = String(sourceId)
215-
}
216-
217232
providers.append(ExplorePointOfUse.Merchant.GiftCardProviderInfo(
218233
providerId: providerId,
219234
savingsPercentage: Int(savingsPercentage),
220235
denominationsType: denominationsType,
221-
sourceId: sourceIdString
236+
sourceId: wSelf.extractSourceId(from: row, at: 3)
222237
))
223238
}
224239
}
@@ -447,21 +462,11 @@ class MerchantDAO: PointOfUseDAO {
447462
let savingsPercentage = row[1] as? Int64,
448463
let denominationsType = row[2] as? String {
449464

450-
// Handle sourceId - it might be String, Int64, or nil
451-
var sourceIdString: String? = nil
452-
if let sourceId = row[3] as? String, !sourceId.isEmpty {
453-
sourceIdString = sourceId
454-
} else if let sourceId = row[3] as? Int64 {
455-
sourceIdString = String(sourceId)
456-
} else if let sourceId = row[3] as? Int {
457-
sourceIdString = String(sourceId)
458-
}
459-
460465
providers.append(ExplorePointOfUse.Merchant.GiftCardProviderInfo(
461466
providerId: providerId,
462467
savingsPercentage: Int(savingsPercentage),
463468
denominationsType: denominationsType,
464-
sourceId: sourceIdString
469+
sourceId: wSelf.extractSourceId(from: row, at: 3)
465470
))
466471
}
467472
}
@@ -651,35 +656,11 @@ extension MerchantDAO {
651656
let savingsPercentage = savingsPercentage,
652657
let denominationsType = denominationsType {
653658

654-
// Handle sourceId - it might be String, Int64, or nil
655-
var sourceIdString: String? = nil
656-
657-
// Check if sourceId exists (not NULL)
658-
if row.count > 3 {
659-
// Try different type conversions
660-
if let sourceId = row[3] as? String, !sourceId.isEmpty {
661-
sourceIdString = sourceId
662-
} else if let sourceId = row[3] as? Int64 {
663-
sourceIdString = String(sourceId)
664-
} else if let sourceId = row[3] as? Int {
665-
sourceIdString = String(sourceId)
666-
} else if let sourceId = row[3] {
667-
// Try to convert whatever type it is to string
668-
sourceIdString = String(describing: sourceId)
669-
if sourceIdString == "<null>" || sourceIdString == "nil" {
670-
sourceIdString = nil
671-
} else {
672-
}
673-
} else {
674-
}
675-
} else {
676-
}
677-
678659
providers.append(ExplorePointOfUse.Merchant.GiftCardProviderInfo(
679660
providerId: providerId,
680661
savingsPercentage: Int(savingsPercentage),
681662
denominationsType: denominationsType,
682-
sourceId: sourceIdString
663+
sourceId: wSelf.extractSourceId(from: row, at: 3)
683664
))
684665
}
685666
}

0 commit comments

Comments
 (0)