From bec7b49af97c3bcfaf452ccbd9d90e8b6415d3cf Mon Sep 17 00:00:00 2001 From: hewig <360470+hewigovens@users.noreply.github.com> Date: Thu, 18 Jun 2020 09:21:01 +0800 Subject: [PATCH] Add default case (won't break compiling with new wallet core) (#50) * add default case (won't break if new blockchain) * Fix Podfile.lock --- Example/Podfile.lock | 2 +- .../Client/Signer/SigningInputEncoder.swift | 21 +------------------ .../Client/Signer/SigningOutputDecoder.swift | 5 +---- TrustSDK/Classes/Client/Types/TrustSDK.swift | 21 +------------------ 4 files changed, 4 insertions(+), 45 deletions(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index bb1ae04..abd3223 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -15,7 +15,7 @@ DEPENDENCIES: - TrustSDK/Wallet (from `../`) SPEC REPOS: - https://github.com/CocoaPods/Specs.git: + trunk: - BigInt - SwiftLint - SwiftProtobuf diff --git a/TrustSDK/Classes/Client/Signer/SigningInputEncoder.swift b/TrustSDK/Classes/Client/Signer/SigningInputEncoder.swift index 2e050a0..6427a16 100644 --- a/TrustSDK/Classes/Client/Signer/SigningInputEncoder.swift +++ b/TrustSDK/Classes/Client/Signer/SigningInputEncoder.swift @@ -135,26 +135,7 @@ public struct SigningInputEncoder { var input = try ZilliqaSigningInput(serializedData: data) input.privateKey = privateKey return input - case .cardano, - .ton, - .ontology, - .bitcoin, - .bitcoinCash, - .dash, - .digiByte, - .dogecoin, - .decred, - .groestlcoin, - .litecoin, - .monacoin, - .qtum, - .ravencoin, - .viacoin, - .zcash, - .zcoin, - .zelcash, - .elrond, - .bitcoinGold: + default: throw TrustSDKError.coinNotSupported } } diff --git a/TrustSDK/Classes/Client/Signer/SigningOutputDecoder.swift b/TrustSDK/Classes/Client/Signer/SigningOutputDecoder.swift index 23fc5b2..b229e6a 100644 --- a/TrustSDK/Classes/Client/Signer/SigningOutputDecoder.swift +++ b/TrustSDK/Classes/Client/Signer/SigningOutputDecoder.swift @@ -97,10 +97,7 @@ public struct SigningOutputDecoder { return try WavesSigningOutput(serializedData: data) case .zilliqa: return try ZilliqaSigningOutput(serializedData: data) - case .cardano, - .ton, - .elrond, - .bitcoinGold: + default: throw TrustSDKError.coinNotSupported } } diff --git a/TrustSDK/Classes/Client/Types/TrustSDK.swift b/TrustSDK/Classes/Client/Types/TrustSDK.swift index 484860a..389141f 100644 --- a/TrustSDK/Classes/Client/Types/TrustSDK.swift +++ b/TrustSDK/Classes/Client/Types/TrustSDK.swift @@ -123,26 +123,7 @@ public extension TrustSDK { .waves, .zilliqa: return true - case .cardano, - .ton, - .ontology, - .bitcoin, - .bitcoinCash, - .dash, - .digiByte, - .dogecoin, - .decred, - .groestlcoin, - .litecoin, - .monacoin, - .qtum, - .ravencoin, - .viacoin, - .zcash, - .zcoin, - .zelcash, - .elrond, - .bitcoinGold: + default: return false } }