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

Feat/zcash #36

Merged
merged 5 commits into from
Nov 27, 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
69 changes: 21 additions & 48 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,84 +1,57 @@
{
"pins" : [
{
"identity" : "bcswiftcrypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/KeystoneHQ/BCSwiftCrypto.git",
"state" : {
"revision" : "f3b7faadfbd681786e9db73d66d3fe1053628fe5",
"version" : "0.9.0"
}
},
{
"identity" : "bcswiftdcbor",
"kind" : "remoteSourceControl",
"location" : "https://github.com/KeystoneHQ/BCSwiftDCBOR.git",
"location" : "https://github.com/BlockchainCommons/BCSwiftDCBOR",
"state" : {
"revision" : "0330a29a502a43e0c5da1289f00bfa0c1488378c",
"version" : "0.11.1"
"revision" : "21efa67ada2f22a6c277e1961f1059bb376e9b1a",
"version" : "2.0.2"
}
},
{
"identity" : "bcswiftfloat16",
"kind" : "remoteSourceControl",
"location" : "https://github.com/KeystoneHQ/BCSwiftFloat16.git",
"state" : {
"revision" : "5781bf741d202b69ffaa98c5e84e1229bd99e694",
"version" : "0.3.0"
}
},
{
"identity" : "cryptoswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/CryptoSwift.git",
"state" : {
"revision" : "678d442c6f7828def400a70ae15968aef67ef52d",
"version" : "1.8.3"
}
},
{
"identity" : "secp256k1",
"kind" : "remoteSourceControl",
"location" : "https://github.com/portto/secp256k1.git",
"location" : "https://github.com/blockchaincommons/BCSwiftFloat16",
"state" : {
"revision" : "6864a2560066cedede330c4b344689432a7300f7",
"version" : "0.0.5"
"revision" : "a27f3935a7b1db715713eda67369b02feade2ded",
"version" : "2.0.0"
}
},
{
"identity" : "secp256k1.swift",
"identity" : "bcswifttags",
"kind" : "remoteSourceControl",
"location" : "https://github.com/KeystoneHQ/secp256k1.swift.git",
"location" : "https://github.com/BlockchainCommons/BCSwiftTags",
"state" : {
"revision" : "95bfcee9f194c7a0d52ec29f40bf884812559a7c",
"version" : "0.8.1"
"revision" : "ced8d92c7cc53375cdf9806c59251fe0161f02ec",
"version" : "0.2.3"
}
},
{
"identity" : "swift-collections",
"identity" : "swift-numberkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"location" : "https://github.com/objecthub/swift-numberkit.git",
"state" : {
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
"revision" : "33af3f9011e45dcd8ee696492d30dbcd5a8a67f3",
"version" : "2.6.0"
}
},
{
"identity" : "swift-collections-sorted-collections",
"identity" : "swiftsortedcollections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/soralit/swift-collections-sorted-collections",
"location" : "https://github.com/wolfmcnally/SwiftSortedCollections",
"state" : {
"revision" : "eebe309da4f42ab6a38a057c74b3d8e7b4233b38",
"version" : "1.2.2"
"revision" : "dd6c8e0eaef987e55a35c056d185144a7c71fc19",
"version" : "0.1.0"
}
},
{
"identity" : "urkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/KeystoneHQ/URKit.git",
"location" : "https://github.com/BlockchainCommons/URKit",
"state" : {
"revision" : "dfac3005730c2ac189e7db173705c9e400046dcd",
"version" : "11.5.1"
"revision" : "c7cf16b03ce061c2d461fb4c635cc27c9e1d00e3",
"version" : "15.0.0"
}
}
],
Expand Down
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// swift-tools-version: 5.6
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "KeystoneSDK",
platforms: [.iOS(.v13), .macOS(.v11)],
platforms: [.iOS(.v15), .macOS(.v13)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
Expand All @@ -15,7 +15,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/KeystoneHQ/URKit.git", from: "11.5.1")
.package(url: "https://github.com/BlockchainCommons/URKit", from: "15.0.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand All @@ -26,8 +26,8 @@ let package = Package(
),
.binaryTarget(
name: "URRegistryFFI",
url: "https://github.com/KeystoneHQ/keystone-sdk-rust/releases/download/sdk-0.1.8/URRegistryFFI.xcframework.zip",
checksum: "5fc2d2f82e99793d1d6650d25ebbab99fb2c77d5622bdb3374d65aa87264b61e"
url: "https://github.com/KeystoneHQ/keystone-sdk-rust/releases/download/sdk-0.2.2/URRegistryFFI.xcframework.zip",
checksum: "aa5211d52d4c0140b948df986d834b86b485daf6a2d7d6fcb31086e83a20581d"
),
.testTarget(
name: "KeystoneSDKTests",
Expand Down
28 changes: 28 additions & 0 deletions Sources/KeystoneSDK/Chain/KeystoneZcashSDK.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// KeystoneZcashSDK.swift
// KeystoneSDK
//
// Created by Sora Li on 2024/11/26.
//

import Foundation
import URRegistryFFI
import URKit


public class KeystoneZcashSDK: KeystoneBaseSDK {
public func parseZcashPczt(ur: UR) throws -> Data {
let pcztString = handle_error(
get_result: { parse_zcash_pczt($0, ur.type, ur.cbor.cborData.hexEncodedString()) }
)
let pczt = try super.parseUR(urString: pcztString, ofType: PCZT.self, ofError: KeystoneError.parsePSBTError)
return pczt.pczt.uppercased().hexadecimal
}

public func generateZcashPczt(pczt_hex: Data) throws -> UREncoder {
let pczt = handle_error(
get_result: { generate_zcash_pczt($0, pczt_hex.hexEncodedString())}
)
return try super.urStringToEncoder(urString: pczt, ofError: KeystoneError.generatePSBTError)
}
}
4 changes: 4 additions & 0 deletions Sources/KeystoneSDK/KeystoneSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@ public class KeystoneSDK {
public func parseMultiAccounts(ur: UR) throws -> MultiAccounts {
return try wallet.parseMultiAccounts(ur: ur)
}

public func parseZcashAccounts(ur: UR) throws -> ZcashAccounts {
return try wallet.parseZcashAccounts(ur: ur)
}
}
7 changes: 7 additions & 0 deletions Sources/KeystoneSDK/KeystoneWallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ public class KeystoneWallet: KeystoneBaseSDK {
)
return try super.parseUR(urString: multiAccounts, ofType: MultiAccounts.self, ofError: KeystoneError.syncAccountsError)
}

func parseZcashAccounts(ur: UR) throws -> ZcashAccounts {
let zcashAccounts = handle_error(
get_result: { parse_zcash_accounts($0, ur.type, ur.cbor.cborData.hexEncodedString()) }
)
return try super.parseUR(urString: zcashAccounts, ofType: ZcashAccounts.self, ofError: KeystoneError.syncAccountsError)
}
}
4 changes: 2 additions & 2 deletions Sources/KeystoneSDK/Model/CardanoSignRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct CardanoSignRequest {
let origin: String

public struct Utxo: Codable {
public init(transactionHash: String, index: UInt32, amount: UInt64, xfp: String, hdPath: String, address: String) {
public init(transactionHash: String, index: UInt32, amount: String, xfp: String, hdPath: String, address: String) {
self.transactionHash = transactionHash
self.index = index
self.amount = amount
Expand All @@ -34,7 +34,7 @@ public struct CardanoSignRequest {

let transactionHash: String
let index: UInt32
let amount: UInt64
let amount: String
let xfp: String
let hdPath: String
let address: String
Expand Down
29 changes: 29 additions & 0 deletions Sources/KeystoneSDK/Model/ZcashAccounts.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// ZcashAccounts.swift
// KeystoneSDK
//
// Created by Sora Li on 2024/11/27.
//

import Foundation

public struct ZcashAccounts : Equatable, Codable {
public var seedFingerprint: String
public var accounts: Array<ZcashUnifiedAccount>
}

public struct ZcashUnifiedAccount: Equatable, Codable {
public var transparent: ZcashTransparentAccount?
public var orchard: ZcashShieldedAccount
public var name: String?
}

public struct ZcashTransparentAccount: Equatable, Codable {
public var path: String
public var xpub: String
}

public struct ZcashShieldedAccount: Equatable, Codable {
public var path: String
public var fvk: String
}
12 changes: 12 additions & 0 deletions Sources/KeystoneSDK/Model/ZcashPczt.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// ZcashPczt.swift
// KeystoneSDK
//
// Created by Sora Li on 2024/11/27.
//

import Foundation

public struct PCZT: Equatable, Codable {
public var pczt: String
}
12 changes: 0 additions & 12 deletions Tests/KeystoneSDKTests/Chain/KeystoneAptosSDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ final class KeystoneAptosSDKTests: XCTestCase {
XCTAssertEqual(signature.authenticationPublicKey, "8e53e7b10656816de70824e3016fc1a277e77825e12825dc4f239f418ab2e04e")
}

func testParseSignatureError() {
let signatureHex = "a201d825509b1de"
let sdk = KeystoneAptosSDK()
let ur = try! UR(type: "aptos-signature", cbor: CBOR(signatureHex.hexadecimal))

var thrownError: Swift.Error?
XCTAssertThrowsError(try sdk.parseSignature(ur: ur)) {
thrownError = $0
}
XCTAssertEqual(thrownError as? KeystoneError, .parseSignatureError("signature is invalid"))
}

func testGenerateSignRequest() {
let signRequest = AptosSignRequest(
requestId: "7AFD5E09-9267-43FB-A02E-08C4A09417EC",
Expand Down
12 changes: 0 additions & 12 deletions Tests/KeystoneSDKTests/Chain/KeystoneArweaveSDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ final class KeystoneArweaveSDKTests: XCTestCase {
XCTAssertEqual(signature.signature, "80337c3a47f1b69a38544c69f379a4aa0ea8ef1f853b718d992c6a73c643e63ca6dff9186cd2f41a45c6405ef6b71353c3b6864c799699964e559afa7aa7f7c345c1966c998193539985e2724831025beadb0a1a269f54ec4a95c69a3bc4295a5c6c5f926dcc84fbf2251b56c841f764b162e062c8db5302090aa1d528d83cf48b53aa0709009f3975d63ea8ff26e80b4f2f01380e100860b304fccbbc0877278efbf72fb045331f76df132a5119bd51590f0502350d3cb31f14daba731893c5834e2e8bfa5bf517ac63693b81041cf7f8ed7293d034b3e54c4d02c66542d3b9648e9ecf912101a20b87f39d75d4f1a02c816f424c8a1fda05a9e7e8ccf064d31c0bf10c661872a7f40c0b1d75dbfae6a95ddcc81eead3f49cfa3803517cf9d79f2541041416c3e8ecfc0292d864f34fe613866e86b7b0bc7abc5b3f84e6ee3b06933c4f82552bb985f6b7fac0a580e94d7a0e8e295dd2e49ece66ead0ee6a46b84553302b94701a9d24b91c085154b7e67a7ac59e3a41ae96c8e1afd1aa778633457005555cff4198820c2aa8ea1ff0f86a9f4ae03d96b215449c63bff7cae9a114c9db05cc4e4d9993a13149393b6a6992b6042bb82d34ffdc7f1aeaf17fa5240ca6ebd9e62fd6c90bce91747af37bf8fc3c72859a1dfec2cf2c49295e1ccdc09b91d9074d204dea74a70002baa05fc86acfcff45fe7f0dd7e5e24c8f69575")
}

func testParseSignatureError() {
let signatureHex = "a201d825509b1de"
let sdk = KeystoneArweaveSDK()
let ur = try! UR(type: "arweave-signature", cbor: CBOR(signatureHex.hexadecimal))

var thrownError: Swift.Error?
XCTAssertThrowsError(try sdk.parseSignature(ur: ur)) {
thrownError = $0
}
XCTAssertEqual(thrownError as? KeystoneError, .parseSignatureError("signature is invalid"))
}

func testGenerateSignRequest() {
let signRequest = ArweaveSignRequest(
masterFingerprint: "F23F9FD2",
Expand Down
14 changes: 1 addition & 13 deletions Tests/KeystoneSDKTests/Chain/KeystoneBitcoinSDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,8 @@ final class KeystoneBitcoinSDKTests: XCTestCase {
XCTAssertEqual(psbt, "70736274FF01009A020000000258E87A21B56DAF0C23BE8E7070456C336F7CBAA5C8757924F545887BB2ABDD750000000000FFFFFFFF838D0427D0EC650A68AA46BB0B098AEA4422C071B2CA78352A077959D07CEA1D0100000000FFFFFFFF0270AAF00800000000160014D85C2B71D0060B09C9886AEB815E50991DDA124D00E1F5050000000016001400AEA9A2E5F0F876A588DF5546E8742D1D87008F000000000000000000".hexadecimal)
}

func testParsePsbtError() {
let psbtCborHex = "58A770736274FF01009A020000000258E87A21B56DAF0C23BE8E7070456C336F7CBAA5C8757924F545887BB2ABDD750000000000FFFFFFFF838D0427D0EC650A68AA46BB0B098AEA4422C071B2CA78352A077959D07CEA1D0100000000FFFFFFFF0270AAF00800000000160014D85C2B71D0060B09C9886AEB815E50991DDA124D00E1F5050000000016001400AEA9A2E5F0F876A588DF5546E8742D1D87008"
let bitcoinSdk = KeystoneBitcoinSDK()
let ur = try! UR(type: "crypto-psbt", cbor: CBOR(psbtCborHex.hexadecimal))

var thrownError: Swift.Error?
XCTAssertThrowsError(try bitcoinSdk.parsePSBT(ur: ur)) {
thrownError = $0
}
XCTAssertEqual(thrownError as? KeystoneError, .parsePSBTError("PSBT is invalid"))
}

func testParsePsbtTypeError() {
let psbtCborHex = "58A770736274FF01009A020000000258E87A21B56DAF0C23BE8E7070456C336F7CBAA5C8757924F545887BB2ABDD750000000000FFFFFFFF838D0427D0EC650A68AA46BB0B098AEA4422C071B2CA78352A077959D07CEA1D0100000000FFFFFFFF0270AAF00800000000160014D85C2B71D0060B09C9886AEB815E50991DDA124D00E1F5050000000016001400AEA9A2E5F0F876A588DF5546E8742D1D87008"
let psbtCborHex = "58A770736274FF01009A020000000258E87A21B56DAF0C23BE8E7070456C336F7CBAA5C8757924F545887BB2ABDD750000000000FFFFFFFF838D0427D0EC650A68AA46BB0B098AEA4422C071B2CA78352A077959D07CEA1D0100000000FFFFFFFF0270AAF00800000000160014D85C2B71D0060B09C9886AEB815E50991DDA124D00E1F5050000000016001400AEA9A2E5F0F876A588DF5546E8742D1D87008F000000000000000000"
let bitcoinSdk = KeystoneBitcoinSDK()
let ur = try! UR(type: "crypto-hdkey", cbor: CBOR(psbtCborHex.hexadecimal))

Expand Down
24 changes: 7 additions & 17 deletions Tests/KeystoneSDKTests/Chain/KeystoneCardanoSDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ final class KeystoneCardanoSDKTests: XCTestCase {
XCTAssertEqual(signature.witnessSet, "a100828258207233f4cd5f24fa554e1ea4ed9251e39f4e18b2e0efd909b27ca01333c22ac49a5840725d8d98bab67eec8bf2704153f725f35ff7b0c9fabee135d97cf6c6b0885b14aa8748d9ba236abd19560b43afb0c5ac6d03359a1ef71b0712fc300d73e23e07825820c4af2472a9b27acad95967b1f5ff224cf3065824f6f1f0df7dbf4b52b819b1e85840c1ba75df625c7f657633f85f07d0bfd67f4e8ffb6b81b4b65a0ab186b459c4434971c25191b2725bff3f29bb9c1d247aabd60e63f0ea6ba53db0624ae1bcc101")
}

func testParseSignatureError() {
let signatureHex = "a201d825509b1de"
let sdk = KeystoneCardanoSDK()
let ur = try! UR(type: "cardano-signature", cbor: CBOR(signatureHex.hexadecimal))

var thrownError: Swift.Error?
XCTAssertThrowsError(try sdk.parseSignature(ur: ur)) {
thrownError = $0
}
XCTAssertEqual(thrownError as? KeystoneError, .parseSignatureError("signature is invalid"))
}

func testGenerateSignRequest() {
let signRequest = CardanoSignRequest(
requestId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
Expand All @@ -43,15 +31,15 @@ final class KeystoneCardanoSDKTests: XCTestCase {
CardanoSignRequest.Utxo(
transactionHash: "4e3a6e7fdcb0d0efa17bf79c13aed2b4cb9baf37fb1aa2e39553d5bd720c5c99",
index: 3,
amount: 10000000,
amount: "10000000",
xfp: "73c5da0a",
hdPath: "m/1852'/1815'/0'/0/0",
address: "addr1qy8ac7qqy0vtulyl7wntmsxc6wex80gvcyjy33qffrhm7sh927ysx5sftuw0dlft05dz3c7revpf7jx0xnlcjz3g69mq4afdhv"
),
CardanoSignRequest.Utxo(
transactionHash: "4e3a6e7fdcb0d0efa17bf79c13aed2b4cb9baf37fb1aa2e39553d5bd720c5c99",
index: 4,
amount: 18020000,
amount: "18020000",
xfp: "73c5da0a",
hdPath: "m/1852'/1815'/0'/0/1",
address: "addr1qyz85693g4fr8c55mfyxhae8j2u04pydxrgqr73vmwpx3azv4dgkyrgylj5yl2m0jlpdpeswyyzjs0vhwvnl6xg9f7ssrxkz90"
Expand All @@ -69,8 +57,10 @@ final class KeystoneCardanoSDKTests: XCTestCase {
let signRequestEncoder = try! sdk.generateSignRequest(cardanoSignRequest: signRequest)

let qrCode = signRequestEncoder.nextPart()

print(qrCode)

XCTAssertEqual(qrCode, "ur:cardano-sign-request/1-2/lpadaocfaojkcydstoptbghkadftonadtpdagdndcawmgtfrkigrpmndutdnbtkgfssbjnaohdoylroxaelflfhdcxglftjtlbuopftiwsoykgylnsbwpltdqzsbndpeemzocyoevlmdgutlryjpbnhhnlaxlfhdcxglftjtlbuopftiwsoykgylnsbwpltdqzsbndpeemzocyoevlmdgutlryjpbnhhnlaaadlfoeaehdcahskkurgskpylhsjnkicttensrfcyjtolqzbkbtkgldzeoldlrtmhndjzemadcfsrgdoeaehdcahssopfsokoctttuoaaaapytlhyztldgddsidlugdecpsidfnhsgwrdtiehadcfsrgdaocfmnsbaxaenbykynaxlftaaynlonadhdcxglftjtlbuopftiwsoykgylnsbwpltdqzsbndpeemzocyoevlmdgutlryjpbnhhnlaoaxaxcyaemkmtlaaataaddyoeadlecfatfnykcfatchykaeykaewkaewkaocyjksktnbkahksiohsieiejpehjskkethsiaemjsjskkdykojykpjzkkjzemktjtjyjnjkksiaenktihksetdyiokoiakkimkkeoeojsiyiyjpisjnemhysedtsp")
XCTAssertEqual(qrCode, "ur:cardano-sign-request/1-2/lpadaocfaokgcynncemytahkadfmonadtpdagdndcawmgtfrkigrpmndutdnbtkgfssbjnaohdoylroxaelflfhdcxglftjtlbuopftiwsoykgylnsbwpltdqzsbndpeemzocyoevlmdgutlryjpbnhhnlaxlfhdcxglftjtlbuopftiwsoykgylnsbwpltdqzsbndpeemzocyoevlmdgutlryjpbnhhnlaaadlfoeaehdcahskkurgskpylhsjnkicttensrfcyjtolqzbkbtkgldzeoldlrtmhndjzemadcfsrgdoeaehdcahssopfsokoctttuoaaaapytlhyztldgddsidlugdecpsidfnhsgwrdtiehadcfsrgdaocfmnsbaxaenbykynaxlftaaynlonadhdcxglftjtlbuopftiwsoykgylnsbwpltdqzsbndpeemzocyoevlmdgutlryjpbnhhnlaoaxaxisehdydydydydydydyaataaddyoeadlecfatfnykcfatchykaeykaewkaewkaocyjksktnbkahksiohsieiejpehjskkethsiaemjsjskkdykojykpjzkkjzemktjtjyjnjkksiaenktihksetdyiokoiakkimkkeoeojsiyiyjpisjnemgwgumoey")
}

func testGenerateSignRequestError() {
Expand All @@ -81,15 +71,15 @@ final class KeystoneCardanoSDKTests: XCTestCase {
CardanoSignRequest.Utxo(
transactionHash: "4e3a6e7fdcb0d0efa17bf79c13aed2b4cb9baf37fb1aa2e39553d5bd720c5c99",
index: 3,
amount: 10000000,
amount: "10000000",
xfp: "73c5da",
hdPath: "m/1852'/1815'/0'/0/0",
address: "addr1qy8ac7qqy0vtulyl7wntmsxc6wex80gvcyjy33qffrhm7sh927ysx5sftuw0dlft05dz3c7revpf7jx0xnlcjz3g69mq4afdhv"
),
CardanoSignRequest.Utxo(
transactionHash: "4e3a6e7fdcb0d0efa17bf79c13aed2b4cb9baf37fb1aa2e39553d5bd720c5c99",
index: 4,
amount: 18020000,
amount: "18020000",
xfp: "73c5da0a",
hdPath: "m/1852'/1815'/0'/0/1",
address: "addr1qyz85693g4fr8c55mfyxhae8j2u04pydxrgqr73vmwpx3azv4dgkyrgylj5yl2m0jlpdpeswyyzjs0vhwvnl6xg9f7ssrxkz90"
Expand Down
12 changes: 0 additions & 12 deletions Tests/KeystoneSDKTests/Chain/KeystoneCosmosSDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ final class KeystoneCosmosSDKTests: XCTestCase {
XCTAssertEqual(signature.publicKey, "03f3ded94f2969d76200c6ed5db836041cc815fa62aa791e047905186c07e00275")
}

func testParseSignatureError() {
let signatureHex = "a201d825509b1de"
let sdk = KeystoneCosmosSDK()
let ur = try! UR(type: "cosmos-signature", cbor: CBOR(signatureHex.hexadecimal))

var thrownError: Swift.Error?
XCTAssertThrowsError(try sdk.parseSignature(ur: ur)) {
thrownError = $0
}
XCTAssertEqual(thrownError as? KeystoneError, .parseSignatureError("signature is invalid"))
}

func testGenerateSignRequest() {
let signRequest = CosmosSignRequest(
requestId: "7AFD5E09-9267-43FB-A02E-08C4A09417EC",
Expand Down
Loading
Loading