Skip to content

Commit da91dfa

Browse files
committed
fix: findDeviceShareIndex
1 parent 89392c8 commit da91dfa

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Sources/ThresholdKey/Modules/TssModule.swift

+10-2
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,17 @@ public final class TssModule {
546546
guard let resultJson = try JSONSerialization.jsonObject(with: resultData) as? [String: Any] else {
547547
throw "Invalid factor key"
548548
}
549-
guard let deviceShareJson = resultJson["deviceShare"] as? [String: Any] else {
550-
throw "Invalid factor key"
549+
550+
var deviceShareJson = resultJson;
551+
552+
// backward competible
553+
if resultJson["deviceShare"] != nil {
554+
guard let deviceShare = resultJson["deviceShare"] as? [String: Any] else {
555+
throw "Invalid factor key"
556+
}
557+
deviceShareJson = deviceShare
551558
}
559+
552560
guard let shareJson = deviceShareJson["share"] as? [String: Any] else {
553561
throw "Invalid factor key"
554562
}

0 commit comments

Comments
 (0)