Miachel Scoff 7 years ago
commit 40f75d3460
  1. 1
      .gitignore
  2. 8
      Trust.xcodeproj/project.pbxproj
  3. BIN
      Trust/COMODO ECC Domain Validation Secure Server CA 2.cer
  4. 2
      Trust/Transactions/Coordinators/TransactionDataCoordinator.swift
  5. 23
      Trust/Transactions/Coordinators/TrustProvider.swift

1
.gitignore vendored

@ -81,4 +81,3 @@ Trust.zip
*.mobileprovision *.mobileprovision
*.cer

@ -284,6 +284,8 @@
29FF130A1F75F67200AFD326 /* Address.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FF13091F75F67200AFD326 /* Address.swift */; }; 29FF130A1F75F67200AFD326 /* Address.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FF13091F75F67200AFD326 /* Address.swift */; };
29FF130D1F7626E800AFD326 /* FakeNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FF130C1F7626E800AFD326 /* FakeNavigationController.swift */; }; 29FF130D1F7626E800AFD326 /* FakeNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FF130C1F7626E800AFD326 /* FakeNavigationController.swift */; };
3CDDD1E2CD1B0180754B7992 /* Pods_Trust.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 646C8C822C986358D7388602 /* Pods_Trust.framework */; }; 3CDDD1E2CD1B0180754B7992 /* Pods_Trust.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 646C8C822C986358D7388602 /* Pods_Trust.framework */; };
613D04891FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 613D04881FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer */; };
613D048B1FDE162B008DE72E /* TrustProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 613D048A1FDE162B008DE72E /* TrustProvider.swift */; };
615F10561FCBEF2E008A45AF /* OnboardingPageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615F10551FCBEF2E008A45AF /* OnboardingPageViewModel.swift */; }; 615F10561FCBEF2E008A45AF /* OnboardingPageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615F10551FCBEF2E008A45AF /* OnboardingPageViewModel.swift */; };
615F10591FCBEF7C008A45AF /* OnboardingPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615F10581FCBEF7C008A45AF /* OnboardingPage.swift */; }; 615F10591FCBEF7C008A45AF /* OnboardingPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615F10581FCBEF7C008A45AF /* OnboardingPage.swift */; };
615F105D1FCBF55E008A45AF /* OnboardingCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615F105C1FCBF55E008A45AF /* OnboardingCollectionViewController.swift */; }; 615F105D1FCBF55E008A45AF /* OnboardingCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615F105C1FCBF55E008A45AF /* OnboardingCollectionViewController.swift */; };
@ -604,6 +606,8 @@
29FF130C1F7626E800AFD326 /* FakeNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeNavigationController.swift; sourceTree = "<group>"; }; 29FF130C1F7626E800AFD326 /* FakeNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeNavigationController.swift; sourceTree = "<group>"; };
477899BEAA4489DA423E8857 /* Pods-TrustUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TrustUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TrustUITests/Pods-TrustUITests.debug.xcconfig"; sourceTree = "<group>"; }; 477899BEAA4489DA423E8857 /* Pods-TrustUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TrustUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TrustUITests/Pods-TrustUITests.debug.xcconfig"; sourceTree = "<group>"; };
4DB8204016307EAFC079EA48 /* Pods-Trust.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Trust.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Trust/Pods-Trust.debug.xcconfig"; sourceTree = "<group>"; }; 4DB8204016307EAFC079EA48 /* Pods-Trust.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Trust.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Trust/Pods-Trust.debug.xcconfig"; sourceTree = "<group>"; };
613D04881FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "COMODO ECC Domain Validation Secure Server CA 2.cer"; sourceTree = "<group>"; };
613D048A1FDE162B008DE72E /* TrustProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustProvider.swift; sourceTree = "<group>"; };
615F10551FCBEF2E008A45AF /* OnboardingPageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingPageViewModel.swift; sourceTree = "<group>"; }; 615F10551FCBEF2E008A45AF /* OnboardingPageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingPageViewModel.swift; sourceTree = "<group>"; };
615F10581FCBEF7C008A45AF /* OnboardingPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingPage.swift; sourceTree = "<group>"; }; 615F10581FCBEF7C008A45AF /* OnboardingPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingPage.swift; sourceTree = "<group>"; };
615F105C1FCBF55E008A45AF /* OnboardingCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCollectionViewController.swift; sourceTree = "<group>"; }; 615F105C1FCBF55E008A45AF /* OnboardingCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCollectionViewController.swift; sourceTree = "<group>"; };
@ -722,6 +726,7 @@
2912CD011F6A830700C6CBE3 /* Assets.xcassets */, 2912CD011F6A830700C6CBE3 /* Assets.xcassets */,
2912CD061F6A830700C6CBE3 /* Info.plist */, 2912CD061F6A830700C6CBE3 /* Info.plist */,
29AD8A071F93E1F0008E10E7 /* Trust.entitlements */, 29AD8A071F93E1F0008E10E7 /* Trust.entitlements */,
613D04881FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer */,
296106CD1F777E410006164B /* LaunchScreen.storyboard */, 296106CD1F777E410006164B /* LaunchScreen.storyboard */,
); );
path = Trust; path = Trust;
@ -1116,6 +1121,7 @@
29BE3FD11F707DC300F6BFC2 /* TransactionDataCoordinator.swift */, 29BE3FD11F707DC300F6BFC2 /* TransactionDataCoordinator.swift */,
29FC0CB51F8298820036089F /* TransactionCoordinator.swift */, 29FC0CB51F8298820036089F /* TransactionCoordinator.swift */,
2932045D1F8EEE760095B7C1 /* BalanceCoordinator.swift */, 2932045D1F8EEE760095B7C1 /* BalanceCoordinator.swift */,
613D048A1FDE162B008DE72E /* TrustProvider.swift */,
); );
path = Coordinators; path = Coordinators;
sourceTree = "<group>"; sourceTree = "<group>";
@ -1978,6 +1984,7 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
613D04891FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer in Resources */,
291794FC1F95DE5F00539A30 /* index.html in Resources */, 291794FC1F95DE5F00539A30 /* index.html in Resources */,
296106CE1F777E410006164B /* LaunchScreen.storyboard in Resources */, 296106CE1F777E410006164B /* LaunchScreen.storyboard in Resources */,
290B2B541F8F50030053C83E /* Localizable.strings in Resources */, 290B2B541F8F50030053C83E /* Localizable.strings in Resources */,
@ -2374,6 +2381,7 @@
2963A2881FC401490095447D /* LocalizedOperation.swift in Sources */, 2963A2881FC401490095447D /* LocalizedOperation.swift in Sources */,
61F8AA931FCA4A0F00488C6E /* BigInt.swift in Sources */, 61F8AA931FCA4A0F00488C6E /* BigInt.swift in Sources */,
29C80D371FB2CD230037B1E0 /* ParsedTransaction.swift in Sources */, 29C80D371FB2CD230037B1E0 /* ParsedTransaction.swift in Sources */,
613D048B1FDE162B008DE72E /* TrustProvider.swift in Sources */,
293204581F8DC6B20095B7C1 /* ExchangeRateCoordinator.swift in Sources */, 293204581F8DC6B20095B7C1 /* ExchangeRateCoordinator.swift in Sources */,
29B933F81F8609FF009FCABB /* PaymentFlow.swift in Sources */, 29B933F81F8609FF009FCABB /* PaymentFlow.swift in Sources */,
2963B6BF1F9AB9A2003063C1 /* ContractERC20Transfer.swift in Sources */, 2963B6BF1F9AB9A2003063C1 /* ContractERC20Transfer.swift in Sources */,

@ -29,7 +29,7 @@ class TransactionDataCoordinator {
weak var delegate: TransactionDataCoordinatorDelegate? weak var delegate: TransactionDataCoordinatorDelegate?
private let trustProvider = MoyaProvider<TrustService>() private let trustProvider = TrustProviderFactory.makeProvider()
init( init(
session: WalletSession, session: WalletSession,

@ -0,0 +1,23 @@
// Copyright SIX DAY LLC. All rights reserved.
import Alamofire
import Foundation
import Moya
struct TrustProviderFactory {
static let policies: [String: ServerTrustPolicy] = [
"trustwalletapp.com": .pinPublicKeys(
publicKeys: ServerTrustPolicy.publicKeys(in: Bundle.main),
validateCertificateChain: true,
validateHost: true
),
]
static func makeProvider() -> MoyaProvider<TrustService> {
let manager = Manager(
configuration: URLSessionConfiguration.default,
serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies)
)
return MoyaProvider<TrustService>(manager: manager)
}
}
Loading…
Cancel
Save