diff --git a/.gitignore b/.gitignore index 20548d9b..e38c28bc 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ DerivedData .svn CVS CoreBitcoin.xcodeproj/project.xcworkspace/xcshareddata/ +openssl.bak diff --git a/CoreBitcoin.podspec b/CoreBitcoin.podspec index 17a3fcfe..b7ca6b8f 100644 --- a/CoreBitcoin.podspec +++ b/CoreBitcoin.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CoreBitcoin" - s.version = "0.6.3" + s.version = "0.6.8.1" s.summary = "CoreBitcoin is an implementation of Bitcoin protocol in Objective-C." s.description = <<-DESC CoreBitcoin is a complete toolkit to work with Bitcoin data structures. @@ -12,11 +12,11 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.9' s.source = { :git => "https://github.com/oleganza/CoreBitcoin.git", :tag => s.version.to_s } s.source_files = 'CoreBitcoin' - s.exclude_files = 'CoreBitcoin/**/*+Tests.{h,m}' + s.exclude_files = ['CoreBitcoin/**/*+Tests.{h,m}', 'CoreBitcoin/BTCScriptTestData.h'] s.requires_arc = true s.framework = 'Foundation' s.ios.framework = 'UIKit' s.osx.framework = 'AppKit' - s.dependency 'OpenSSL-Universal', '1.0.1.j-2' + s.dependency 'OpenSSL-Universal', '1.0.1.16' s.dependency 'ISO8601DateFormatter' end diff --git a/CoreBitcoin.xcodeproj/project.pbxproj b/CoreBitcoin.xcodeproj/project.pbxproj index 57aeac90..2b6fcdfb 100644 --- a/CoreBitcoin.xcodeproj/project.pbxproj +++ b/CoreBitcoin.xcodeproj/project.pbxproj @@ -7,12 +7,22 @@ objects = { /* Begin PBXBuildFile section */ + 02DDB9B51AF7D70F00687183 /* BTCCurrencyConverter+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 02DDB9B41AF7D70F00687183 /* BTCCurrencyConverter+Tests.m */; }; + 200459E91C0720FC00BC9EE8 /* BTCSecretSharing.h in Headers */ = {isa = PBXBuildFile; fileRef = 200459E71C0720FC00BC9EE8 /* BTCSecretSharing.h */; }; + 200459EA1C0720FC00BC9EE8 /* BTCSecretSharing.h in Headers */ = {isa = PBXBuildFile; fileRef = 200459E71C0720FC00BC9EE8 /* BTCSecretSharing.h */; }; + 200459EB1C0720FC00BC9EE8 /* BTCSecretSharing.h in Headers */ = {isa = PBXBuildFile; fileRef = 200459E71C0720FC00BC9EE8 /* BTCSecretSharing.h */; }; + 200459EC1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 200459E81C0720FC00BC9EE8 /* BTCSecretSharing.m */; }; + 200459ED1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 200459E81C0720FC00BC9EE8 /* BTCSecretSharing.m */; }; + 200459EE1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 200459E81C0720FC00BC9EE8 /* BTCSecretSharing.m */; }; + 200459EF1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 200459E81C0720FC00BC9EE8 /* BTCSecretSharing.m */; }; + 200459F01C07210100BC9EE8 /* BTCSecretSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 200459E81C0720FC00BC9EE8 /* BTCSecretSharing.m */; }; 200756DA1A5D6A44009A24A9 /* BTCPriceSource+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 200756D91A5D6A44009A24A9 /* BTCPriceSource+Tests.m */; }; 200AAE3F19FA3EFA0004F908 /* BTCOutpoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */; }; 200AAE4019FA3F010004F908 /* BTCOutpoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */; }; 200AAE4119FA3F010004F908 /* BTCOutpoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */; }; 200AAE4219FA3F020004F908 /* BTCOutpoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */; }; 200AAE4319FA3F020004F908 /* BTCOutpoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */; }; + 200FA8DA1C07A8B80039029D /* BTCSecretSharingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 200FA8D91C07A8B80039029D /* BTCSecretSharingTests.swift */; }; 20148AE018355D7200E68E9C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20D2802517B8FE00004A462B /* Foundation.framework */; }; 20148B0518355DAD00E68E9C /* BTCData.m in Sources */ = {isa = PBXBuildFile; fileRef = 2084DD8517B8FF76005AC9E6 /* BTCData.m */; }; 20148B0718355DAD00E68E9C /* NSData+BTCData.m in Sources */ = {isa = PBXBuildFile; fileRef = 20E1E01117C73181003B6987 /* NSData+BTCData.m */; }; @@ -119,14 +129,14 @@ 204FB507194C63B500C131DE /* BTCBlindSignature.m in Sources */ = {isa = PBXBuildFile; fileRef = 204FB501194C63B500C131DE /* BTCBlindSignature.m */; }; 204FB508194C63B500C131DE /* BTCBlindSignature.m in Sources */ = {isa = PBXBuildFile; fileRef = 204FB501194C63B500C131DE /* BTCBlindSignature.m */; }; 204FB509194C63B500C131DE /* BTCBlindSignature.m in Sources */ = {isa = PBXBuildFile; fileRef = 204FB501194C63B500C131DE /* BTCBlindSignature.m */; }; - 2054DC751950E35E007175C8 /* BTCEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2054DC731950E35E007175C8 /* BTCEncryptedMessage.h */; }; - 2054DC761950E35E007175C8 /* BTCEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2054DC731950E35E007175C8 /* BTCEncryptedMessage.h */; }; - 2054DC771950E35E007175C8 /* BTCEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2054DC731950E35E007175C8 /* BTCEncryptedMessage.h */; }; - 2054DC781950E35E007175C8 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCEncryptedMessage.m */; }; - 2054DC791950E35E007175C8 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCEncryptedMessage.m */; }; - 2054DC7A1950E35E007175C8 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCEncryptedMessage.m */; }; - 2054DC7B1950E35E007175C8 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCEncryptedMessage.m */; }; - 2054DC7C1950E35E007175C8 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCEncryptedMessage.m */; }; + 2054DC751950E35E007175C8 /* BTCFancyEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2054DC731950E35E007175C8 /* BTCFancyEncryptedMessage.h */; }; + 2054DC761950E35E007175C8 /* BTCFancyEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2054DC731950E35E007175C8 /* BTCFancyEncryptedMessage.h */; }; + 2054DC771950E35E007175C8 /* BTCFancyEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2054DC731950E35E007175C8 /* BTCFancyEncryptedMessage.h */; }; + 2054DC781950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCFancyEncryptedMessage.m */; }; + 2054DC791950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCFancyEncryptedMessage.m */; }; + 2054DC7A1950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCFancyEncryptedMessage.m */; }; + 2054DC7B1950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCFancyEncryptedMessage.m */; }; + 2054DC7C1950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2054DC741950E35E007175C8 /* BTCFancyEncryptedMessage.m */; }; 2057A9CD17CD555F00353D54 /* BTCKey+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2057A9CC17CD555F00353D54 /* BTCKey+Tests.m */; }; 20584B1D18CD0DA000FDD410 /* BTC256.h in Headers */ = {isa = PBXBuildFile; fileRef = 20584B1B18CD0DA000FDD410 /* BTC256.h */; }; 20584B1E18CD0DA000FDD410 /* BTC256.h in Headers */ = {isa = PBXBuildFile; fileRef = 20584B1B18CD0DA000FDD410 /* BTC256.h */; }; @@ -134,6 +144,58 @@ 20584B2218CD0DA000FDD410 /* BTC256.m in Sources */ = {isa = PBXBuildFile; fileRef = 20584B1C18CD0DA000FDD410 /* BTC256.m */; }; 20584B2318CD0DA000FDD410 /* BTC256.m in Sources */ = {isa = PBXBuildFile; fileRef = 20584B1C18CD0DA000FDD410 /* BTC256.m */; }; 20584B2418CD0DA000FDD410 /* BTC256.m in Sources */ = {isa = PBXBuildFile; fileRef = 20584B1C18CD0DA000FDD410 /* BTC256.m */; }; + 205D8B981B160BFB00F9EA4E /* BTCAssetType.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8B961B160BFB00F9EA4E /* BTCAssetType.h */; }; + 205D8B991B160BFB00F9EA4E /* BTCAssetType.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8B961B160BFB00F9EA4E /* BTCAssetType.h */; }; + 205D8B9A1B160BFB00F9EA4E /* BTCAssetType.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8B961B160BFB00F9EA4E /* BTCAssetType.h */; }; + 205D8B9B1B160BFB00F9EA4E /* BTCAssetType.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8B971B160BFB00F9EA4E /* BTCAssetType.m */; }; + 205D8B9C1B160BFB00F9EA4E /* BTCAssetType.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8B971B160BFB00F9EA4E /* BTCAssetType.m */; }; + 205D8B9D1B160BFB00F9EA4E /* BTCAssetType.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8B971B160BFB00F9EA4E /* BTCAssetType.m */; }; + 205D8B9E1B160BFB00F9EA4E /* BTCAssetType.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8B971B160BFB00F9EA4E /* BTCAssetType.m */; }; + 205D8B9F1B160BFB00F9EA4E /* BTCAssetType.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8B971B160BFB00F9EA4E /* BTCAssetType.m */; }; + 205D8BA21B16182500F9EA4E /* BTCAssetID.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BA01B16182500F9EA4E /* BTCAssetID.h */; }; + 205D8BA31B16182500F9EA4E /* BTCAssetID.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BA01B16182500F9EA4E /* BTCAssetID.h */; }; + 205D8BA41B16182500F9EA4E /* BTCAssetID.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BA01B16182500F9EA4E /* BTCAssetID.h */; }; + 205D8BA51B16182500F9EA4E /* BTCAssetID.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BA11B16182500F9EA4E /* BTCAssetID.m */; }; + 205D8BA61B16182500F9EA4E /* BTCAssetID.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BA11B16182500F9EA4E /* BTCAssetID.m */; }; + 205D8BA71B16182500F9EA4E /* BTCAssetID.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BA11B16182500F9EA4E /* BTCAssetID.m */; }; + 205D8BA81B16182500F9EA4E /* BTCAssetID.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BA11B16182500F9EA4E /* BTCAssetID.m */; }; + 205D8BA91B16182500F9EA4E /* BTCAssetID.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BA11B16182500F9EA4E /* BTCAssetID.m */; }; + 205D8BAB1B1621DB00F9EA4E /* BTCAddressSubclass.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BAA1B1621DB00F9EA4E /* BTCAddressSubclass.h */; }; + 205D8BAC1B1621DB00F9EA4E /* BTCAddressSubclass.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BAA1B1621DB00F9EA4E /* BTCAddressSubclass.h */; }; + 205D8BAD1B1621DB00F9EA4E /* BTCAddressSubclass.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BAA1B1621DB00F9EA4E /* BTCAddressSubclass.h */; }; + 205D8BB01B171D0900F9EA4E /* BTCPaymentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BAE1B171D0900F9EA4E /* BTCPaymentRequest.h */; }; + 205D8BB11B171D0900F9EA4E /* BTCPaymentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BAE1B171D0900F9EA4E /* BTCPaymentRequest.h */; }; + 205D8BB21B171D0900F9EA4E /* BTCPaymentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BAE1B171D0900F9EA4E /* BTCPaymentRequest.h */; }; + 205D8BB31B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BAF1B171D0900F9EA4E /* BTCPaymentRequest.m */; }; + 205D8BB41B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BAF1B171D0900F9EA4E /* BTCPaymentRequest.m */; }; + 205D8BB51B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BAF1B171D0900F9EA4E /* BTCPaymentRequest.m */; }; + 205D8BB61B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BAF1B171D0900F9EA4E /* BTCPaymentRequest.m */; }; + 205D8BB71B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BAF1B171D0900F9EA4E /* BTCPaymentRequest.m */; }; + 205D8BC41B172D8100F9EA4E /* BTCPaymentMethodRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BC21B172D8100F9EA4E /* BTCPaymentMethodRequest.h */; }; + 205D8BC51B172D8100F9EA4E /* BTCPaymentMethodRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BC21B172D8100F9EA4E /* BTCPaymentMethodRequest.h */; }; + 205D8BC61B172D8100F9EA4E /* BTCPaymentMethodRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BC21B172D8100F9EA4E /* BTCPaymentMethodRequest.h */; }; + 205D8BC71B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BC31B172D8100F9EA4E /* BTCPaymentMethodRequest.m */; }; + 205D8BC81B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BC31B172D8100F9EA4E /* BTCPaymentMethodRequest.m */; }; + 205D8BC91B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BC31B172D8100F9EA4E /* BTCPaymentMethodRequest.m */; }; + 205D8BCA1B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BC31B172D8100F9EA4E /* BTCPaymentMethodRequest.m */; }; + 205D8BCB1B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BC31B172D8100F9EA4E /* BTCPaymentMethodRequest.m */; }; + 205D8BCE1B176DC000F9EA4E /* BTCPaymentMethodDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BCC1B176DC000F9EA4E /* BTCPaymentMethodDetails.h */; }; + 205D8BCF1B176DC000F9EA4E /* BTCPaymentMethodDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BCC1B176DC000F9EA4E /* BTCPaymentMethodDetails.h */; }; + 205D8BD01B176DC000F9EA4E /* BTCPaymentMethodDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D8BCC1B176DC000F9EA4E /* BTCPaymentMethodDetails.h */; }; + 205D8BD11B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BCD1B176DC000F9EA4E /* BTCPaymentMethodDetails.m */; }; + 205D8BD21B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BCD1B176DC000F9EA4E /* BTCPaymentMethodDetails.m */; }; + 205D8BD31B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BCD1B176DC000F9EA4E /* BTCPaymentMethodDetails.m */; }; + 205D8BD41B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BCD1B176DC000F9EA4E /* BTCPaymentMethodDetails.m */; }; + 205D8BD51B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 205D8BCD1B176DC000F9EA4E /* BTCPaymentMethodDetails.m */; }; + 2060A2801AAA077A004531FD /* BTCMerkleTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 2060A27E1AAA077A004531FD /* BTCMerkleTree.h */; }; + 2060A2811AAA077A004531FD /* BTCMerkleTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 2060A27E1AAA077A004531FD /* BTCMerkleTree.h */; }; + 2060A2821AAA077A004531FD /* BTCMerkleTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 2060A27E1AAA077A004531FD /* BTCMerkleTree.h */; }; + 2060A2831AAA077A004531FD /* BTCMerkleTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 2060A27F1AAA077A004531FD /* BTCMerkleTree.m */; }; + 2060A2841AAA077A004531FD /* BTCMerkleTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 2060A27F1AAA077A004531FD /* BTCMerkleTree.m */; }; + 2060A2851AAA077A004531FD /* BTCMerkleTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 2060A27F1AAA077A004531FD /* BTCMerkleTree.m */; }; + 2060A2861AAA077A004531FD /* BTCMerkleTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 2060A27F1AAA077A004531FD /* BTCMerkleTree.m */; }; + 2060A2871AAA077A004531FD /* BTCMerkleTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 2060A27F1AAA077A004531FD /* BTCMerkleTree.m */; }; + 2060A28A1AAA09A3004531FD /* BTCMerkleTree+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2060A2891AAA09A3004531FD /* BTCMerkleTree+Tests.m */; }; 2061D1D61A2CA771004F1E40 /* BTCHashID.h in Headers */ = {isa = PBXBuildFile; fileRef = 2061D1D41A2CA771004F1E40 /* BTCHashID.h */; }; 2061D1D71A2CA771004F1E40 /* BTCHashID.h in Headers */ = {isa = PBXBuildFile; fileRef = 2061D1D41A2CA771004F1E40 /* BTCHashID.h */; }; 2061D1D81A2CA771004F1E40 /* BTCHashID.h in Headers */ = {isa = PBXBuildFile; fileRef = 2061D1D41A2CA771004F1E40 /* BTCHashID.h */; }; @@ -257,6 +319,15 @@ 2084DD9317B8FF76005AC9E6 /* BTCData.m in Sources */ = {isa = PBXBuildFile; fileRef = 2084DD8517B8FF76005AC9E6 /* BTCData.m */; }; 2084DD9817B8FFA2005AC9E6 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2084DD9617B8FFA2005AC9E6 /* Security.framework */; }; 208642BB194C9EAF003A3A2C /* BTCBlindSignature+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 208642BA194C9EAF003A3A2C /* BTCBlindSignature+Tests.m */; }; + 208E30361AC012CE0020F830 /* BTCEncryptedBackup.h in Headers */ = {isa = PBXBuildFile; fileRef = 208E30341AC012CE0020F830 /* BTCEncryptedBackup.h */; }; + 208E30371AC012CE0020F830 /* BTCEncryptedBackup.h in Headers */ = {isa = PBXBuildFile; fileRef = 208E30341AC012CE0020F830 /* BTCEncryptedBackup.h */; }; + 208E30381AC012CE0020F830 /* BTCEncryptedBackup.h in Headers */ = {isa = PBXBuildFile; fileRef = 208E30341AC012CE0020F830 /* BTCEncryptedBackup.h */; }; + 208E30391AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */ = {isa = PBXBuildFile; fileRef = 208E30351AC012CE0020F830 /* BTCEncryptedBackup.m */; }; + 208E303A1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */ = {isa = PBXBuildFile; fileRef = 208E30351AC012CE0020F830 /* BTCEncryptedBackup.m */; }; + 208E303B1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */ = {isa = PBXBuildFile; fileRef = 208E30351AC012CE0020F830 /* BTCEncryptedBackup.m */; }; + 208E303C1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */ = {isa = PBXBuildFile; fileRef = 208E30351AC012CE0020F830 /* BTCEncryptedBackup.m */; }; + 208E303D1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */ = {isa = PBXBuildFile; fileRef = 208E30351AC012CE0020F830 /* BTCEncryptedBackup.m */; }; + 2091948D1ACD318C00E67CB5 /* BTCBitcoinURL+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2091948C1ACD318C00E67CB5 /* BTCBitcoinURL+Tests.m */; }; 209D1E1218D48EA200293483 /* BTCNetwork.h in Headers */ = {isa = PBXBuildFile; fileRef = 209D1E1018D48EA200293483 /* BTCNetwork.h */; }; 209D1E1318D48EA200293483 /* BTCNetwork.h in Headers */ = {isa = PBXBuildFile; fileRef = 209D1E1018D48EA200293483 /* BTCNetwork.h */; }; 209D1E1418D48EA200293483 /* BTCNetwork.h in Headers */ = {isa = PBXBuildFile; fileRef = 209D1E1018D48EA200293483 /* BTCNetwork.h */; }; @@ -273,6 +344,33 @@ 209D1E2118D4F12500293483 /* BTCProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 209D1E1B18D4F12500293483 /* BTCProcessor.m */; }; 209D1E2218D4F12500293483 /* BTCProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 209D1E1B18D4F12500293483 /* BTCProcessor.m */; }; 209D1E2318D4F12500293483 /* BTCProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 209D1E1B18D4F12500293483 /* BTCProcessor.m */; }; + 209F27C11AE538F80092A1FB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2084DD9617B8FFA2005AC9E6 /* Security.framework */; }; + 20A443B51AC55F52008B3447 /* BTCPaymentProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443B11AC55F52008B3447 /* BTCPaymentProtocol.h */; }; + 20A443B61AC55F52008B3447 /* BTCPaymentProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443B11AC55F52008B3447 /* BTCPaymentProtocol.h */; }; + 20A443B71AC55F52008B3447 /* BTCPaymentProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443B11AC55F52008B3447 /* BTCPaymentProtocol.h */; }; + 20A443B81AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B21AC55F52008B3447 /* BTCPaymentProtocol.m */; }; + 20A443B91AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B21AC55F52008B3447 /* BTCPaymentProtocol.m */; }; + 20A443BA1AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B21AC55F52008B3447 /* BTCPaymentProtocol.m */; }; + 20A443BB1AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B21AC55F52008B3447 /* BTCPaymentProtocol.m */; }; + 20A443BC1AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B21AC55F52008B3447 /* BTCPaymentProtocol.m */; }; + 20A443BD1AC55F52008B3447 /* BTCProtocolBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443B31AC55F52008B3447 /* BTCProtocolBuffers.h */; }; + 20A443BE1AC55F52008B3447 /* BTCProtocolBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443B31AC55F52008B3447 /* BTCProtocolBuffers.h */; }; + 20A443BF1AC55F52008B3447 /* BTCProtocolBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443B31AC55F52008B3447 /* BTCProtocolBuffers.h */; }; + 20A443C01AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B41AC55F52008B3447 /* BTCProtocolBuffers.m */; }; + 20A443C11AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B41AC55F52008B3447 /* BTCProtocolBuffers.m */; }; + 20A443C21AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B41AC55F52008B3447 /* BTCProtocolBuffers.m */; }; + 20A443C31AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B41AC55F52008B3447 /* BTCProtocolBuffers.m */; }; + 20A443C41AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443B41AC55F52008B3447 /* BTCProtocolBuffers.m */; }; + 20A443C71AC82594008B3447 /* BTCEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443C51AC82594008B3447 /* BTCEncryptedMessage.h */; }; + 20A443C81AC82594008B3447 /* BTCEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443C51AC82594008B3447 /* BTCEncryptedMessage.h */; }; + 20A443C91AC82594008B3447 /* BTCEncryptedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 20A443C51AC82594008B3447 /* BTCEncryptedMessage.h */; }; + 20A443CA1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443C61AC82594008B3447 /* BTCEncryptedMessage.m */; }; + 20A443CB1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443C61AC82594008B3447 /* BTCEncryptedMessage.m */; }; + 20A443CC1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443C61AC82594008B3447 /* BTCEncryptedMessage.m */; }; + 20A443CD1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443C61AC82594008B3447 /* BTCEncryptedMessage.m */; }; + 20A443CE1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443C61AC82594008B3447 /* BTCEncryptedMessage.m */; }; + 20A443D11AC825DA008B3447 /* BTCEncryptedMessage+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443D01AC825DA008B3447 /* BTCEncryptedMessage+Tests.m */; }; + 20A443D51AC954C1008B3447 /* BTCEncryptedBackup+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20A443D41AC954C1008B3447 /* BTCEncryptedBackup+Tests.m */; }; 20B5A64018924F350035582D /* BTCTransaction+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20B5A63F18924F350035582D /* BTCTransaction+Tests.m */; }; 20B66C8717BFE4F9007128CE /* BTCErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = 20B66C8617BFE4F9007128CE /* BTCErrors.m */; }; 20B8AB92189E7E0100008138 /* BTCCurvePoint+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20B8AB91189E7E0100008138 /* BTCCurvePoint+Tests.m */; }; @@ -314,7 +412,15 @@ 20C2D80A19E2F2280022CAAC /* BTCMnemonic+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C2D80319E2F2280022CAAC /* BTCMnemonic+Tests.m */; }; 20C2D80B19E2F2280022CAAC /* BTCMnemonic+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C2D80319E2F2280022CAAC /* BTCMnemonic+Tests.m */; }; 20C3F16917BFDCF8009DB89C /* libSystem.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 20C3F16817BFDCF8009DB89C /* libSystem.dylib */; }; - 20C4860A1955A88C0061DF75 /* BTCEncryptedMessage+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C486091955A88B0061DF75 /* BTCEncryptedMessage+Tests.m */; }; + 20C4860A1955A88C0061DF75 /* BTCFancyEncryptedMessage+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C486091955A88B0061DF75 /* BTCFancyEncryptedMessage+Tests.m */; }; + 20C7D14C1B0CBBC900F71493 /* BTCAssetAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = 20C7D14A1B0CBBC900F71493 /* BTCAssetAddress.h */; }; + 20C7D14D1B0CBBC900F71493 /* BTCAssetAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = 20C7D14A1B0CBBC900F71493 /* BTCAssetAddress.h */; }; + 20C7D14E1B0CBBC900F71493 /* BTCAssetAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = 20C7D14A1B0CBBC900F71493 /* BTCAssetAddress.h */; }; + 20C7D14F1B0CBBC900F71493 /* BTCAssetAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C7D14B1B0CBBC900F71493 /* BTCAssetAddress.m */; }; + 20C7D1501B0CBBC900F71493 /* BTCAssetAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C7D14B1B0CBBC900F71493 /* BTCAssetAddress.m */; }; + 20C7D1511B0CBBC900F71493 /* BTCAssetAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C7D14B1B0CBBC900F71493 /* BTCAssetAddress.m */; }; + 20C7D1521B0CBBC900F71493 /* BTCAssetAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C7D14B1B0CBBC900F71493 /* BTCAssetAddress.m */; }; + 20C7D1531B0CBBC900F71493 /* BTCAssetAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C7D14B1B0CBBC900F71493 /* BTCAssetAddress.m */; }; 20CD68DA189B18820083E1A9 /* BTCCurvePoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 20CD68D8189B18820083E1A9 /* BTCCurvePoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20CD68DB189B18820083E1A9 /* BTCCurvePoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 20CD68D8189B18820083E1A9 /* BTCCurvePoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20CD68DC189B18820083E1A9 /* BTCCurvePoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 20CD68D8189B18820083E1A9 /* BTCCurvePoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -353,6 +459,37 @@ 20D09C6218BC016C00794209 /* BTCBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = 20D09C5A18BC016B00794209 /* BTCBlock.m */; }; 20E154DA195D0DB400DA40D3 /* BTCBlockchainInfo+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20E154D9195D0DB400DA40D3 /* BTCBlockchainInfo+Tests.m */; }; 20E1E01217C73181003B6987 /* NSData+BTCData.m in Sources */ = {isa = PBXBuildFile; fileRef = 20E1E01117C73181003B6987 /* NSData+BTCData.m */; }; + 20FFD7F41B1E3EB300CCA48D /* BTCPaymentMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 20FFD7F21B1E3EB300CCA48D /* BTCPaymentMethod.h */; }; + 20FFD7F51B1E3EB300CCA48D /* BTCPaymentMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 20FFD7F21B1E3EB300CCA48D /* BTCPaymentMethod.h */; }; + 20FFD7F61B1E3EB300CCA48D /* BTCPaymentMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 20FFD7F21B1E3EB300CCA48D /* BTCPaymentMethod.h */; }; + 20FFD7F71B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 20FFD7F31B1E3EB300CCA48D /* BTCPaymentMethod.m */; }; + 20FFD7F81B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 20FFD7F31B1E3EB300CCA48D /* BTCPaymentMethod.m */; }; + 20FFD7F91B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 20FFD7F31B1E3EB300CCA48D /* BTCPaymentMethod.m */; }; + 20FFD7FA1B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 20FFD7F31B1E3EB300CCA48D /* BTCPaymentMethod.m */; }; + 20FFD7FB1B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 20FFD7F31B1E3EB300CCA48D /* BTCPaymentMethod.m */; }; + 20FFD8001B1F85F300CCA48D /* BTCPaymentProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20FFD7FF1B1F85F300CCA48D /* BTCPaymentProtocolTests.swift */; }; + 752834A91B699BEC00CD92E3 /* BTCScriptTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752834A81B699BEC00CD92E3 /* BTCScriptTests.swift */; }; + 753118261B6042A400A102E2 /* BTCKeychainTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753118251B6042A400A102E2 /* BTCKeychainTests.swift */; }; + 754564761B07F9AB008F34DC /* BTCBitcoinURLTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 754564751B07F9AB008F34DC /* BTCBitcoinURLTests.swift */; }; + 7549DAD11B0BB1D900F20FF0 /* BTCCurrencyConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7549DAD01B0BB1D900F20FF0 /* BTCCurrencyConverterTests.swift */; }; + 7558460E1B14E4B100E49C87 /* BTCEncryptedBackupTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7558460D1B14E4B100E49C87 /* BTCEncryptedBackupTests.swift */; }; + 757B241B1B03F1BF0084A9DE /* CoreBitcoinOSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 206B0113183547C200878B8D /* CoreBitcoinOSX.framework */; }; + 758C8C451C08F111000C1796 /* BTCBigNumberTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 758C8C441C08F111000C1796 /* BTCBigNumberTests.swift */; }; + 758DDAFE1BD2D83600AEDFFB /* BTCMnemonicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 758DDAFD1BD2D83600AEDFFB /* BTCMnemonicTests.swift */; }; + 75A06DA01B17B7FE00ED7E79 /* BTCKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75A06D9F1B17B7FE00ED7E79 /* BTCKeyTests.swift */; }; + 75A1A3721B0E7DB900EA8D45 /* BTCBlindSignatureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75A1A3711B0E7DB900EA8D45 /* BTCBlindSignatureTests.swift */; }; + 75AF30351C152B1D002187AF /* BTCProtocolSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF30341C152B1D002187AF /* BTCProtocolSerializationTests.swift */; }; + 75AF30371C152EE3002187AF /* BTCEncryptedMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF30361C152EE3002187AF /* BTCEncryptedMessageTests.swift */; }; + 75AF303B1C153009002187AF /* BTCMerkleTreeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF303A1C153009002187AF /* BTCMerkleTreeTests.swift */; }; + 75B819061B04E65A0055F8B1 /* BTCAddressTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B819051B04E65A0055F8B1 /* BTCAddressTests.swift */; }; + 75B819081B04E68B0055F8B1 /* BTCBlockchainInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B819071B04E68B0055F8B1 /* BTCBlockchainInfoTests.swift */; }; + 75B8190A1B04E69A0055F8B1 /* BTCPriceSourceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B819091B04E69A0055F8B1 /* BTCPriceSourceTests.swift */; }; + 75BBC6E51B0E721700A61690 /* BTCCurvePointTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75BBC6E41B0E721700A61690 /* BTCCurvePointTests.swift */; }; + 75BCBB661C08FADD00D5876A /* BTCBase58Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75BCBB651C08FADD00D5876A /* BTCBase58Tests.swift */; }; + 75BD89A41B46269E0073A611 /* BTCDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75BD89A31B46269E0073A611 /* BTCDataTests.swift */; }; + 75E565AE1B7927C800CCCFA5 /* BTCTransactionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E565AD1B7927C800CCCFA5 /* BTCTransactionTests.swift */; }; + 75EB9FF11B39C61500C26E70 /* BTC256Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EB9FF01B39C61500C26E70 /* BTC256Tests.swift */; }; + 75FB13E61B449661006D8935 /* BTCFancyEncryptedMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75FB13E51B449661006D8935 /* BTCFancyEncryptedMessageTests.swift */; }; C9C3C171195B535500D9F6FB /* BTCChainCom.h in Headers */ = {isa = PBXBuildFile; fileRef = C9C3C16F195B535500D9F6FB /* BTCChainCom.h */; }; C9C3C172195B535500D9F6FB /* BTCChainCom.h in Headers */ = {isa = PBXBuildFile; fileRef = C9C3C16F195B535500D9F6FB /* BTCChainCom.h */; }; C9C3C173195B535500D9F6FB /* BTCChainCom.h in Headers */ = {isa = PBXBuildFile; fileRef = C9C3C16F195B535500D9F6FB /* BTCChainCom.h */; }; @@ -363,6 +500,16 @@ C9C3C178195B535500D9F6FB /* BTCChainCom.m in Sources */ = {isa = PBXBuildFile; fileRef = C9C3C170195B535500D9F6FB /* BTCChainCom.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 757B241C1B03F1BF0084A9DE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 20D2801A17B8FE00004A462B /* Project object */; + proxyType = 1; + remoteGlobalIDString = 206B0112183547C200878B8D; + remoteInfo = CoreBitcoinOSX; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 20148ADD18355D7200E68E9C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -385,10 +532,16 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 02DDB9B31AF7D69600687183 /* BTCCurrencyConverter+Tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BTCCurrencyConverter+Tests.h"; sourceTree = ""; }; + 02DDB9B41AF7D70F00687183 /* BTCCurrencyConverter+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCCurrencyConverter+Tests.m"; sourceTree = ""; }; + 200459E71C0720FC00BC9EE8 /* BTCSecretSharing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCSecretSharing.h; sourceTree = ""; }; + 200459E81C0720FC00BC9EE8 /* BTCSecretSharing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCSecretSharing.m; sourceTree = ""; }; 200756D81A5D6A44009A24A9 /* BTCPriceSource+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCPriceSource+Tests.h"; sourceTree = ""; }; 200756D91A5D6A44009A24A9 /* BTCPriceSource+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCPriceSource+Tests.m"; sourceTree = ""; }; 200AAE3D19FA3EFA0004F908 /* BTCOutpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCOutpoint.h; sourceTree = ""; }; 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCOutpoint.m; sourceTree = ""; }; + 200FA8D91C07A8B80039029D /* BTCSecretSharingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCSecretSharingTests.swift; sourceTree = ""; }; + 200FA8DB1C0CF8400039029D /* TestsSwiftBridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestsSwiftBridgingHeader.h; sourceTree = ""; }; 20148ADF18355D7200E68E9C /* libCoreBitcoinIOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCoreBitcoinIOS.a; sourceTree = BUILT_PRODUCTS_DIR; }; 20148AE318355D7200E68E9C /* CoreBitcoinIOSlib-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CoreBitcoinIOSlib-Prefix.pch"; sourceTree = ""; }; 20148B2418355E8F00E68E9C /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; @@ -411,15 +564,29 @@ 2037AB1717D3D1F900DB248C /* BTCBase58+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCBase58+Tests.m"; sourceTree = ""; }; 2039DB0117E2ED2B0051177B /* GLOSSARY.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = GLOSSARY.md; sourceTree = ""; }; 2039DB0217E2ED7F0051177B /* ScriptStringRepresentation.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = ScriptStringRepresentation.md; sourceTree = ""; }; - 204F8A801845FAF8002649CE /* TODO.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = TODO.txt; sourceTree = ""; }; 204FB500194C63B500C131DE /* BTCBlindSignature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCBlindSignature.h; sourceTree = ""; }; 204FB501194C63B500C131DE /* BTCBlindSignature.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCBlindSignature.m; sourceTree = ""; }; - 2054DC731950E35E007175C8 /* BTCEncryptedMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCEncryptedMessage.h; sourceTree = ""; }; - 2054DC741950E35E007175C8 /* BTCEncryptedMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCEncryptedMessage.m; sourceTree = ""; }; + 2054DC731950E35E007175C8 /* BTCFancyEncryptedMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCFancyEncryptedMessage.h; sourceTree = ""; }; + 2054DC741950E35E007175C8 /* BTCFancyEncryptedMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCFancyEncryptedMessage.m; sourceTree = ""; }; 2057A9CB17CD555F00353D54 /* BTCKey+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCKey+Tests.h"; sourceTree = ""; }; 2057A9CC17CD555F00353D54 /* BTCKey+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCKey+Tests.m"; sourceTree = ""; }; 20584B1B18CD0DA000FDD410 /* BTC256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTC256.h; sourceTree = ""; }; 20584B1C18CD0DA000FDD410 /* BTC256.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTC256.m; sourceTree = ""; }; + 205D8B961B160BFB00F9EA4E /* BTCAssetType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCAssetType.h; sourceTree = ""; }; + 205D8B971B160BFB00F9EA4E /* BTCAssetType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCAssetType.m; sourceTree = ""; }; + 205D8BA01B16182500F9EA4E /* BTCAssetID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCAssetID.h; sourceTree = ""; }; + 205D8BA11B16182500F9EA4E /* BTCAssetID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCAssetID.m; sourceTree = ""; }; + 205D8BAA1B1621DB00F9EA4E /* BTCAddressSubclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCAddressSubclass.h; sourceTree = ""; }; + 205D8BAE1B171D0900F9EA4E /* BTCPaymentRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCPaymentRequest.h; sourceTree = ""; }; + 205D8BAF1B171D0900F9EA4E /* BTCPaymentRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCPaymentRequest.m; sourceTree = ""; }; + 205D8BC21B172D8100F9EA4E /* BTCPaymentMethodRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCPaymentMethodRequest.h; sourceTree = ""; }; + 205D8BC31B172D8100F9EA4E /* BTCPaymentMethodRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCPaymentMethodRequest.m; sourceTree = ""; }; + 205D8BCC1B176DC000F9EA4E /* BTCPaymentMethodDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCPaymentMethodDetails.h; sourceTree = ""; }; + 205D8BCD1B176DC000F9EA4E /* BTCPaymentMethodDetails.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCPaymentMethodDetails.m; sourceTree = ""; }; + 2060A27E1AAA077A004531FD /* BTCMerkleTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCMerkleTree.h; sourceTree = ""; }; + 2060A27F1AAA077A004531FD /* BTCMerkleTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCMerkleTree.m; sourceTree = ""; }; + 2060A2881AAA09A3004531FD /* BTCMerkleTree+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCMerkleTree+Tests.h"; sourceTree = ""; }; + 2060A2891AAA09A3004531FD /* BTCMerkleTree+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCMerkleTree+Tests.m"; sourceTree = ""; }; 2061D1D41A2CA771004F1E40 /* BTCHashID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCHashID.h; sourceTree = ""; }; 2061D1D51A2CA771004F1E40 /* BTCHashID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCHashID.m; sourceTree = ""; }; 206B0113183547C200878B8D /* CoreBitcoinOSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreBitcoinOSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -480,12 +647,27 @@ 2084DD9F17B90174005AC9E6 /* update_openssl.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = update_openssl.sh; sourceTree = SOURCE_ROOT; }; 208642B9194C9EAF003A3A2C /* BTCBlindSignature+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCBlindSignature+Tests.h"; sourceTree = ""; }; 208642BA194C9EAF003A3A2C /* BTCBlindSignature+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCBlindSignature+Tests.m"; sourceTree = ""; }; + 208E30341AC012CE0020F830 /* BTCEncryptedBackup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCEncryptedBackup.h; sourceTree = ""; }; + 208E30351AC012CE0020F830 /* BTCEncryptedBackup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCEncryptedBackup.m; sourceTree = ""; }; + 2091948B1ACD318C00E67CB5 /* BTCBitcoinURL+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCBitcoinURL+Tests.h"; sourceTree = ""; }; + 2091948C1ACD318C00E67CB5 /* BTCBitcoinURL+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCBitcoinURL+Tests.m"; sourceTree = ""; }; 209818911839688D00541747 /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; }; 209818921839694000541747 /* CoreBitcoin.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = CoreBitcoin.podspec; sourceTree = ""; }; 209D1E1018D48EA200293483 /* BTCNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCNetwork.h; sourceTree = ""; }; 209D1E1118D48EA200293483 /* BTCNetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCNetwork.m; sourceTree = ""; }; 209D1E1A18D4F12500293483 /* BTCProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCProcessor.h; sourceTree = ""; }; 209D1E1B18D4F12500293483 /* BTCProcessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCProcessor.m; sourceTree = ""; }; + 20A443B11AC55F52008B3447 /* BTCPaymentProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCPaymentProtocol.h; sourceTree = ""; }; + 20A443B21AC55F52008B3447 /* BTCPaymentProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCPaymentProtocol.m; sourceTree = ""; }; + 20A443B31AC55F52008B3447 /* BTCProtocolBuffers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCProtocolBuffers.h; sourceTree = ""; }; + 20A443B41AC55F52008B3447 /* BTCProtocolBuffers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCProtocolBuffers.m; sourceTree = ""; }; + 20A443C51AC82594008B3447 /* BTCEncryptedMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCEncryptedMessage.h; sourceTree = ""; }; + 20A443C61AC82594008B3447 /* BTCEncryptedMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCEncryptedMessage.m; sourceTree = ""; }; + 20A443CF1AC825DA008B3447 /* BTCEncryptedMessage+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCEncryptedMessage+Tests.h"; sourceTree = ""; }; + 20A443D01AC825DA008B3447 /* BTCEncryptedMessage+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCEncryptedMessage+Tests.m"; sourceTree = ""; }; + 20A443D21AC941F7008B3447 /* ReleaseNotes.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ReleaseNotes.md; sourceTree = ""; }; + 20A443D31AC954C1008B3447 /* BTCEncryptedBackup+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCEncryptedBackup+Tests.h"; sourceTree = ""; }; + 20A443D41AC954C1008B3447 /* BTCEncryptedBackup+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCEncryptedBackup+Tests.m"; sourceTree = ""; }; 20B5A63E18924F350035582D /* BTCTransaction+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCTransaction+Tests.h"; sourceTree = ""; }; 20B5A63F18924F350035582D /* BTCTransaction+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCTransaction+Tests.m"; sourceTree = ""; }; 20B66C8517BFE4F9007128CE /* BTCErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCErrors.h; sourceTree = ""; }; @@ -509,8 +691,10 @@ 20C2D80219E2F2280022CAAC /* BTCMnemonic+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCMnemonic+Tests.h"; sourceTree = ""; }; 20C2D80319E2F2280022CAAC /* BTCMnemonic+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCMnemonic+Tests.m"; sourceTree = ""; }; 20C3F16817BFDCF8009DB89C /* libSystem.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libSystem.dylib; path = usr/lib/libSystem.dylib; sourceTree = SDKROOT; }; - 20C486081955A88B0061DF75 /* BTCEncryptedMessage+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCEncryptedMessage+Tests.h"; sourceTree = ""; }; - 20C486091955A88B0061DF75 /* BTCEncryptedMessage+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCEncryptedMessage+Tests.m"; sourceTree = ""; }; + 20C486081955A88B0061DF75 /* BTCFancyEncryptedMessage+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTCFancyEncryptedMessage+Tests.h"; sourceTree = ""; }; + 20C486091955A88B0061DF75 /* BTCFancyEncryptedMessage+Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BTCFancyEncryptedMessage+Tests.m"; sourceTree = ""; }; + 20C7D14A1B0CBBC900F71493 /* BTCAssetAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCAssetAddress.h; sourceTree = ""; }; + 20C7D14B1B0CBBC900F71493 /* BTCAssetAddress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCAssetAddress.m; sourceTree = ""; }; 20CD68D8189B18820083E1A9 /* BTCCurvePoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCCurvePoint.h; sourceTree = ""; }; 20CD68D9189B18820083E1A9 /* BTCCurvePoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCCurvePoint.m; sourceTree = ""; }; 20D008C018D1AFA800079B79 /* BTC256+Tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BTC256+Tests.h"; sourceTree = ""; }; @@ -532,6 +716,34 @@ 20E1E01117C73181003B6987 /* NSData+BTCData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+BTCData.m"; sourceTree = ""; }; 20E1E01317C735EE003B6987 /* NS+BTCBase58.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NS+BTCBase58.h"; sourceTree = ""; }; 20E1E01417C735EE003B6987 /* NS+BTCBase58.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NS+BTCBase58.m"; sourceTree = ""; }; + 20FFD7F21B1E3EB300CCA48D /* BTCPaymentMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCPaymentMethod.h; sourceTree = ""; }; + 20FFD7F31B1E3EB300CCA48D /* BTCPaymentMethod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCPaymentMethod.m; sourceTree = ""; }; + 20FFD7FF1B1F85F300CCA48D /* BTCPaymentProtocolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCPaymentProtocolTests.swift; sourceTree = ""; }; + 752834A81B699BEC00CD92E3 /* BTCScriptTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCScriptTests.swift; sourceTree = ""; }; + 753118251B6042A400A102E2 /* BTCKeychainTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCKeychainTests.swift; sourceTree = ""; }; + 754564751B07F9AB008F34DC /* BTCBitcoinURLTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCBitcoinURLTests.swift; sourceTree = ""; }; + 7549DAD01B0BB1D900F20FF0 /* BTCCurrencyConverterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCCurrencyConverterTests.swift; sourceTree = ""; }; + 7558460D1B14E4B100E49C87 /* BTCEncryptedBackupTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCEncryptedBackupTests.swift; sourceTree = ""; }; + 757B24151B03F1BF0084A9DE /* CoreBitcoinTestsOSX.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreBitcoinTestsOSX.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 757B24181B03F1BF0084A9DE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 757B24211B03F1E80084A9DE /* SwiftBridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftBridgingHeader.h; sourceTree = ""; }; + 758A16C71B69BAF30075C64A /* BTCScriptTestData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BTCScriptTestData.h; path = ../CoreBitcoin/BTCScriptTestData.h; sourceTree = ""; }; + 758C8C441C08F111000C1796 /* BTCBigNumberTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCBigNumberTests.swift; sourceTree = ""; }; + 758DDAFD1BD2D83600AEDFFB /* BTCMnemonicTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCMnemonicTests.swift; sourceTree = ""; }; + 75A06D9F1B17B7FE00ED7E79 /* BTCKeyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCKeyTests.swift; sourceTree = ""; }; + 75A1A3711B0E7DB900EA8D45 /* BTCBlindSignatureTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCBlindSignatureTests.swift; sourceTree = ""; }; + 75AF30341C152B1D002187AF /* BTCProtocolSerializationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCProtocolSerializationTests.swift; sourceTree = ""; }; + 75AF30361C152EE3002187AF /* BTCEncryptedMessageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCEncryptedMessageTests.swift; sourceTree = ""; }; + 75AF303A1C153009002187AF /* BTCMerkleTreeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCMerkleTreeTests.swift; sourceTree = ""; }; + 75B819051B04E65A0055F8B1 /* BTCAddressTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCAddressTests.swift; sourceTree = ""; }; + 75B819071B04E68B0055F8B1 /* BTCBlockchainInfoTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCBlockchainInfoTests.swift; sourceTree = ""; }; + 75B819091B04E69A0055F8B1 /* BTCPriceSourceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCPriceSourceTests.swift; sourceTree = ""; }; + 75BBC6E41B0E721700A61690 /* BTCCurvePointTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCCurvePointTests.swift; sourceTree = ""; }; + 75BCBB651C08FADD00D5876A /* BTCBase58Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCBase58Tests.swift; sourceTree = ""; }; + 75BD89A31B46269E0073A611 /* BTCDataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCDataTests.swift; sourceTree = ""; }; + 75E565AD1B7927C800CCCFA5 /* BTCTransactionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCTransactionTests.swift; sourceTree = ""; }; + 75EB9FF01B39C61500C26E70 /* BTC256Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTC256Tests.swift; sourceTree = ""; }; + 75FB13E51B449661006D8935 /* BTCFancyEncryptedMessageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BTCFancyEncryptedMessageTests.swift; sourceTree = ""; }; C9C3C16F195B535500D9F6FB /* BTCChainCom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTCChainCom.h; sourceTree = ""; }; C9C3C170195B535500D9F6FB /* BTCChainCom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTCChainCom.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -570,6 +782,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 209F27C11AE538F80092A1FB /* Security.framework in Frameworks */, 20C0DDB8183BC5EA00A9EED0 /* libcrypto-osx.a in Frameworks */, 20C0DDB9183BC5EA00A9EED0 /* libssl-osx.a in Frameworks */, ); @@ -587,6 +800,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 757B24121B03F1BF0084A9DE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 757B241B1B03F1BF0084A9DE /* CoreBitcoinOSX.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -650,6 +871,209 @@ name = "Supporting Files"; sourceTree = ""; }; + 205D8B8D1B16017700F9EA4E /* Crypto */ = { + isa = PBXGroup; + children = ( + 20584B1B18CD0DA000FDD410 /* BTC256.h */, + 20584B1C18CD0DA000FDD410 /* BTC256.m */, + 20D008C018D1AFA800079B79 /* BTC256+Tests.h */, + 20D008C118D1AFA800079B79 /* BTC256+Tests.m */, + 2084DD6F17B8FF76005AC9E6 /* BTCBigNumber.h */, + 2084DD7017B8FF76005AC9E6 /* BTCBigNumber.m */, + 2084DD7117B8FF76005AC9E6 /* BTCBigNumber+Tests.h */, + 2084DD7217B8FF76005AC9E6 /* BTCBigNumber+Tests.m */, + 20CD68D8189B18820083E1A9 /* BTCCurvePoint.h */, + 20CD68D9189B18820083E1A9 /* BTCCurvePoint.m */, + 20B8AB90189E7E0100008138 /* BTCCurvePoint+Tests.h */, + 20B8AB91189E7E0100008138 /* BTCCurvePoint+Tests.m */, + 2084DD7317B8FF76005AC9E6 /* BTCKey.h */, + 2084DD7417B8FF76005AC9E6 /* BTCKey.m */, + 2057A9CB17CD555F00353D54 /* BTCKey+Tests.h */, + 2057A9CC17CD555F00353D54 /* BTCKey+Tests.m */, + 20B8AB93189EE88300008138 /* BTCKeychain.h */, + 20B8AB94189EE88300008138 /* BTCKeychain.m */, + 20B8AB9D189F0CEF00008138 /* BTCKeychain+Tests.h */, + 20B8AB9E189F0CEF00008138 /* BTCKeychain+Tests.m */, + 20C2D7F819E2B2920022CAAC /* BTCMnemonic.h */, + 20C2D7F919E2B2920022CAAC /* BTCMnemonic.m */, + 20C2D80219E2F2280022CAAC /* BTCMnemonic+Tests.h */, + 20C2D80319E2F2280022CAAC /* BTCMnemonic+Tests.m */, + 200459E71C0720FC00BC9EE8 /* BTCSecretSharing.h */, + 200459E81C0720FC00BC9EE8 /* BTCSecretSharing.m */, + ); + name = Crypto; + sourceTree = ""; + }; + 205D8B8E1B16018900F9EA4E /* Payment Protocols */ = { + isa = PBXGroup; + children = ( + 2084DD6917B8FF76005AC9E6 /* BTCAddress.h */, + 2084DD6A17B8FF76005AC9E6 /* BTCAddress.m */, + 205D8BAA1B1621DB00F9EA4E /* BTCAddressSubclass.h */, + 2084DD6B17B8FF76005AC9E6 /* BTCAddress+Tests.h */, + 2084DD6C17B8FF76005AC9E6 /* BTCAddress+Tests.m */, + 207646EE1A0A8AE4000F00F2 /* BTCBitcoinURL.h */, + 207646EF1A0A8AE4000F00F2 /* BTCBitcoinURL.m */, + 2091948B1ACD318C00E67CB5 /* BTCBitcoinURL+Tests.h */, + 2091948C1ACD318C00E67CB5 /* BTCBitcoinURL+Tests.m */, + 20A443B11AC55F52008B3447 /* BTCPaymentProtocol.h */, + 20A443B21AC55F52008B3447 /* BTCPaymentProtocol.m */, + 205D8BAE1B171D0900F9EA4E /* BTCPaymentRequest.h */, + 205D8BAF1B171D0900F9EA4E /* BTCPaymentRequest.m */, + 205D8BD61B176DF300F9EA4E /* Payment Methods */, + ); + name = "Payment Protocols"; + sourceTree = ""; + }; + 205D8B8F1B1601AA00F9EA4E /* Open Assets */ = { + isa = PBXGroup; + children = ( + 205D8B961B160BFB00F9EA4E /* BTCAssetType.h */, + 205D8B971B160BFB00F9EA4E /* BTCAssetType.m */, + 205D8BA01B16182500F9EA4E /* BTCAssetID.h */, + 205D8BA11B16182500F9EA4E /* BTCAssetID.m */, + 20C7D14A1B0CBBC900F71493 /* BTCAssetAddress.h */, + 20C7D14B1B0CBBC900F71493 /* BTCAssetAddress.m */, + ); + name = "Open Assets"; + sourceTree = ""; + }; + 205D8B901B16021200F9EA4E /* Data Encoding */ = { + isa = PBXGroup; + children = ( + 2084DD8417B8FF76005AC9E6 /* BTCData.h */, + 2084DD8517B8FF76005AC9E6 /* BTCData.m */, + 2061D1D41A2CA771004F1E40 /* BTCHashID.h */, + 2061D1D51A2CA771004F1E40 /* BTCHashID.m */, + 20E1E01017C73181003B6987 /* NSData+BTCData.h */, + 20E1E01117C73181003B6987 /* NSData+BTCData.m */, + 2084DD8217B8FF76005AC9E6 /* BTCData+Tests.h */, + 2084DD8317B8FF76005AC9E6 /* BTCData+Tests.m */, + 2084DD6D17B8FF76005AC9E6 /* BTCBase58.h */, + 2084DD6E17B8FF76005AC9E6 /* BTCBase58.m */, + 20E1E01317C735EE003B6987 /* NS+BTCBase58.h */, + 20E1E01417C735EE003B6987 /* NS+BTCBase58.m */, + 2037AB1617D3D1F900DB248C /* BTCBase58+Tests.h */, + 2037AB1717D3D1F900DB248C /* BTCBase58+Tests.m */, + 2084DD7517B8FF76005AC9E6 /* BTCProtocolSerialization.h */, + 2084DD7617B8FF76005AC9E6 /* BTCProtocolSerialization.m */, + 2084DD7717B8FF76005AC9E6 /* BTCProtocolSerialization+Tests.h */, + 2084DD7817B8FF76005AC9E6 /* BTCProtocolSerialization+Tests.m */, + 20A443B31AC55F52008B3447 /* BTCProtocolBuffers.h */, + 20A443B41AC55F52008B3447 /* BTCProtocolBuffers.m */, + 2076470C1A0A8D16000F00F2 /* BTCQRCode.h */, + 2076470D1A0A8D16000F00F2 /* BTCQRCode.m */, + ); + name = "Data Encoding"; + sourceTree = ""; + }; + 205D8B911B16026B00F9EA4E /* Crypto Protocols */ = { + isa = PBXGroup; + children = ( + 208E30341AC012CE0020F830 /* BTCEncryptedBackup.h */, + 208E30351AC012CE0020F830 /* BTCEncryptedBackup.m */, + 20A443D31AC954C1008B3447 /* BTCEncryptedBackup+Tests.h */, + 20A443D41AC954C1008B3447 /* BTCEncryptedBackup+Tests.m */, + 20A443C51AC82594008B3447 /* BTCEncryptedMessage.h */, + 20A443C61AC82594008B3447 /* BTCEncryptedMessage.m */, + 20A443CF1AC825DA008B3447 /* BTCEncryptedMessage+Tests.h */, + 20A443D01AC825DA008B3447 /* BTCEncryptedMessage+Tests.m */, + 204FB500194C63B500C131DE /* BTCBlindSignature.h */, + 204FB501194C63B500C131DE /* BTCBlindSignature.m */, + 208642B9194C9EAF003A3A2C /* BTCBlindSignature+Tests.h */, + 208642BA194C9EAF003A3A2C /* BTCBlindSignature+Tests.m */, + 2054DC731950E35E007175C8 /* BTCFancyEncryptedMessage.h */, + 2054DC741950E35E007175C8 /* BTCFancyEncryptedMessage.m */, + 20C486081955A88B0061DF75 /* BTCFancyEncryptedMessage+Tests.h */, + 20C486091955A88B0061DF75 /* BTCFancyEncryptedMessage+Tests.m */, + ); + name = "Crypto Protocols"; + sourceTree = ""; + }; + 205D8B921B1602B200F9EA4E /* Core Data Structures */ = { + isa = PBXGroup; + children = ( + 2084DD8117B8FF76005AC9E6 /* BTCUnitsAndLimits.h */, + 20D09C4F18BC012700794209 /* BTCBlockHeader.h */, + 20D09C5018BC012700794209 /* BTCBlockHeader.m */, + 20D09C5918BC016B00794209 /* BTCBlock.h */, + 20D09C5A18BC016B00794209 /* BTCBlock.m */, + 2060A27E1AAA077A004531FD /* BTCMerkleTree.h */, + 2060A27F1AAA077A004531FD /* BTCMerkleTree.m */, + 2060A2881AAA09A3004531FD /* BTCMerkleTree+Tests.h */, + 2060A2891AAA09A3004531FD /* BTCMerkleTree+Tests.m */, + 20B9646D17BADE8F008161BB /* BTCOpcode.h */, + 20B9646E17BADECE008161BB /* BTCOpcode.m */, + 207B2602188C440600916AE6 /* BTCSignatureHashType.h */, + 2084DD7917B8FF76005AC9E6 /* BTCScript.h */, + 2084DD7A17B8FF76005AC9E6 /* BTCScript.m */, + 2037AB1317D3BFF900DB248C /* BTCScript+Tests.h */, + 2037AB1417D3BFF900DB248C /* BTCScript+Tests.m */, + 20B9646A17BACFAA008161BB /* BTCScriptMachine.h */, + 20B9646B17BACFAA008161BB /* BTCScriptMachine.m */, + 2084DD7B17B8FF76005AC9E6 /* BTCTransaction.h */, + 2084DD7C17B8FF76005AC9E6 /* BTCTransaction.m */, + 20B5A63E18924F350035582D /* BTCTransaction+Tests.h */, + 20B5A63F18924F350035582D /* BTCTransaction+Tests.m */, + 2084DD7D17B8FF76005AC9E6 /* BTCTransactionInput.h */, + 2084DD7E17B8FF76005AC9E6 /* BTCTransactionInput.m */, + 2084DD7F17B8FF76005AC9E6 /* BTCTransactionOutput.h */, + 2084DD8017B8FF76005AC9E6 /* BTCTransactionOutput.m */, + 200AAE3D19FA3EFA0004F908 /* BTCOutpoint.h */, + 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */, + 207646E41A0A8A37000F00F2 /* BTCTransactionBuilder.h */, + 207646E51A0A8A37000F00F2 /* BTCTransactionBuilder.m */, + 209D1E1018D48EA200293483 /* BTCNetwork.h */, + 209D1E1118D48EA200293483 /* BTCNetwork.m */, + 209D1E1A18D4F12500293483 /* BTCProcessor.h */, + 209D1E1B18D4F12500293483 /* BTCProcessor.m */, + ); + name = "Core Data Structures"; + sourceTree = ""; + }; + 205D8B931B1602E200F9EA4E /* Currencies */ = { + isa = PBXGroup; + children = ( + 207647021A0A8C15000F00F2 /* BTCCurrencyConverter.h */, + 207647031A0A8C15000F00F2 /* BTCCurrencyConverter.m */, + 02DDB9B31AF7D69600687183 /* BTCCurrencyConverter+Tests.h */, + 02DDB9B41AF7D70F00687183 /* BTCCurrencyConverter+Tests.m */, + 207646F81A0A8BB3000F00F2 /* BTCNumberFormatter.h */, + 207646F91A0A8BB3000F00F2 /* BTCNumberFormatter.m */, + 207C1E7E1A5D18A10005A341 /* BTCPriceSource.h */, + 207C1E7F1A5D18A10005A341 /* BTCPriceSource.m */, + 200756D81A5D6A44009A24A9 /* BTCPriceSource+Tests.h */, + 200756D91A5D6A44009A24A9 /* BTCPriceSource+Tests.m */, + ); + name = Currencies; + sourceTree = ""; + }; + 205D8B941B16031F00F9EA4E /* Third Party Sources */ = { + isa = PBXGroup; + children = ( + 207B2603188DC47800916AE6 /* BTCBlockchainInfo.h */, + 207B2604188DC47800916AE6 /* BTCBlockchainInfo.m */, + 20E154D8195D0D7200DA40D3 /* BTCBlockchainInfo+Tests.h */, + 20E154D9195D0DB400DA40D3 /* BTCBlockchainInfo+Tests.m */, + C9C3C16F195B535500D9F6FB /* BTCChainCom.h */, + C9C3C170195B535500D9F6FB /* BTCChainCom.m */, + ); + name = "Third Party Sources"; + sourceTree = ""; + }; + 205D8BD61B176DF300F9EA4E /* Payment Methods */ = { + isa = PBXGroup; + children = ( + 205D8BC21B172D8100F9EA4E /* BTCPaymentMethodRequest.h */, + 205D8BC31B172D8100F9EA4E /* BTCPaymentMethodRequest.m */, + 205D8BCC1B176DC000F9EA4E /* BTCPaymentMethodDetails.h */, + 205D8BCD1B176DC000F9EA4E /* BTCPaymentMethodDetails.m */, + 20FFD7F21B1E3EB300CCA48D /* BTCPaymentMethod.h */, + 20FFD7F31B1E3EB300CCA48D /* BTCPaymentMethod.m */, + ); + name = "Payment Methods"; + sourceTree = ""; + }; 206B011A183547C200878B8D /* CoreBitcoinOSX */ = { isa = PBXGroup; children = ( @@ -715,7 +1139,7 @@ isa = PBXGroup; children = ( 2084DD9417B8FF7E005AC9E6 /* README.md */, - 204F8A801845FAF8002649CE /* TODO.txt */, + 20A443D21AC941F7008B3447 /* ReleaseNotes.md */, 2039DB0117E2ED2B0051177B /* GLOSSARY.md */, 20203ADD19F66B6E0085C01F /* MEME_GLOSSARY.md */, 209818911839688D00541747 /* LICENSE.txt */, @@ -729,6 +1153,7 @@ 20148AE118355D7200E68E9C /* CoreBitcoinIOSlib */, 20148C051835638200E68E9C /* CoreBitcoinIOS */, 20148C9D183643AB00E68E9C /* CoreBitcoinOSXlib */, + 757B24161B03F1BF0084A9DE /* CoreBitcoinTestsOSX */, 20D2802417B8FE00004A462B /* Frameworks */, 20D2802317B8FE00004A462B /* Products */, ); @@ -742,6 +1167,7 @@ 20148ADF18355D7200E68E9C /* libCoreBitcoinIOS.a */, 20148C031835638200E68E9C /* CoreBitcoinIOS.framework */, 20148C9B183643AB00E68E9C /* libCoreBitcoinOSX.a */, + 757B24151B03F1BF0084A9DE /* CoreBitcoinTestsOSX.xctest */, ); name = Products; sourceTree = ""; @@ -767,114 +1193,62 @@ children = ( 20D09B9F18BA14F900794209 /* CoreBitcoin.h */, 20D09BA018BA14F900794209 /* CoreBitcoin+Categories.h */, - 2084DD8117B8FF76005AC9E6 /* BTCUnitsAndLimits.h */, - 2084DD8417B8FF76005AC9E6 /* BTCData.h */, - 2084DD8517B8FF76005AC9E6 /* BTCData.m */, - 2061D1D41A2CA771004F1E40 /* BTCHashID.h */, - 2061D1D51A2CA771004F1E40 /* BTCHashID.m */, - 20E1E01017C73181003B6987 /* NSData+BTCData.h */, - 20E1E01117C73181003B6987 /* NSData+BTCData.m */, - 2084DD8217B8FF76005AC9E6 /* BTCData+Tests.h */, - 2084DD8317B8FF76005AC9E6 /* BTCData+Tests.m */, - 20584B1B18CD0DA000FDD410 /* BTC256.h */, - 20584B1C18CD0DA000FDD410 /* BTC256.m */, - 20D008C018D1AFA800079B79 /* BTC256+Tests.h */, - 20D008C118D1AFA800079B79 /* BTC256+Tests.m */, + 757B24211B03F1E80084A9DE /* SwiftBridgingHeader.h */, 20B66C8517BFE4F9007128CE /* BTCErrors.h */, 20B66C8617BFE4F9007128CE /* BTCErrors.m */, - 2084DD6917B8FF76005AC9E6 /* BTCAddress.h */, - 2084DD6A17B8FF76005AC9E6 /* BTCAddress.m */, - 2084DD6B17B8FF76005AC9E6 /* BTCAddress+Tests.h */, - 2084DD6C17B8FF76005AC9E6 /* BTCAddress+Tests.m */, - 2084DD6D17B8FF76005AC9E6 /* BTCBase58.h */, - 2084DD6E17B8FF76005AC9E6 /* BTCBase58.m */, - 2037AB1617D3D1F900DB248C /* BTCBase58+Tests.h */, - 2037AB1717D3D1F900DB248C /* BTCBase58+Tests.m */, - 20E1E01317C735EE003B6987 /* NS+BTCBase58.h */, - 20E1E01417C735EE003B6987 /* NS+BTCBase58.m */, - 2084DD6F17B8FF76005AC9E6 /* BTCBigNumber.h */, - 2084DD7017B8FF76005AC9E6 /* BTCBigNumber.m */, - 2084DD7117B8FF76005AC9E6 /* BTCBigNumber+Tests.h */, - 2084DD7217B8FF76005AC9E6 /* BTCBigNumber+Tests.m */, - 20CD68D8189B18820083E1A9 /* BTCCurvePoint.h */, - 20CD68D9189B18820083E1A9 /* BTCCurvePoint.m */, - 20B8AB90189E7E0100008138 /* BTCCurvePoint+Tests.h */, - 20B8AB91189E7E0100008138 /* BTCCurvePoint+Tests.m */, - 2084DD7317B8FF76005AC9E6 /* BTCKey.h */, - 2084DD7417B8FF76005AC9E6 /* BTCKey.m */, - 2057A9CB17CD555F00353D54 /* BTCKey+Tests.h */, - 2057A9CC17CD555F00353D54 /* BTCKey+Tests.m */, - 20B8AB93189EE88300008138 /* BTCKeychain.h */, - 20B8AB94189EE88300008138 /* BTCKeychain.m */, - 20B8AB9D189F0CEF00008138 /* BTCKeychain+Tests.h */, - 20B8AB9E189F0CEF00008138 /* BTCKeychain+Tests.m */, - 20C2D7F819E2B2920022CAAC /* BTCMnemonic.h */, - 20C2D7F919E2B2920022CAAC /* BTCMnemonic.m */, - 20C2D80219E2F2280022CAAC /* BTCMnemonic+Tests.h */, - 20C2D80319E2F2280022CAAC /* BTCMnemonic+Tests.m */, - 204FB500194C63B500C131DE /* BTCBlindSignature.h */, - 204FB501194C63B500C131DE /* BTCBlindSignature.m */, - 208642B9194C9EAF003A3A2C /* BTCBlindSignature+Tests.h */, - 208642BA194C9EAF003A3A2C /* BTCBlindSignature+Tests.m */, - 2054DC731950E35E007175C8 /* BTCEncryptedMessage.h */, - 2054DC741950E35E007175C8 /* BTCEncryptedMessage.m */, - 20C486081955A88B0061DF75 /* BTCEncryptedMessage+Tests.h */, - 20C486091955A88B0061DF75 /* BTCEncryptedMessage+Tests.m */, - 2084DD7517B8FF76005AC9E6 /* BTCProtocolSerialization.h */, - 2084DD7617B8FF76005AC9E6 /* BTCProtocolSerialization.m */, - 2084DD7717B8FF76005AC9E6 /* BTCProtocolSerialization+Tests.h */, - 2084DD7817B8FF76005AC9E6 /* BTCProtocolSerialization+Tests.m */, - 20D09C4F18BC012700794209 /* BTCBlockHeader.h */, - 20D09C5018BC012700794209 /* BTCBlockHeader.m */, - 20D09C5918BC016B00794209 /* BTCBlock.h */, - 20D09C5A18BC016B00794209 /* BTCBlock.m */, - 20B9646D17BADE8F008161BB /* BTCOpcode.h */, - 20B9646E17BADECE008161BB /* BTCOpcode.m */, - 207B2602188C440600916AE6 /* BTCSignatureHashType.h */, - 2084DD7917B8FF76005AC9E6 /* BTCScript.h */, - 2084DD7A17B8FF76005AC9E6 /* BTCScript.m */, - 2037AB1317D3BFF900DB248C /* BTCScript+Tests.h */, - 2037AB1417D3BFF900DB248C /* BTCScript+Tests.m */, - 20B9646A17BACFAA008161BB /* BTCScriptMachine.h */, - 20B9646B17BACFAA008161BB /* BTCScriptMachine.m */, - 2084DD7B17B8FF76005AC9E6 /* BTCTransaction.h */, - 2084DD7C17B8FF76005AC9E6 /* BTCTransaction.m */, - 20B5A63E18924F350035582D /* BTCTransaction+Tests.h */, - 20B5A63F18924F350035582D /* BTCTransaction+Tests.m */, - 2084DD7D17B8FF76005AC9E6 /* BTCTransactionInput.h */, - 2084DD7E17B8FF76005AC9E6 /* BTCTransactionInput.m */, - 2084DD7F17B8FF76005AC9E6 /* BTCTransactionOutput.h */, - 2084DD8017B8FF76005AC9E6 /* BTCTransactionOutput.m */, - 200AAE3D19FA3EFA0004F908 /* BTCOutpoint.h */, - 200AAE3E19FA3EFA0004F908 /* BTCOutpoint.m */, - 207646E41A0A8A37000F00F2 /* BTCTransactionBuilder.h */, - 207646E51A0A8A37000F00F2 /* BTCTransactionBuilder.m */, - 209D1E1018D48EA200293483 /* BTCNetwork.h */, - 209D1E1118D48EA200293483 /* BTCNetwork.m */, - 209D1E1A18D4F12500293483 /* BTCProcessor.h */, - 209D1E1B18D4F12500293483 /* BTCProcessor.m */, - 207646EE1A0A8AE4000F00F2 /* BTCBitcoinURL.h */, - 207646EF1A0A8AE4000F00F2 /* BTCBitcoinURL.m */, - 207647021A0A8C15000F00F2 /* BTCCurrencyConverter.h */, - 207647031A0A8C15000F00F2 /* BTCCurrencyConverter.m */, - 207646F81A0A8BB3000F00F2 /* BTCNumberFormatter.h */, - 207646F91A0A8BB3000F00F2 /* BTCNumberFormatter.m */, - 2076470C1A0A8D16000F00F2 /* BTCQRCode.h */, - 2076470D1A0A8D16000F00F2 /* BTCQRCode.m */, - 207B2603188DC47800916AE6 /* BTCBlockchainInfo.h */, - 207B2604188DC47800916AE6 /* BTCBlockchainInfo.m */, - 20E154D8195D0D7200DA40D3 /* BTCBlockchainInfo+Tests.h */, - 20E154D9195D0DB400DA40D3 /* BTCBlockchainInfo+Tests.m */, - C9C3C16F195B535500D9F6FB /* BTCChainCom.h */, - C9C3C170195B535500D9F6FB /* BTCChainCom.m */, - 207C1E7E1A5D18A10005A341 /* BTCPriceSource.h */, - 207C1E7F1A5D18A10005A341 /* BTCPriceSource.m */, - 200756D81A5D6A44009A24A9 /* BTCPriceSource+Tests.h */, - 200756D91A5D6A44009A24A9 /* BTCPriceSource+Tests.m */, + 205D8B901B16021200F9EA4E /* Data Encoding */, + 205D8B8D1B16017700F9EA4E /* Crypto */, + 205D8B921B1602B200F9EA4E /* Core Data Structures */, + 205D8B8E1B16018900F9EA4E /* Payment Protocols */, + 205D8B8F1B1601AA00F9EA4E /* Open Assets */, + 205D8B911B16026B00F9EA4E /* Crypto Protocols */, + 205D8B931B1602E200F9EA4E /* Currencies */, + 205D8B941B16031F00F9EA4E /* Third Party Sources */, ); path = CoreBitcoin; sourceTree = ""; }; + 757B24161B03F1BF0084A9DE /* CoreBitcoinTestsOSX */ = { + isa = PBXGroup; + children = ( + 75AF303A1C153009002187AF /* BTCMerkleTreeTests.swift */, + 75AF30361C152EE3002187AF /* BTCEncryptedMessageTests.swift */, + 75AF30341C152B1D002187AF /* BTCProtocolSerializationTests.swift */, + 758A16C71B69BAF30075C64A /* BTCScriptTestData.h */, + 200FA8DB1C0CF8400039029D /* TestsSwiftBridgingHeader.h */, + 75BCBB651C08FADD00D5876A /* BTCBase58Tests.swift */, + 758C8C441C08F111000C1796 /* BTCBigNumberTests.swift */, + 758DDAFD1BD2D83600AEDFFB /* BTCMnemonicTests.swift */, + 75E565AD1B7927C800CCCFA5 /* BTCTransactionTests.swift */, + 752834A81B699BEC00CD92E3 /* BTCScriptTests.swift */, + 753118251B6042A400A102E2 /* BTCKeychainTests.swift */, + 75BD89A31B46269E0073A611 /* BTCDataTests.swift */, + 75FB13E51B449661006D8935 /* BTCFancyEncryptedMessageTests.swift */, + 75EB9FF01B39C61500C26E70 /* BTC256Tests.swift */, + 75A06D9F1B17B7FE00ED7E79 /* BTCKeyTests.swift */, + 7558460D1B14E4B100E49C87 /* BTCEncryptedBackupTests.swift */, + 75A1A3711B0E7DB900EA8D45 /* BTCBlindSignatureTests.swift */, + 75BBC6E41B0E721700A61690 /* BTCCurvePointTests.swift */, + 7549DAD01B0BB1D900F20FF0 /* BTCCurrencyConverterTests.swift */, + 754564751B07F9AB008F34DC /* BTCBitcoinURLTests.swift */, + 75B819091B04E69A0055F8B1 /* BTCPriceSourceTests.swift */, + 75B819071B04E68B0055F8B1 /* BTCBlockchainInfoTests.swift */, + 75B819051B04E65A0055F8B1 /* BTCAddressTests.swift */, + 20FFD7FF1B1F85F300CCA48D /* BTCPaymentProtocolTests.swift */, + 200FA8D91C07A8B80039029D /* BTCSecretSharingTests.swift */, + 757B24171B03F1BF0084A9DE /* Supporting Files */, + ); + path = CoreBitcoinTestsOSX; + sourceTree = ""; + }; + 757B24171B03F1BF0084A9DE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 757B24181B03F1BF0084A9DE /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -886,9 +1260,11 @@ 20148C2A1835650B00E68E9C /* BTCUnitsAndLimits.h in Headers */, 204FB503194C63B500C131DE /* BTCBlindSignature.h in Headers */, 209D1E1D18D4F12500293483 /* BTCProcessor.h in Headers */, + 205D8BB11B171D0900F9EA4E /* BTCPaymentRequest.h in Headers */, 20148C2B1835650B00E68E9C /* BTCData.h in Headers */, 2061D1D71A2CA771004F1E40 /* BTCHashID.h in Headers */, 20148C2C1835650B00E68E9C /* BTCData+Tests.h in Headers */, + 208E30371AC012CE0020F830 /* BTCEncryptedBackup.h in Headers */, 207C1E811A5D18A10005A341 /* BTCPriceSource.h in Headers */, 20CD68DB189B18820083E1A9 /* BTCCurvePoint.h in Headers */, 20584B1E18CD0DA000FDD410 /* BTC256.h in Headers */, @@ -896,28 +1272,36 @@ 20C2D80519E2F2280022CAAC /* BTCMnemonic+Tests.h in Headers */, 20D09C5C18BC016C00794209 /* BTCBlock.h in Headers */, 20D09BA218BA14F900794209 /* CoreBitcoin.h in Headers */, + 205D8BA31B16182500F9EA4E /* BTCAssetID.h in Headers */, 20148C2D1835650B00E68E9C /* NSData+BTCData.h in Headers */, 20C2D7FB19E2B2920022CAAC /* BTCMnemonic.h in Headers */, 20D09C5218BC012700794209 /* BTCBlockHeader.h in Headers */, 20148C2E1835650B00E68E9C /* BTCErrors.h in Headers */, + 20A443C81AC82594008B3447 /* BTCEncryptedMessage.h in Headers */, 207646FB1A0A8BB3000F00F2 /* BTCNumberFormatter.h in Headers */, 20148C2F1835650B00E68E9C /* BTCAddress.h in Headers */, + 20FFD7F51B1E3EB300CCA48D /* BTCPaymentMethod.h in Headers */, 20148C301835650B00E68E9C /* BTCAddress+Tests.h in Headers */, + 20C7D14D1B0CBBC900F71493 /* BTCAssetAddress.h in Headers */, 20148C311835650B00E68E9C /* BTCBase58.h in Headers */, 20148C321835650B00E68E9C /* BTCBase58+Tests.h in Headers */, 207646E71A0A8A37000F00F2 /* BTCTransactionBuilder.h in Headers */, 20148C331835650B00E68E9C /* NS+BTCBase58.h in Headers */, - 2054DC761950E35E007175C8 /* BTCEncryptedMessage.h in Headers */, + 2054DC761950E35E007175C8 /* BTCFancyEncryptedMessage.h in Headers */, 20148C341835650B00E68E9C /* BTCBigNumber.h in Headers */, + 200459EA1C0720FC00BC9EE8 /* BTCSecretSharing.h in Headers */, + 205D8BC51B172D8100F9EA4E /* BTCPaymentMethodRequest.h in Headers */, 207B2606188DC47800916AE6 /* BTCBlockchainInfo.h in Headers */, 20D09BA518BA14F900794209 /* CoreBitcoin+Categories.h in Headers */, 207646F11A0A8AE4000F00F2 /* BTCBitcoinURL.h in Headers */, + 2060A2811AAA077A004531FD /* BTCMerkleTree.h in Headers */, 20D09BC018BA2FEB00794209 /* BTCSignatureHashType.h in Headers */, 20B8AB96189EE88300008138 /* BTCKeychain.h in Headers */, 20148C351835650B00E68E9C /* BTCBigNumber+Tests.h in Headers */, 20148C361835650B00E68E9C /* BTCKey.h in Headers */, 20148C371835650B00E68E9C /* BTCKey+Tests.h in Headers */, 20148C381835650B00E68E9C /* BTCProtocolSerialization.h in Headers */, + 205D8BAC1B1621DB00F9EA4E /* BTCAddressSubclass.h in Headers */, 20148C391835650B00E68E9C /* BTCProtocolSerialization+Tests.h in Headers */, 20148C3A1835650B00E68E9C /* BTCOpcode.h in Headers */, 20148C3B1835650B00E68E9C /* BTCScript.h in Headers */, @@ -925,10 +1309,14 @@ 20148C3D1835650B00E68E9C /* BTCScriptMachine.h in Headers */, 20148C3E1835650B00E68E9C /* BTCTransaction.h in Headers */, 20148C3F1835650B00E68E9C /* BTCTransactionInput.h in Headers */, + 205D8B991B160BFB00F9EA4E /* BTCAssetType.h in Headers */, + 205D8BCF1B176DC000F9EA4E /* BTCPaymentMethodDetails.h in Headers */, + 20A443B61AC55F52008B3447 /* BTCPaymentProtocol.h in Headers */, 20148C401835650B00E68E9C /* BTCTransactionOutput.h in Headers */, C9C3C172195B535500D9F6FB /* BTCChainCom.h in Headers */, 2076470F1A0A8D16000F00F2 /* BTCQRCode.h in Headers */, 20148C411835651C00E68E9C /* openssl in Headers */, + 20A443BE1AC55F52008B3447 /* BTCProtocolBuffers.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -940,9 +1328,11 @@ 20148CD4183643FC00E68E9C /* BTCUnitsAndLimits.h in Headers */, 204FB504194C63B500C131DE /* BTCBlindSignature.h in Headers */, 209D1E1E18D4F12500293483 /* BTCProcessor.h in Headers */, + 205D8BB21B171D0900F9EA4E /* BTCPaymentRequest.h in Headers */, 20148CD5183643FC00E68E9C /* BTCData.h in Headers */, 2061D1D81A2CA771004F1E40 /* BTCHashID.h in Headers */, 20148CD6183643FC00E68E9C /* BTCData+Tests.h in Headers */, + 208E30381AC012CE0020F830 /* BTCEncryptedBackup.h in Headers */, 207C1E821A5D18A10005A341 /* BTCPriceSource.h in Headers */, 20CD68DC189B18820083E1A9 /* BTCCurvePoint.h in Headers */, 20584B1F18CD0DA000FDD410 /* BTC256.h in Headers */, @@ -950,28 +1340,36 @@ 20C2D80619E2F2280022CAAC /* BTCMnemonic+Tests.h in Headers */, 20D09C5D18BC016C00794209 /* BTCBlock.h in Headers */, 20D09BA318BA14F900794209 /* CoreBitcoin.h in Headers */, + 205D8BA41B16182500F9EA4E /* BTCAssetID.h in Headers */, 20148CD7183643FC00E68E9C /* NSData+BTCData.h in Headers */, 20C2D7FC19E2B2920022CAAC /* BTCMnemonic.h in Headers */, 20D09C5318BC012700794209 /* BTCBlockHeader.h in Headers */, 20148CD8183643FC00E68E9C /* BTCErrors.h in Headers */, + 20A443C91AC82594008B3447 /* BTCEncryptedMessage.h in Headers */, 207646FC1A0A8BB3000F00F2 /* BTCNumberFormatter.h in Headers */, 20148CD9183643FC00E68E9C /* BTCAddress.h in Headers */, + 20FFD7F61B1E3EB300CCA48D /* BTCPaymentMethod.h in Headers */, 20148CDA183643FC00E68E9C /* BTCAddress+Tests.h in Headers */, + 20C7D14E1B0CBBC900F71493 /* BTCAssetAddress.h in Headers */, 20148CDB183643FC00E68E9C /* BTCBase58.h in Headers */, 20148CDC183643FC00E68E9C /* BTCBase58+Tests.h in Headers */, 207646E81A0A8A37000F00F2 /* BTCTransactionBuilder.h in Headers */, 20148CDD183643FC00E68E9C /* NS+BTCBase58.h in Headers */, - 2054DC771950E35E007175C8 /* BTCEncryptedMessage.h in Headers */, + 2054DC771950E35E007175C8 /* BTCFancyEncryptedMessage.h in Headers */, 20148CDE183643FC00E68E9C /* BTCBigNumber.h in Headers */, + 200459EB1C0720FC00BC9EE8 /* BTCSecretSharing.h in Headers */, + 205D8BC61B172D8100F9EA4E /* BTCPaymentMethodRequest.h in Headers */, 207B2607188DC47800916AE6 /* BTCBlockchainInfo.h in Headers */, 20D09BA618BA14F900794209 /* CoreBitcoin+Categories.h in Headers */, 207646F21A0A8AE4000F00F2 /* BTCBitcoinURL.h in Headers */, + 2060A2821AAA077A004531FD /* BTCMerkleTree.h in Headers */, 20D09BBF18BA2FEB00794209 /* BTCSignatureHashType.h in Headers */, 20B8AB97189EE88300008138 /* BTCKeychain.h in Headers */, 20148CDF183643FC00E68E9C /* BTCBigNumber+Tests.h in Headers */, 20148CE0183643FC00E68E9C /* BTCKey.h in Headers */, 20148CE1183643FC00E68E9C /* BTCKey+Tests.h in Headers */, 20148CE2183643FC00E68E9C /* BTCProtocolSerialization.h in Headers */, + 205D8BAD1B1621DB00F9EA4E /* BTCAddressSubclass.h in Headers */, 20148CE3183643FC00E68E9C /* BTCProtocolSerialization+Tests.h in Headers */, 20148CE4183643FC00E68E9C /* BTCOpcode.h in Headers */, 20148CE5183643FC00E68E9C /* BTCScript.h in Headers */, @@ -979,10 +1377,14 @@ 20148CE7183643FC00E68E9C /* BTCScriptMachine.h in Headers */, 20148CE8183643FC00E68E9C /* BTCTransaction.h in Headers */, 20148CE9183643FC00E68E9C /* BTCTransactionInput.h in Headers */, + 205D8B9A1B160BFB00F9EA4E /* BTCAssetType.h in Headers */, + 205D8BD01B176DC000F9EA4E /* BTCPaymentMethodDetails.h in Headers */, + 20A443B71AC55F52008B3447 /* BTCPaymentProtocol.h in Headers */, 20148CEA183643FC00E68E9C /* BTCTransactionOutput.h in Headers */, C9C3C173195B535500D9F6FB /* BTCChainCom.h in Headers */, 207647101A0A8D16000F00F2 /* BTCQRCode.h in Headers */, 20148CEB1836446500E68E9C /* openssl in Headers */, + 20A443BF1AC55F52008B3447 /* BTCProtocolBuffers.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -994,9 +1396,11 @@ 206B01481835484300878B8D /* BTCBigNumber+Tests.h in Headers */, 204FB502194C63B500C131DE /* BTCBlindSignature.h in Headers */, 209D1E1C18D4F12500293483 /* BTCProcessor.h in Headers */, + 205D8BB01B171D0900F9EA4E /* BTCPaymentRequest.h in Headers */, 206B01491835484300878B8D /* BTCKey.h in Headers */, 2061D1D61A2CA771004F1E40 /* BTCHashID.h in Headers */, 206B014D1835484300878B8D /* BTCOpcode.h in Headers */, + 208E30361AC012CE0020F830 /* BTCEncryptedBackup.h in Headers */, 207C1E801A5D18A10005A341 /* BTCPriceSource.h in Headers */, 20CD68DA189B18820083E1A9 /* BTCCurvePoint.h in Headers */, 20584B1D18CD0DA000FDD410 /* BTC256.h in Headers */, @@ -1004,28 +1408,36 @@ 20C2D80419E2F2280022CAAC /* BTCMnemonic+Tests.h in Headers */, 20D09C5B18BC016C00794209 /* BTCBlock.h in Headers */, 20D09BA118BA14F900794209 /* CoreBitcoin.h in Headers */, + 205D8BA21B16182500F9EA4E /* BTCAssetID.h in Headers */, 206B01531835484300878B8D /* BTCTransactionOutput.h in Headers */, 20C2D7FA19E2B2920022CAAC /* BTCMnemonic.h in Headers */, 20D09C5118BC012700794209 /* BTCBlockHeader.h in Headers */, 206B01501835484300878B8D /* BTCScriptMachine.h in Headers */, + 20A443C71AC82594008B3447 /* BTCEncryptedMessage.h in Headers */, 207646FA1A0A8BB3000F00F2 /* BTCNumberFormatter.h in Headers */, 206B013E1835484300878B8D /* BTCData.h in Headers */, + 20FFD7F41B1E3EB300CCA48D /* BTCPaymentMethod.h in Headers */, 206B014B1835484300878B8D /* BTCProtocolSerialization.h in Headers */, + 20C7D14C1B0CBBC900F71493 /* BTCAssetAddress.h in Headers */, 206B01421835484300878B8D /* BTCAddress.h in Headers */, 206B014F1835484300878B8D /* BTCScript+Tests.h in Headers */, 207646E61A0A8A37000F00F2 /* BTCTransactionBuilder.h in Headers */, 206B01441835484300878B8D /* BTCBase58.h in Headers */, - 2054DC751950E35E007175C8 /* BTCEncryptedMessage.h in Headers */, + 2054DC751950E35E007175C8 /* BTCFancyEncryptedMessage.h in Headers */, 206B01471835484300878B8D /* BTCBigNumber.h in Headers */, + 200459E91C0720FC00BC9EE8 /* BTCSecretSharing.h in Headers */, + 205D8BC41B172D8100F9EA4E /* BTCPaymentMethodRequest.h in Headers */, 207B2605188DC47800916AE6 /* BTCBlockchainInfo.h in Headers */, 20D09BA418BA14F900794209 /* CoreBitcoin+Categories.h in Headers */, 207646F01A0A8AE4000F00F2 /* BTCBitcoinURL.h in Headers */, + 2060A2801AAA077A004531FD /* BTCMerkleTree.h in Headers */, 20D09BBE18BA2FEA00794209 /* BTCSignatureHashType.h in Headers */, 20B8AB95189EE88300008138 /* BTCKeychain.h in Headers */, 206B01451835484300878B8D /* BTCBase58+Tests.h in Headers */, 206B01511835484300878B8D /* BTCTransaction.h in Headers */, 206B014E1835484300878B8D /* BTCScript.h in Headers */, 206B013D1835484300878B8D /* BTCUnitsAndLimits.h in Headers */, + 205D8BAB1B1621DB00F9EA4E /* BTCAddressSubclass.h in Headers */, 206B01431835484300878B8D /* BTCAddress+Tests.h in Headers */, 206B014C1835484300878B8D /* BTCProtocolSerialization+Tests.h in Headers */, 206B01521835484300878B8D /* BTCTransactionInput.h in Headers */, @@ -1033,10 +1445,14 @@ 206B014A1835484300878B8D /* BTCKey+Tests.h in Headers */, 206B01411835484300878B8D /* BTCErrors.h in Headers */, 206B01401835484300878B8D /* NSData+BTCData.h in Headers */, + 205D8B981B160BFB00F9EA4E /* BTCAssetType.h in Headers */, + 205D8BCE1B176DC000F9EA4E /* BTCPaymentMethodDetails.h in Headers */, + 20A443B51AC55F52008B3447 /* BTCPaymentProtocol.h in Headers */, 206B01461835484300878B8D /* NS+BTCBase58.h in Headers */, C9C3C171195B535500D9F6FB /* BTCChainCom.h in Headers */, 2076470E1A0A8D16000F00F2 /* BTCQRCode.h in Headers */, 206B016A1835487700878B8D /* openssl in Headers */, + 20A443BD1AC55F52008B3447 /* BTCProtocolBuffers.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1130,14 +1546,39 @@ productReference = 2084DD5D17B8FF47005AC9E6 /* UnitTests */; productType = "com.apple.product-type.tool"; }; + 757B24141B03F1BF0084A9DE /* CoreBitcoinTestsOSX */ = { + isa = PBXNativeTarget; + buildConfigurationList = 757B24201B03F1BF0084A9DE /* Build configuration list for PBXNativeTarget "CoreBitcoinTestsOSX" */; + buildPhases = ( + 757B24111B03F1BF0084A9DE /* Sources */, + 757B24121B03F1BF0084A9DE /* Frameworks */, + 757B24131B03F1BF0084A9DE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 757B241D1B03F1BF0084A9DE /* PBXTargetDependency */, + ); + name = CoreBitcoinTestsOSX; + productName = CoreBitcoinTestsOSX; + productReference = 757B24151B03F1BF0084A9DE /* CoreBitcoinTestsOSX.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 20D2801A17B8FE00004A462B /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0460; ORGANIZATIONNAME = "Oleg Andreev"; + TargetAttributes = { + 757B24141B03F1BF0084A9DE = { + CreatedOnToolsVersion = 6.3.1; + }; + }; }; buildConfigurationList = 20D2801D17B8FE00004A462B /* Build configuration list for PBXProject "CoreBitcoin" */; compatibilityVersion = "Xcode 3.2"; @@ -1156,6 +1597,7 @@ 20148ADE18355D7200E68E9C /* CoreBitcoinIOSlib */, 20148C021835638200E68E9C /* CoreBitcoinIOS */, 20148C9A183643AB00E68E9C /* CoreBitcoinOSXlib */, + 757B24141B03F1BF0084A9DE /* CoreBitcoinTestsOSX */, ); }; /* End PBXProject section */ @@ -1177,6 +1619,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 757B24131B03F1BF0084A9DE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1187,38 +1636,51 @@ 20148B0518355DAD00E68E9C /* BTCData.m in Sources */, 20D09C5618BC012700794209 /* BTCBlockHeader.m in Sources */, 20C2D7FF19E2B2920022CAAC /* BTCMnemonic.m in Sources */, + 20A443CC1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */, + 2060A2851AAA077A004531FD /* BTCMerkleTree.m in Sources */, 207647091A0A8C15000F00F2 /* BTCCurrencyConverter.m in Sources */, 20148B0718355DAD00E68E9C /* NSData+BTCData.m in Sources */, 207647131A0A8D16000F00F2 /* BTCQRCode.m in Sources */, 20148B0818355DAD00E68E9C /* BTCErrors.m in Sources */, 207646FF1A0A8BB3000F00F2 /* BTCNumberFormatter.m in Sources */, 207C1E851A5D18A10005A341 /* BTCPriceSource.m in Sources */, + 205D8BC91B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */, 207646F51A0A8AE4000F00F2 /* BTCBitcoinURL.m in Sources */, 20584B2218CD0DA000FDD410 /* BTC256.m in Sources */, + 205D8BB51B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */, 20148B0918355DAD00E68E9C /* BTCAddress.m in Sources */, 20148B0B18355DAD00E68E9C /* BTCBase58.m in Sources */, 209D1E2118D4F12500293483 /* BTCProcessor.m in Sources */, 20148B0D18355DAD00E68E9C /* NS+BTCBase58.m in Sources */, + 208E303B1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */, 20148B0E18355DAD00E68E9C /* BTCBigNumber.m in Sources */, + 20C7D1511B0CBBC900F71493 /* BTCAssetAddress.m in Sources */, 204FB507194C63B500C131DE /* BTCBlindSignature.m in Sources */, 207646EB1A0A8A37000F00F2 /* BTCTransactionBuilder.m in Sources */, C9C3C176195B535500D9F6FB /* BTCChainCom.m in Sources */, 20148B1018355DAD00E68E9C /* BTCKey.m in Sources */, 209D1E1718D48EA200293483 /* BTCNetwork.m in Sources */, + 205D8B9D1B160BFB00F9EA4E /* BTCAssetType.m in Sources */, 20B8AB9A189EE88300008138 /* BTCKeychain.m in Sources */, 20148B1218355DAD00E68E9C /* BTCProtocolSerialization.m in Sources */, 20148B1418355DAD00E68E9C /* BTCOpcode.m in Sources */, - 2054DC7A1950E35E007175C8 /* BTCEncryptedMessage.m in Sources */, + 205D8BA71B16182500F9EA4E /* BTCAssetID.m in Sources */, + 2054DC7A1950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */, 20CD68DF189B18820083E1A9 /* BTCCurvePoint.m in Sources */, 20D09C6018BC016C00794209 /* BTCBlock.m in Sources */, 20148B1518355DAD00E68E9C /* BTCScript.m in Sources */, 20148B1718355DAD00E68E9C /* BTCScriptMachine.m in Sources */, + 20FFD7F91B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */, + 20A443C21AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */, 20148B1818355DAD00E68E9C /* BTCTransaction.m in Sources */, 207B260A188DC47800916AE6 /* BTCBlockchainInfo.m in Sources */, 200AAE4119FA3F010004F908 /* BTCOutpoint.m in Sources */, 20C2D80919E2F2280022CAAC /* BTCMnemonic+Tests.m in Sources */, 2061D1DB1A2CA771004F1E40 /* BTCHashID.m in Sources */, + 205D8BD31B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */, 20148B1918355DAD00E68E9C /* BTCTransactionInput.m in Sources */, + 20A443BA1AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */, + 200459ED1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */, 20148B1A18355DAD00E68E9C /* BTCTransactionOutput.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1230,38 +1692,51 @@ 20148C13183563D000E68E9C /* BTCData.m in Sources */, 20D09C5718BC012700794209 /* BTCBlockHeader.m in Sources */, 20C2D80019E2B2920022CAAC /* BTCMnemonic.m in Sources */, + 20A443CD1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */, + 2060A2861AAA077A004531FD /* BTCMerkleTree.m in Sources */, 2076470A1A0A8C15000F00F2 /* BTCCurrencyConverter.m in Sources */, 20148C15183563D000E68E9C /* NSData+BTCData.m in Sources */, 207647141A0A8D16000F00F2 /* BTCQRCode.m in Sources */, 20148C16183563D000E68E9C /* BTCErrors.m in Sources */, 207647001A0A8BB3000F00F2 /* BTCNumberFormatter.m in Sources */, 207C1E861A5D18A10005A341 /* BTCPriceSource.m in Sources */, + 205D8BCA1B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */, 207646F61A0A8AE4000F00F2 /* BTCBitcoinURL.m in Sources */, 20584B2318CD0DA000FDD410 /* BTC256.m in Sources */, + 205D8BB61B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */, 20148C17183563D000E68E9C /* BTCAddress.m in Sources */, 20148C19183563D000E68E9C /* BTCBase58.m in Sources */, 209D1E2218D4F12500293483 /* BTCProcessor.m in Sources */, 20148C1B183563D000E68E9C /* NS+BTCBase58.m in Sources */, + 208E303C1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */, 20148C1C183563D000E68E9C /* BTCBigNumber.m in Sources */, + 20C7D1521B0CBBC900F71493 /* BTCAssetAddress.m in Sources */, 204FB508194C63B500C131DE /* BTCBlindSignature.m in Sources */, 207646EC1A0A8A37000F00F2 /* BTCTransactionBuilder.m in Sources */, C9C3C177195B535500D9F6FB /* BTCChainCom.m in Sources */, 20148C1E183563D000E68E9C /* BTCKey.m in Sources */, 209D1E1818D48EA200293483 /* BTCNetwork.m in Sources */, + 205D8B9E1B160BFB00F9EA4E /* BTCAssetType.m in Sources */, 20B8AB9B189EE88300008138 /* BTCKeychain.m in Sources */, 20148C20183563D000E68E9C /* BTCProtocolSerialization.m in Sources */, 20148C22183563D000E68E9C /* BTCOpcode.m in Sources */, - 2054DC7B1950E35E007175C8 /* BTCEncryptedMessage.m in Sources */, + 205D8BA81B16182500F9EA4E /* BTCAssetID.m in Sources */, + 2054DC7B1950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */, 20CD68E0189B18820083E1A9 /* BTCCurvePoint.m in Sources */, 20D09C6118BC016C00794209 /* BTCBlock.m in Sources */, 20148C23183563D000E68E9C /* BTCScript.m in Sources */, 20148C25183563D000E68E9C /* BTCScriptMachine.m in Sources */, + 20FFD7FA1B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */, + 20A443C31AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */, 20148C26183563D000E68E9C /* BTCTransaction.m in Sources */, 207B260B188DC47800916AE6 /* BTCBlockchainInfo.m in Sources */, 200AAE4219FA3F020004F908 /* BTCOutpoint.m in Sources */, 20C2D80A19E2F2280022CAAC /* BTCMnemonic+Tests.m in Sources */, 2061D1DC1A2CA771004F1E40 /* BTCHashID.m in Sources */, + 205D8BD41B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */, 20148C27183563D000E68E9C /* BTCTransactionInput.m in Sources */, + 20A443BB1AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */, + 200459EE1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */, 20148C28183563D000E68E9C /* BTCTransactionOutput.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1273,38 +1748,51 @@ 20148CBE183643E700E68E9C /* BTCData.m in Sources */, 20D09C5818BC012700794209 /* BTCBlockHeader.m in Sources */, 20C2D80119E2B2920022CAAC /* BTCMnemonic.m in Sources */, + 20A443CE1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */, + 2060A2871AAA077A004531FD /* BTCMerkleTree.m in Sources */, 2076470B1A0A8C15000F00F2 /* BTCCurrencyConverter.m in Sources */, 20148CC0183643E700E68E9C /* NSData+BTCData.m in Sources */, 207647151A0A8D16000F00F2 /* BTCQRCode.m in Sources */, 20148CC1183643E700E68E9C /* BTCErrors.m in Sources */, 207647011A0A8BB3000F00F2 /* BTCNumberFormatter.m in Sources */, 207C1E871A5D18A10005A341 /* BTCPriceSource.m in Sources */, + 205D8BCB1B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */, 207646F71A0A8AE4000F00F2 /* BTCBitcoinURL.m in Sources */, 20584B2418CD0DA000FDD410 /* BTC256.m in Sources */, + 205D8BB71B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */, 20148CC2183643E700E68E9C /* BTCAddress.m in Sources */, 20148CC4183643E700E68E9C /* BTCBase58.m in Sources */, 209D1E2318D4F12500293483 /* BTCProcessor.m in Sources */, 20148CC6183643E700E68E9C /* NS+BTCBase58.m in Sources */, + 208E303D1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */, 20148CC7183643E700E68E9C /* BTCBigNumber.m in Sources */, + 20C7D1531B0CBBC900F71493 /* BTCAssetAddress.m in Sources */, 204FB509194C63B500C131DE /* BTCBlindSignature.m in Sources */, 207646ED1A0A8A37000F00F2 /* BTCTransactionBuilder.m in Sources */, C9C3C178195B535500D9F6FB /* BTCChainCom.m in Sources */, 20148CC9183643E700E68E9C /* BTCKey.m in Sources */, 209D1E1918D48EA200293483 /* BTCNetwork.m in Sources */, + 205D8B9F1B160BFB00F9EA4E /* BTCAssetType.m in Sources */, 20B8AB9C189EE88300008138 /* BTCKeychain.m in Sources */, 20148CCB183643E700E68E9C /* BTCProtocolSerialization.m in Sources */, 20148CCD183643E700E68E9C /* BTCOpcode.m in Sources */, - 2054DC7C1950E35E007175C8 /* BTCEncryptedMessage.m in Sources */, + 205D8BA91B16182500F9EA4E /* BTCAssetID.m in Sources */, + 2054DC7C1950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */, 20CD68E1189B18820083E1A9 /* BTCCurvePoint.m in Sources */, 20D09C6218BC016C00794209 /* BTCBlock.m in Sources */, 20148CCE183643E700E68E9C /* BTCScript.m in Sources */, 20148CD0183643E700E68E9C /* BTCScriptMachine.m in Sources */, + 20FFD7FB1B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */, + 20A443C41AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */, 20148CD1183643E700E68E9C /* BTCTransaction.m in Sources */, 207B260C188DC47800916AE6 /* BTCBlockchainInfo.m in Sources */, 200AAE4319FA3F020004F908 /* BTCOutpoint.m in Sources */, 20C2D80B19E2F2280022CAAC /* BTCMnemonic+Tests.m in Sources */, 2061D1DD1A2CA771004F1E40 /* BTCHashID.m in Sources */, + 205D8BD51B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */, 20148CD2183643E700E68E9C /* BTCTransactionInput.m in Sources */, + 20A443BC1AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */, + 200459EF1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */, 20148CD3183643E700E68E9C /* BTCTransactionOutput.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1316,38 +1804,51 @@ 206B015D1835485D00878B8D /* BTCBigNumber.m in Sources */, 20D09C5518BC012700794209 /* BTCBlockHeader.m in Sources */, 20C2D7FE19E2B2920022CAAC /* BTCMnemonic.m in Sources */, + 20A443CB1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */, + 2060A2841AAA077A004531FD /* BTCMerkleTree.m in Sources */, 207647081A0A8C15000F00F2 /* BTCCurrencyConverter.m in Sources */, 206B01561835485D00878B8D /* NSData+BTCData.m in Sources */, 207647121A0A8D16000F00F2 /* BTCQRCode.m in Sources */, 206B01581835485D00878B8D /* BTCAddress.m in Sources */, 207646FE1A0A8BB3000F00F2 /* BTCNumberFormatter.m in Sources */, 207C1E841A5D18A10005A341 /* BTCPriceSource.m in Sources */, + 205D8BC81B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */, 207646F41A0A8AE4000F00F2 /* BTCBitcoinURL.m in Sources */, 206B01541835485D00878B8D /* BTCData.m in Sources */, + 205D8BB41B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */, 206B01661835485D00878B8D /* BTCScriptMachine.m in Sources */, 206B01681835485D00878B8D /* BTCTransactionInput.m in Sources */, 209D1E2018D4F12500293483 /* BTCProcessor.m in Sources */, 206B015C1835485D00878B8D /* NS+BTCBase58.m in Sources */, + 208E303A1AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */, 206B01571835485D00878B8D /* BTCErrors.m in Sources */, + 20C7D1501B0CBBC900F71493 /* BTCAssetAddress.m in Sources */, 204FB506194C63B500C131DE /* BTCBlindSignature.m in Sources */, 207646EA1A0A8A37000F00F2 /* BTCTransactionBuilder.m in Sources */, C9C3C175195B535500D9F6FB /* BTCChainCom.m in Sources */, 206B01691835485D00878B8D /* BTCTransactionOutput.m in Sources */, 209D1E1618D48EA200293483 /* BTCNetwork.m in Sources */, + 205D8B9C1B160BFB00F9EA4E /* BTCAssetType.m in Sources */, 20D008BE18CFEAD000079B79 /* BTC256.m in Sources */, 206B01671835485D00878B8D /* BTCTransaction.m in Sources */, 20B8AB99189EE88300008138 /* BTCKeychain.m in Sources */, - 2054DC791950E35E007175C8 /* BTCEncryptedMessage.m in Sources */, + 205D8BA61B16182500F9EA4E /* BTCAssetID.m in Sources */, + 2054DC791950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */, 206B01641835485D00878B8D /* BTCScript.m in Sources */, 20D09C5F18BC016C00794209 /* BTCBlock.m in Sources */, 20CD68DE189B18820083E1A9 /* BTCCurvePoint.m in Sources */, 206B01631835485D00878B8D /* BTCOpcode.m in Sources */, + 20FFD7F81B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */, + 20A443C11AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */, 206B015A1835485D00878B8D /* BTCBase58.m in Sources */, 207B2609188DC47800916AE6 /* BTCBlockchainInfo.m in Sources */, 200AAE4019FA3F010004F908 /* BTCOutpoint.m in Sources */, 20C2D80819E2F2280022CAAC /* BTCMnemonic+Tests.m in Sources */, 2061D1DA1A2CA771004F1E40 /* BTCHashID.m in Sources */, + 205D8BD21B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */, 206B01611835485D00878B8D /* BTCProtocolSerialization.m in Sources */, + 20A443B91AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */, + 200459EC1C0720FC00BC9EE8 /* BTCSecretSharing.m in Sources */, 206B015F1835485D00878B8D /* BTCKey.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1356,30 +1857,41 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 20A443B81AC55F52008B3447 /* BTCPaymentProtocol.m in Sources */, + 20A443D11AC825DA008B3447 /* BTCEncryptedMessage+Tests.m in Sources */, 2084DD6117B8FF47005AC9E6 /* main.m in Sources */, - 20C4860A1955A88C0061DF75 /* BTCEncryptedMessage+Tests.m in Sources */, + 20C4860A1955A88C0061DF75 /* BTCFancyEncryptedMessage+Tests.m in Sources */, 20B8AB98189EE88300008138 /* BTCKeychain.m in Sources */, + 02DDB9B51AF7D70F00687183 /* BTCCurrencyConverter+Tests.m in Sources */, 2084DD8617B8FF76005AC9E6 /* BTCAddress.m in Sources */, 2037AB1517D3BFF900DB248C /* BTCScript+Tests.m in Sources */, 20B8AB9F189F0CEF00008138 /* BTCKeychain+Tests.m in Sources */, 2084DD8717B8FF76005AC9E6 /* BTCAddress+Tests.m in Sources */, + 20A443CA1AC82594008B3447 /* BTCEncryptedMessage.m in Sources */, 2084DD8817B8FF76005AC9E6 /* BTCBase58.m in Sources */, + 200459F01C07210100BC9EE8 /* BTCSecretSharing.m in Sources */, 2084DD8917B8FF76005AC9E6 /* BTCBigNumber.m in Sources */, 2084DD8A17B8FF76005AC9E6 /* BTCBigNumber+Tests.m in Sources */, 2084DD8B17B8FF76005AC9E6 /* BTCKey.m in Sources */, 2084DD8C17B8FF76005AC9E6 /* BTCProtocolSerialization.m in Sources */, 207B2608188DC47800916AE6 /* BTCBlockchainInfo.m in Sources */, + 20A443D51AC954C1008B3447 /* BTCEncryptedBackup+Tests.m in Sources */, 2084DD8D17B8FF76005AC9E6 /* BTCProtocolSerialization+Tests.m in Sources */, + 20C7D14F1B0CBBC900F71493 /* BTCAssetAddress.m in Sources */, + 2060A2831AAA077A004531FD /* BTCMerkleTree.m in Sources */, 20D008C218D1AFA800079B79 /* BTC256+Tests.m in Sources */, - 2054DC781950E35E007175C8 /* BTCEncryptedMessage.m in Sources */, + 20FFD7F71B1E3EB300CCA48D /* BTCPaymentMethod.m in Sources */, + 2054DC781950E35E007175C8 /* BTCFancyEncryptedMessage.m in Sources */, 200756DA1A5D6A44009A24A9 /* BTCPriceSource+Tests.m in Sources */, 2084DD8E17B8FF76005AC9E6 /* BTCScript.m in Sources */, 20D09C5E18BC016C00794209 /* BTCBlock.m in Sources */, 20B66C8717BFE4F9007128CE /* BTCErrors.m in Sources */, 2084DD8F17B8FF76005AC9E6 /* BTCTransaction.m in Sources */, 207647111A0A8D16000F00F2 /* BTCQRCode.m in Sources */, + 205D8BC71B172D8100F9EA4E /* BTCPaymentMethodRequest.m in Sources */, 2084DD9017B8FF76005AC9E6 /* BTCTransactionInput.m in Sources */, 2057A9CD17CD555F00353D54 /* BTCKey+Tests.m in Sources */, + 2060A28A1AAA09A3004531FD /* BTCMerkleTree+Tests.m in Sources */, 2084DD9117B8FF76005AC9E6 /* BTCTransactionOutput.m in Sources */, 20B5A64018924F350035582D /* BTCTransaction+Tests.m in Sources */, 209D1E1518D48EA200293483 /* BTCNetwork.m in Sources */, @@ -1387,15 +1899,21 @@ 20C2D80719E2F2280022CAAC /* BTCMnemonic+Tests.m in Sources */, 207646E91A0A8A37000F00F2 /* BTCTransactionBuilder.m in Sources */, 207646F31A0A8AE4000F00F2 /* BTCBitcoinURL.m in Sources */, + 2091948D1ACD318C00E67CB5 /* BTCBitcoinURL+Tests.m in Sources */, 206304EA17CBE72200DF3F18 /* NS+BTCBase58.m in Sources */, 208642BB194C9EAF003A3A2C /* BTCBlindSignature+Tests.m in Sources */, + 208E30391AC012CE0020F830 /* BTCEncryptedBackup.m in Sources */, 207C1E831A5D18A10005A341 /* BTCPriceSource.m in Sources */, 20E154DA195D0DB400DA40D3 /* BTCBlockchainInfo+Tests.m in Sources */, + 205D8BA51B16182500F9EA4E /* BTCAssetID.m in Sources */, + 205D8BB31B171D0900F9EA4E /* BTCPaymentRequest.m in Sources */, + 20A443C01AC55F52008B3447 /* BTCProtocolBuffers.m in Sources */, 20C2D7FD19E2B2920022CAAC /* BTCMnemonic.m in Sources */, 2084DD9217B8FF76005AC9E6 /* BTCData+Tests.m in Sources */, 209D1E1F18D4F12500293483 /* BTCProcessor.m in Sources */, 2084DD9317B8FF76005AC9E6 /* BTCData.m in Sources */, 20D008BF18CFEAD300079B79 /* BTC256.m in Sources */, + 205D8BD11B176DC000F9EA4E /* BTCPaymentMethodDetails.m in Sources */, 20E1E01217C73181003B6987 /* NSData+BTCData.m in Sources */, C9C3C174195B535500D9F6FB /* BTCChainCom.m in Sources */, 20CD68DD189B18820083E1A9 /* BTCCurvePoint.m in Sources */, @@ -1407,12 +1925,51 @@ 20B9646F17BADECE008161BB /* BTCOpcode.m in Sources */, 207647071A0A8C15000F00F2 /* BTCCurrencyConverter.m in Sources */, 200AAE3F19FA3EFA0004F908 /* BTCOutpoint.m in Sources */, + 205D8B9B1B160BFB00F9EA4E /* BTCAssetType.m in Sources */, 207646FD1A0A8BB3000F00F2 /* BTCNumberFormatter.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; + 757B24111B03F1BF0084A9DE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7558460E1B14E4B100E49C87 /* BTCEncryptedBackupTests.swift in Sources */, + 75EB9FF11B39C61500C26E70 /* BTC256Tests.swift in Sources */, + 75BBC6E51B0E721700A61690 /* BTCCurvePointTests.swift in Sources */, + 75A06DA01B17B7FE00ED7E79 /* BTCKeyTests.swift in Sources */, + 752834A91B699BEC00CD92E3 /* BTCScriptTests.swift in Sources */, + 758C8C451C08F111000C1796 /* BTCBigNumberTests.swift in Sources */, + 75AF30371C152EE3002187AF /* BTCEncryptedMessageTests.swift in Sources */, + 75AF303B1C153009002187AF /* BTCMerkleTreeTests.swift in Sources */, + 75B8190A1B04E69A0055F8B1 /* BTCPriceSourceTests.swift in Sources */, + 200FA8DA1C07A8B80039029D /* BTCSecretSharingTests.swift in Sources */, + 75E565AE1B7927C800CCCFA5 /* BTCTransactionTests.swift in Sources */, + 7549DAD11B0BB1D900F20FF0 /* BTCCurrencyConverterTests.swift in Sources */, + 75FB13E61B449661006D8935 /* BTCFancyEncryptedMessageTests.swift in Sources */, + 75BCBB661C08FADD00D5876A /* BTCBase58Tests.swift in Sources */, + 75B819061B04E65A0055F8B1 /* BTCAddressTests.swift in Sources */, + 75BD89A41B46269E0073A611 /* BTCDataTests.swift in Sources */, + 754564761B07F9AB008F34DC /* BTCBitcoinURLTests.swift in Sources */, + 75A1A3721B0E7DB900EA8D45 /* BTCBlindSignatureTests.swift in Sources */, + 20FFD8001B1F85F300CCA48D /* BTCPaymentProtocolTests.swift in Sources */, + 758DDAFE1BD2D83600AEDFFB /* BTCMnemonicTests.swift in Sources */, + 75B819081B04E68B0055F8B1 /* BTCBlockchainInfoTests.swift in Sources */, + 753118261B6042A400A102E2 /* BTCKeychainTests.swift in Sources */, + 75AF30351C152B1D002187AF /* BTCProtocolSerializationTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 757B241D1B03F1BF0084A9DE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 206B0112183547C200878B8D /* CoreBitcoinOSX */; + targetProxy = 757B241C1B03F1BF0084A9DE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 20148C081835638200E68E9C /* InfoPlist.strings */ = { isa = PBXVariantGroup; @@ -1454,7 +2011,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = CoreBitcoinIOS; @@ -1481,7 +2038,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 7.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = CoreBitcoinIOS; @@ -1513,7 +2070,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; @@ -1544,7 +2101,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; @@ -1572,7 +2129,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = CoreBitcoinOSX; @@ -1594,7 +2151,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = CoreBitcoinOSX; @@ -1623,9 +2180,9 @@ LD_DYLIB_INSTALL_NAME = ""; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; @@ -1649,9 +2206,9 @@ LD_DYLIB_INSTALL_NAME = ""; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Volumes/work/projects/CoreBitcoin/CoreBitcoin/openssl/lib, + "$(PROJECT_DIR)/openssl/lib", ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; @@ -1695,6 +2252,7 @@ CURRENT_PROJECT_VERSION = 0.6.2; DYLIB_COMPATIBILITY_VERSION = "$(CURRENT_PROJECT_VERSION)"; DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; + ENABLE_BITCODE = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -1713,6 +2271,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; + SWIFT_OBJC_BRIDGING_HEADER = CoreBitcoin/SwiftBridgingHeader.h; }; name = Debug; }; @@ -1735,6 +2294,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = "$(CURRENT_PROJECT_VERSION)"; DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; + ENABLE_BITCODE = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1745,6 +2305,82 @@ LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/openssl/lib\""; MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; + SWIFT_OBJC_BRIDGING_HEADER = CoreBitcoin/SwiftBridgingHeader.h; + }; + name = Release; + }; + 757B241E1B03F1BF0084A9DE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/openssl/include", + "$(SRCROOT)", + ); + INFOPLIST_FILE = CoreBitcoinTestsOSX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + LIBRARY_SEARCH_PATHS = "$(SRCROOT)/openssl/lib"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = CoreBitcoinTestsOSX/TestsSwiftBridgingHeader.h; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 757B241F1B03F1BF0084A9DE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/openssl/include", + "$(SRCROOT)", + ); + INFOPLIST_FILE = CoreBitcoinTestsOSX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + LIBRARY_SEARCH_PATHS = "$(SRCROOT)/openssl/lib"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = CoreBitcoinTestsOSX/TestsSwiftBridgingHeader.h; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; }; @@ -1805,6 +2441,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 757B24201B03F1BF0084A9DE /* Build configuration list for PBXNativeTarget "CoreBitcoinTestsOSX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 757B241E1B03F1BF0084A9DE /* Debug */, + 757B241F1B03F1BF0084A9DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 20D2801A17B8FE00004A462B /* Project object */; diff --git a/CoreBitcoin/BTC256+Tests.m b/CoreBitcoin/BTC256+Tests.m index 42d70b18..a1077662 100644 --- a/CoreBitcoin/BTC256+Tests.m +++ b/CoreBitcoin/BTC256+Tests.m @@ -4,29 +4,25 @@ #import "BTC256.h" #import "BTCData.h" -void BTC256TestChunkSize() -{ +void BTC256TestChunkSize() { NSCAssert(sizeof(BTC160) == 20, @"160-bit struct should by 160 bit long"); NSCAssert(sizeof(BTC256) == 32, @"256-bit struct should by 256 bit long"); NSCAssert(sizeof(BTC512) == 64, @"512-bit struct should by 512 bit long"); } -void BTC256TestNull() -{ +void BTC256TestNull() { NSCAssert([NSStringFromBTC160(BTC160Null) isEqual:@"82963d5edd842f1e6bd2b6bc2e9a97a40a7d8652"], @"null hash should be correct"); NSCAssert([NSStringFromBTC256(BTC256Null) isEqual:@"d1007a1fe826e95409e21595845f44c3b9411d5285b6b5982285aabfa5999a5e"], @"null hash should be correct"); NSCAssert([NSStringFromBTC512(BTC512Null) isEqual:@"62ce64dd92836e6e99d83eee3f623652f6049cf8c22272f295b262861738f0363e01b5d7a53c4a2e5a76d283f3e4a04d28ab54849c6e3e874ca31128bcb759e1"], @"null hash should be correct"); } -void BTC256TestOne() -{ +void BTC256TestOne() { BTC256 one = BTC256Zero; one.words64[0] = 1; NSCAssert([NSStringFromBTC256(one) isEqual:@"0100000000000000000000000000000000000000000000000000000000000000"], @""); } -void BTC256TestEqual() -{ +void BTC256TestEqual() { NSCAssert(BTC256Equal(BTC256Null, BTC256Null), @"equal"); NSCAssert(BTC256Equal(BTC256Zero, BTC256Zero), @"equal"); NSCAssert(BTC256Equal(BTC256Max, BTC256Max), @"equal"); @@ -36,8 +32,7 @@ void BTC256TestEqual() NSCAssert(!BTC256Equal(BTC256Max, BTC256Null), @"not equal"); } -void BTC256TestCompare() -{ +void BTC256TestCompare() { NSCAssert(BTC256Compare(BTC256FromNSString(@"62ce64dd92836e6e99d83eee3f623652f6049cf8c22272f295b262861738f036"), BTC256FromNSString(@"62ce64dd92836e6e99d83eee3f623652f6049cf8c22272f295b262861738f036")) == NSOrderedSame, @"ordered same"); @@ -55,8 +50,7 @@ void BTC256TestCompare() } -void BTC256TestInverse() -{ +void BTC256TestInverse() { BTC256 chunk = BTC256FromNSString(@"62ce64dd92836e6e99d83eee3f623652f6049cf8c22272f295b262861738f036"); BTC256 chunk2 = BTC256Inverse(chunk); @@ -73,8 +67,7 @@ void BTC256TestInverse() NSCAssert(BTC256Equal(BTC256Max, BTC256XOR(chunk, chunk2)), @"(a ^ ~a) == 111111..."); } -void BTC256TestSwap() -{ +void BTC256TestSwap() { BTC256 chunk = BTC256FromNSString(@"62ce64dd92836e6e99d83eee3f623652f6049cf8c22272f295b262861738f036"); BTC256 chunk2 = BTC256Swap(chunk); NSCAssert([BTCReversedData(NSDataFromBTC256(chunk)) isEqual:NSDataFromBTC256(chunk2)], @"swap should reverse all bytes"); @@ -85,8 +78,7 @@ void BTC256TestSwap() NSCAssert(chunk2.words64[3] == OSSwapConstInt64(chunk.words64[0]), @"swap should reverse all bytes"); } -void BTC256TestAND() -{ +void BTC256TestAND() { NSCAssert(BTC256Equal(BTC256AND(BTC256Max, BTC256Max), BTC256Max), @"1 & 1 == 1"); NSCAssert(BTC256Equal(BTC256AND(BTC256Max, BTC256Zero), BTC256Zero), @"1 & 0 == 0"); NSCAssert(BTC256Equal(BTC256AND(BTC256Zero, BTC256Max), BTC256Zero), @"0 & 1 == 0"); @@ -96,8 +88,7 @@ void BTC256TestAND() NSCAssert(BTC256Equal(BTC256AND(BTC256Null, BTC256Max), BTC256Null), @"x & 1 == x"); } -void BTC256TestOR() -{ +void BTC256TestOR() { NSCAssert(BTC256Equal(BTC256OR(BTC256Max, BTC256Max), BTC256Max), @"1 | 1 == 1"); NSCAssert(BTC256Equal(BTC256OR(BTC256Max, BTC256Zero), BTC256Max), @"1 | 0 == 1"); NSCAssert(BTC256Equal(BTC256OR(BTC256Zero, BTC256Max), BTC256Max), @"0 | 1 == 1"); @@ -107,8 +98,7 @@ void BTC256TestOR() NSCAssert(BTC256Equal(BTC256OR(BTC256Null, BTC256Max), BTC256Max), @"x | 1 == 1"); } -void BTC256TestXOR() -{ +void BTC256TestXOR() { NSCAssert(BTC256Equal(BTC256XOR(BTC256Max, BTC256Max), BTC256Zero), @"1 ^ 1 == 0"); NSCAssert(BTC256Equal(BTC256XOR(BTC256Max, BTC256Zero), BTC256Max), @"1 ^ 0 == 1"); NSCAssert(BTC256Equal(BTC256XOR(BTC256Zero, BTC256Max), BTC256Max), @"0 ^ 1 == 1"); @@ -118,8 +108,7 @@ void BTC256TestXOR() NSCAssert(BTC256Equal(BTC256XOR(BTC256Null, BTC256Max), BTC256Inverse(BTC256Null)), @"x ^ 1 == ~x"); } -void BTC256TestConcat() -{ +void BTC256TestConcat() { BTC512 concat = BTC512Concat(BTC256Null, BTC256Max); NSCAssert([NSStringFromBTC512(concat) isEqual:@"d1007a1fe826e95409e21595845f44c3b9411d5285b6b5982285aabfa5999a5e" "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"], @"should concatenate properly"); @@ -130,13 +119,11 @@ void BTC256TestConcat() } -void BTC256TestConvertToData() -{ +void BTC256TestConvertToData() { // TODO... } -void BTC256TestConvertToString() -{ +void BTC256TestConvertToString() { // Too short string should yield null value. BTC256 chunk = BTC256FromNSString(@"000095409e215952" "85b6b5982285aabf" @@ -160,8 +147,7 @@ void BTC256TestConvertToString() } -void BTC256RunAllTests() -{ +void BTC256RunAllTests() { BTC256TestChunkSize(); BTC256TestNull(); BTC256TestOne(); diff --git a/CoreBitcoin/BTC256.m b/CoreBitcoin/BTC256.m index 97c99792..a220c2ea 100644 --- a/CoreBitcoin/BTC256.m +++ b/CoreBitcoin/BTC256.m @@ -32,8 +32,7 @@ // 3. Comparison -BOOL BTC160Equal(BTC160 chunk1, BTC160 chunk2) -{ +BOOL BTC160Equal(BTC160 chunk1, BTC160 chunk2) { // Which one is faster: memcmp or word-by-word check? The latter does not need any loop or extra checks to compare bytes. // return memcmp(&chunk1, &chunk2, sizeof(chunk1)) == 0; return chunk1.words32[0] == chunk2.words32[0] @@ -43,16 +42,14 @@ BOOL BTC160Equal(BTC160 chunk1, BTC160 chunk2) && chunk1.words32[4] == chunk2.words32[4]; } -BOOL BTC256Equal(BTC256 chunk1, BTC256 chunk2) -{ +BOOL BTC256Equal(BTC256 chunk1, BTC256 chunk2) { return chunk1.words64[0] == chunk2.words64[0] && chunk1.words64[1] == chunk2.words64[1] && chunk1.words64[2] == chunk2.words64[2] && chunk1.words64[3] == chunk2.words64[3]; } -BOOL BTC512Equal(BTC512 chunk1, BTC512 chunk2) -{ +BOOL BTC512Equal(BTC512 chunk1, BTC512 chunk2) { return chunk1.words64[0] == chunk2.words64[0] && chunk1.words64[1] == chunk2.words64[1] && chunk1.words64[2] == chunk2.words64[2] @@ -63,8 +60,7 @@ BOOL BTC512Equal(BTC512 chunk1, BTC512 chunk2) && chunk1.words64[7] == chunk2.words64[7]; } -NSComparisonResult BTC160Compare(BTC160 chunk1, BTC160 chunk2) -{ +NSComparisonResult BTC160Compare(BTC160 chunk1, BTC160 chunk2) { int r = memcmp(&chunk1, &chunk2, sizeof(chunk1)); if (r > 0) return NSOrderedDescending; @@ -72,8 +68,7 @@ NSComparisonResult BTC160Compare(BTC160 chunk1, BTC160 chunk2) return NSOrderedSame; } -NSComparisonResult BTC256Compare(BTC256 chunk1, BTC256 chunk2) -{ +NSComparisonResult BTC256Compare(BTC256 chunk1, BTC256 chunk2) { int r = memcmp(&chunk1, &chunk2, sizeof(chunk1)); if (r > 0) return NSOrderedDescending; @@ -81,8 +76,7 @@ NSComparisonResult BTC256Compare(BTC256 chunk1, BTC256 chunk2) return NSOrderedSame; } -NSComparisonResult BTC512Compare(BTC512 chunk1, BTC512 chunk2) -{ +NSComparisonResult BTC512Compare(BTC512 chunk1, BTC512 chunk2) { int r = memcmp(&chunk1, &chunk2, sizeof(chunk1)); if (r > 0) return NSOrderedDescending; @@ -96,8 +90,7 @@ NSComparisonResult BTC512Compare(BTC512 chunk1, BTC512 chunk2) // Inverse (b = ~a) -BTC160 BTC160Inverse(BTC160 chunk) -{ +BTC160 BTC160Inverse(BTC160 chunk) { chunk.words32[0] = ~chunk.words32[0]; chunk.words32[1] = ~chunk.words32[1]; chunk.words32[2] = ~chunk.words32[2]; @@ -106,8 +99,7 @@ BTC160 BTC160Inverse(BTC160 chunk) return chunk; } -BTC256 BTC256Inverse(BTC256 chunk) -{ +BTC256 BTC256Inverse(BTC256 chunk) { chunk.words64[0] = ~chunk.words64[0]; chunk.words64[1] = ~chunk.words64[1]; chunk.words64[2] = ~chunk.words64[2]; @@ -115,8 +107,7 @@ BTC256 BTC256Inverse(BTC256 chunk) return chunk; } -BTC512 BTC512Inverse(BTC512 chunk) -{ +BTC512 BTC512Inverse(BTC512 chunk) { chunk.words64[0] = ~chunk.words64[0]; chunk.words64[1] = ~chunk.words64[1]; chunk.words64[2] = ~chunk.words64[2]; @@ -129,8 +120,7 @@ BTC512 BTC512Inverse(BTC512 chunk) } // Swap byte order -BTC160 BTC160Swap(BTC160 chunk) -{ +BTC160 BTC160Swap(BTC160 chunk) { BTC160 chunk2; chunk2.words32[4] = OSSwapConstInt32(chunk.words32[0]); chunk2.words32[3] = OSSwapConstInt32(chunk.words32[1]); @@ -140,8 +130,7 @@ BTC160 BTC160Swap(BTC160 chunk) return chunk2; } -BTC256 BTC256Swap(BTC256 chunk) -{ +BTC256 BTC256Swap(BTC256 chunk) { BTC256 chunk2; chunk2.words64[3] = OSSwapConstInt64(chunk.words64[0]); chunk2.words64[2] = OSSwapConstInt64(chunk.words64[1]); @@ -150,8 +139,7 @@ BTC256 BTC256Swap(BTC256 chunk) return chunk2; } -BTC512 BTC512Swap(BTC512 chunk) -{ +BTC512 BTC512Swap(BTC512 chunk) { BTC512 chunk2; chunk2.words64[7] = OSSwapConstInt64(chunk.words64[0]); chunk2.words64[6] = OSSwapConstInt64(chunk.words64[1]); @@ -165,8 +153,7 @@ BTC512 BTC512Swap(BTC512 chunk) } // Bitwise AND operation (a & b) -BTC160 BTC160AND(BTC160 chunk1, BTC160 chunk2) -{ +BTC160 BTC160AND(BTC160 chunk1, BTC160 chunk2) { chunk1.words32[0] = chunk1.words32[0] & chunk2.words32[0]; chunk1.words32[1] = chunk1.words32[1] & chunk2.words32[1]; chunk1.words32[2] = chunk1.words32[2] & chunk2.words32[2]; @@ -175,8 +162,7 @@ BTC160 BTC160AND(BTC160 chunk1, BTC160 chunk2) return chunk1; } -BTC256 BTC256AND(BTC256 chunk1, BTC256 chunk2) -{ +BTC256 BTC256AND(BTC256 chunk1, BTC256 chunk2) { chunk1.words64[0] = chunk1.words64[0] & chunk2.words64[0]; chunk1.words64[1] = chunk1.words64[1] & chunk2.words64[1]; chunk1.words64[2] = chunk1.words64[2] & chunk2.words64[2]; @@ -184,8 +170,7 @@ BTC256 BTC256AND(BTC256 chunk1, BTC256 chunk2) return chunk1; } -BTC512 BTC512AND(BTC512 chunk1, BTC512 chunk2) -{ +BTC512 BTC512AND(BTC512 chunk1, BTC512 chunk2) { chunk1.words64[0] = chunk1.words64[0] & chunk2.words64[0]; chunk1.words64[1] = chunk1.words64[1] & chunk2.words64[1]; chunk1.words64[2] = chunk1.words64[2] & chunk2.words64[2]; @@ -198,8 +183,7 @@ BTC512 BTC512AND(BTC512 chunk1, BTC512 chunk2) } // Bitwise OR operation (a | b) -BTC160 BTC160OR(BTC160 chunk1, BTC160 chunk2) -{ +BTC160 BTC160OR(BTC160 chunk1, BTC160 chunk2) { chunk1.words32[0] = chunk1.words32[0] | chunk2.words32[0]; chunk1.words32[1] = chunk1.words32[1] | chunk2.words32[1]; chunk1.words32[2] = chunk1.words32[2] | chunk2.words32[2]; @@ -208,8 +192,7 @@ BTC160 BTC160OR(BTC160 chunk1, BTC160 chunk2) return chunk1; } -BTC256 BTC256OR(BTC256 chunk1, BTC256 chunk2) -{ +BTC256 BTC256OR(BTC256 chunk1, BTC256 chunk2) { chunk1.words64[0] = chunk1.words64[0] | chunk2.words64[0]; chunk1.words64[1] = chunk1.words64[1] | chunk2.words64[1]; chunk1.words64[2] = chunk1.words64[2] | chunk2.words64[2]; @@ -217,8 +200,7 @@ BTC256 BTC256OR(BTC256 chunk1, BTC256 chunk2) return chunk1; } -BTC512 BTC512OR(BTC512 chunk1, BTC512 chunk2) -{ +BTC512 BTC512OR(BTC512 chunk1, BTC512 chunk2) { chunk1.words64[0] = chunk1.words64[0] | chunk2.words64[0]; chunk1.words64[1] = chunk1.words64[1] | chunk2.words64[1]; chunk1.words64[2] = chunk1.words64[2] | chunk2.words64[2]; @@ -231,8 +213,7 @@ BTC512 BTC512OR(BTC512 chunk1, BTC512 chunk2) } // Bitwise exclusive-OR operation (a ^ b) -BTC160 BTC160XOR(BTC160 chunk1, BTC160 chunk2) -{ +BTC160 BTC160XOR(BTC160 chunk1, BTC160 chunk2) { chunk1.words32[0] = chunk1.words32[0] ^ chunk2.words32[0]; chunk1.words32[1] = chunk1.words32[1] ^ chunk2.words32[1]; chunk1.words32[2] = chunk1.words32[2] ^ chunk2.words32[2]; @@ -241,8 +222,7 @@ BTC160 BTC160XOR(BTC160 chunk1, BTC160 chunk2) return chunk1; } -BTC256 BTC256XOR(BTC256 chunk1, BTC256 chunk2) -{ +BTC256 BTC256XOR(BTC256 chunk1, BTC256 chunk2) { chunk1.words64[0] = chunk1.words64[0] ^ chunk2.words64[0]; chunk1.words64[1] = chunk1.words64[1] ^ chunk2.words64[1]; chunk1.words64[2] = chunk1.words64[2] ^ chunk2.words64[2]; @@ -250,8 +230,7 @@ BTC256 BTC256XOR(BTC256 chunk1, BTC256 chunk2) return chunk1; } -BTC512 BTC512XOR(BTC512 chunk1, BTC512 chunk2) -{ +BTC512 BTC512XOR(BTC512 chunk1, BTC512 chunk2) { chunk1.words64[0] = chunk1.words64[0] ^ chunk2.words64[0]; chunk1.words64[1] = chunk1.words64[1] ^ chunk2.words64[1]; chunk1.words64[2] = chunk1.words64[2] ^ chunk2.words64[2]; @@ -263,8 +242,7 @@ BTC512 BTC512XOR(BTC512 chunk1, BTC512 chunk2) return chunk1; } -BTC512 BTC512Concat(BTC256 chunk1, BTC256 chunk2) -{ +BTC512 BTC512Concat(BTC256 chunk1, BTC256 chunk2) { BTC512 result; *((BTC256*)(&result)) = chunk1; *((BTC256*)(((unsigned char*)&result) + sizeof(chunk2))) = chunk2; @@ -276,39 +254,33 @@ BTC512 BTC512Concat(BTC256 chunk1, BTC256 chunk2) // Conversion to NSData -NSData* NSDataFromBTC160(BTC160 chunk) -{ +NSData* NSDataFromBTC160(BTC160 chunk) { return [[NSData alloc] initWithBytes:&chunk length:sizeof(chunk)]; } -NSData* NSDataFromBTC256(BTC256 chunk) -{ +NSData* NSDataFromBTC256(BTC256 chunk) { return [[NSData alloc] initWithBytes:&chunk length:sizeof(chunk)]; } -NSData* NSDataFromBTC512(BTC512 chunk) -{ +NSData* NSDataFromBTC512(BTC512 chunk) { return [[NSData alloc] initWithBytes:&chunk length:sizeof(chunk)]; } // Conversion from NSData. // If NSData is not big enough, returns BTCHash{160,256,512}Null. -BTC160 BTC160FromNSData(NSData* data) -{ +BTC160 BTC160FromNSData(NSData* data) { if (data.length < 160/8) return BTC160Null; BTC160 chunk = *((BTC160*)data.bytes); return chunk; } -BTC256 BTC256FromNSData(NSData* data) -{ +BTC256 BTC256FromNSData(NSData* data) { if (data.length < 256/8) return BTC256Null; BTC256 chunk = *((BTC256*)data.bytes); return chunk; } -BTC512 BTC512FromNSData(NSData* data) -{ +BTC512 BTC512FromNSData(NSData* data) { if (data.length < 512/8) return BTC512Null; BTC512 chunk = *((BTC512*)data.bytes); return chunk; @@ -317,37 +289,31 @@ BTC512 BTC512FromNSData(NSData* data) // Returns lowercase hex representation of the chunk -NSString* NSStringFromBTC160(BTC160 chunk) -{ +NSString* NSStringFromBTC160(BTC160 chunk) { const int length = 20; char dest[2*length + 1]; const unsigned char *src = (unsigned char *)&chunk; - for (int i = 0; i < length; ++i) - { + for (int i = 0; i < length; ++i) { sprintf(dest + i*2, "%02x", (unsigned int)(src[i])); } return [[NSString alloc] initWithBytes:dest length:2*length encoding:NSASCIIStringEncoding]; } -NSString* NSStringFromBTC256(BTC256 chunk) -{ +NSString* NSStringFromBTC256(BTC256 chunk) { const int length = 32; char dest[2*length + 1]; const unsigned char *src = (unsigned char *)&chunk; - for (int i = 0; i < length; ++i) - { + for (int i = 0; i < length; ++i) { sprintf(dest + i*2, "%02x", (unsigned int)(src[i])); } return [[NSString alloc] initWithBytes:dest length:2*length encoding:NSASCIIStringEncoding]; } -NSString* NSStringFromBTC512(BTC512 chunk) -{ +NSString* NSStringFromBTC512(BTC512 chunk) { const int length = 64; char dest[2*length + 1]; const unsigned char *src = (unsigned char *)&chunk; - for (int i = 0; i < length; ++i) - { + for (int i = 0; i < length; ++i) { sprintf(dest + i*2, "%02x", (unsigned int)(src[i])); } return [[NSString alloc] initWithBytes:dest length:2*length encoding:NSASCIIStringEncoding]; @@ -355,18 +321,15 @@ BTC512 BTC512FromNSData(NSData* data) // Conversion from hex NSString (lower- or uppercase). // If string is invalid or data is too short, returns BTCHash{160,256,512}Null. -BTC160 BTC160FromNSString(NSString* string) -{ +BTC160 BTC160FromNSString(NSString* string) { return BTC160FromNSData(BTCDataFromHex(string)); } -BTC256 BTC256FromNSString(NSString* string) -{ +BTC256 BTC256FromNSString(NSString* string) { return BTC256FromNSData(BTCDataFromHex(string)); } -BTC512 BTC512FromNSString(NSString* string) -{ +BTC512 BTC512FromNSString(NSString* string) { return BTC512FromNSData(BTCDataFromHex(string)); } diff --git a/CoreBitcoin/BTCAddress+Tests.m b/CoreBitcoin/BTCAddress+Tests.m index 3db8e01a..e19b4197 100644 --- a/CoreBitcoin/BTCAddress+Tests.m +++ b/CoreBitcoin/BTCAddress+Tests.m @@ -4,69 +4,64 @@ @implementation BTCAddress (Tests) -+ (void) runAllTests -{ ++ (void) runAllTests { [self testPublicKeyAddress]; [self testPrivateKeyAddress]; [self testPrivateKeyAddressWithCompressedPoint]; [self testScriptHashKeyAddress]; } -+ (void) testPublicKeyAddress -{ - BTCPublicKeyAddress* addr = [BTCPublicKeyAddress addressWithBase58String:@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T"]; ++ (void) testPublicKeyAddress { + BTCPublicKeyAddress* addr = [BTCPublicKeyAddress addressWithString:@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T"]; NSAssert(addr, @"Address should be decoded"); NSAssert([addr isKindOfClass:[BTCPublicKeyAddress class]], @"Address should be an instance of BTCPublicKeyAddress"); NSAssert([@"c4c5d791fcb4654a1ef5e03fe0ad3d9c598f9827" isEqualToString:[addr.data hex]], @"Must decode hash160 correctly."); - NSAssert([addr isEqualTo:addr.publicAddress], @"Address should be equal to its publicAddress"); + NSAssert([addr isEqual:addr.publicAddress], @"Address should be equal to its publicAddress"); BTCPublicKeyAddress* addr2 = [BTCPublicKeyAddress addressWithData:BTCDataFromHex(@"c4c5d791fcb4654a1ef5e03fe0ad3d9c598f9827")]; NSAssert(addr2, @"Address should be created"); - NSAssert([@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T" isEqualToString:addr2.base58String], @"Must encode hash160 correctly."); + NSAssert([@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T" isEqualToString:addr2.string], @"Must encode hash160 correctly."); } -+ (void) testPrivateKeyAddress -{ - BTCPrivateKeyAddress* addr = [BTCPrivateKeyAddress addressWithBase58String:@"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS"]; ++ (void) testPrivateKeyAddress { + BTCPrivateKeyAddress* addr = [BTCPrivateKeyAddress addressWithString:@"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS"]; NSAssert(addr, @"Address should be decoded"); NSAssert([addr isKindOfClass:[BTCPrivateKeyAddress class]], @"Address should be an instance of BTCPrivateKeyAddress"); NSAssert(!addr.isPublicKeyCompressed, @"Address should be not compressed"); NSAssert([@"c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a" isEqualToString:addr.data.hex], @"Must decode secret key correctly."); - NSAssert([[[addr publicAddress] base58String] isEqualTo:@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T"], @"must provide proper public address"); + NSAssert([[addr publicAddress].string isEqual:@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T"], @"must provide proper public address"); BTCPrivateKeyAddress* addr2 = [BTCPrivateKeyAddress addressWithData:BTCDataFromHex(@"c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a")]; NSAssert(addr2, @"Address should be created"); - NSAssert([@"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS" isEqualToString:addr2.base58String], @"Must encode secret key correctly."); + NSAssert([@"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS" isEqualToString:addr2.string], @"Must encode secret key correctly."); } -+ (void) testPrivateKeyAddressWithCompressedPoint -{ - BTCPrivateKeyAddress* addr = [BTCPrivateKeyAddress addressWithBase58String:@"L3p8oAcQTtuokSCRHQ7i4MhjWc9zornvpJLfmg62sYpLRJF9woSu"]; ++ (void) testPrivateKeyAddressWithCompressedPoint { + BTCPrivateKeyAddress* addr = [BTCPrivateKeyAddress addressWithString:@"L3p8oAcQTtuokSCRHQ7i4MhjWc9zornvpJLfmg62sYpLRJF9woSu"]; NSAssert(addr, @"Address should be decoded"); NSAssert([addr isKindOfClass:[BTCPrivateKeyAddress class]], @"Address should be an instance of BTCPrivateKeyAddress"); NSAssert(addr.isPublicKeyCompressed, @"Address should be compressed"); NSAssert([@"c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a" isEqualToString:addr.data.hex], @"Must decode secret key correctly."); - NSAssert([[[addr publicAddress] base58String] isEqualTo:@"1C7zdTfnkzmr13HfA2vNm5SJYRK6nEKyq8"], @"must provide proper public address"); + NSAssert([[addr publicAddress].string isEqual:@"1C7zdTfnkzmr13HfA2vNm5SJYRK6nEKyq8"], @"must provide proper public address"); BTCPrivateKeyAddress* addr2 = [BTCPrivateKeyAddress addressWithData:BTCDataFromHex(@"c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a")]; NSAssert(addr2, @"Address should be created"); addr2.publicKeyCompressed = YES; - NSAssert([@"L3p8oAcQTtuokSCRHQ7i4MhjWc9zornvpJLfmg62sYpLRJF9woSu" isEqualToString:addr2.base58String], @"Must encode secret key correctly."); + NSAssert([@"L3p8oAcQTtuokSCRHQ7i4MhjWc9zornvpJLfmg62sYpLRJF9woSu" isEqualToString:addr2.string], @"Must encode secret key correctly."); addr2.publicKeyCompressed = NO; - NSAssert([@"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS" isEqualToString:addr2.base58String], @"Must encode secret key correctly."); + NSAssert([@"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS" isEqualToString:addr2.string], @"Must encode secret key correctly."); } -+ (void) testScriptHashKeyAddress -{ - BTCScriptHashAddress* addr = [BTCScriptHashAddress addressWithBase58String:@"3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8"]; ++ (void) testScriptHashKeyAddress { + BTCScriptHashAddress* addr = [BTCScriptHashAddress addressWithString:@"3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8"]; NSAssert(addr, @"Address should be decoded"); NSAssert([addr isKindOfClass:[BTCScriptHashAddress class]], @"Address should be an instance of BTCScriptHashAddress"); NSAssert([@"e8c300c87986efa84c37c0519929019ef86eb5b4" isEqualToString:addr.data.hex], @"Must decode hash160 correctly."); - NSAssert([addr isEqualTo:addr.publicAddress], @"Address should be equal to its publicAddress"); + NSAssert([addr isEqual:addr.publicAddress], @"Address should be equal to its publicAddress"); BTCScriptHashAddress* addr2 = [BTCScriptHashAddress addressWithData:BTCDataFromHex(@"e8c300c87986efa84c37c0519929019ef86eb5b4")]; NSAssert(addr2, @"Address should be created"); - NSAssert([@"3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8" isEqualToString:addr2.base58String], @"Must encode hash160 correctly."); + NSAssert([@"3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8" isEqualToString:addr2.string], @"Must encode hash160 correctly."); } @end diff --git a/CoreBitcoin/BTCAddress.h b/CoreBitcoin/BTCAddress.h index 8e249986..ee2a6ec8 100644 --- a/CoreBitcoin/BTCAddress.h +++ b/CoreBitcoin/BTCAddress.h @@ -15,36 +15,47 @@ // BTCScriptHashAddressTestnet. // @class BTCKey; +@class BTCNetwork; @interface BTCAddress : NSObject -// Returns an instance of a specific subclass depending on version number. -// Returns nil for unsupported addresses. -+ (instancetype) addressWithString:(NSString*)string; - -// Initializes address with raw data. Should only be used in subclasses, base class will raise exception. -+ (instancetype) addressWithData:(NSData*)data; +/*! + * Allows subclasses to be instantiated by a call to a superclass: BTCAddress(string: "...") + */ ++ (void) registerAddressClass:(nonnull Class)addressClass version:(uint8_t)version; -// Returns an instance of a specific subclass depending on version number. -// Returns nil for unsupported addresses. -// DEPRECATED! Use `-addressWithString:` instead. -+ (instancetype) addressWithBase58String:(NSString*)string; +/*! + * Returns an instance of a specific subclass depending on version number. + * Returns nil for unsupported addresses. + */ ++ (nullable instancetype) addressWithString:(nullable NSString*)string; -// Returns binary contents of an address (without checksums or version number). -// 20 bytes for hashes, 32 bytes for private key. -@property(nonatomic, readonly) NSData* data; +/*! + * Initializes address with raw data. Should only be used in subclasses, base class will raise exception. + * Returns an instance of a specific subclass depending on version number. + */ ++ (nullable instancetype) addressWithData:(nullable NSData*)data; -// Returns representation in base58 encoding. -@property(nonatomic, readonly) NSString* string; +/*! + * Returns binary contents of an address (without checksums or version number). + * 20 bytes for hashes, 32 bytes for private key. + */ +@property(nonatomic, readonly, nonnull) NSData* data; -// Returns representation in base58 encoding. -// DEPRECATED! Use -string instead. -@property(nonatomic, readonly) NSString* base58String; +/*! + * Returns representation in base58 encoding. + */ +@property(nonatomic, readonly, nonnull) NSString* string; /*! - * Returns a public version of this address. By default it's receiver itself. + * Returns a public version of this address. By default it is a receiver itself. * PrivateKeyAddress returns appropriate PublicKeyAddress. */ -@property(nonatomic, readonly) BTCAddress* publicAddress; +@property(nonatomic, readonly, nonnull) BTCAddress* publicAddress; + +/*! + * Returns mainnet or testnet3 instance. + */ +@property(nonatomic, readonly, nonnull) BTCNetwork* network; /*! * Returns YES if this address is intended for testnet. @@ -56,10 +67,19 @@ */ - (void) clear; + +// Returns an instance of a specific subclass depending on version number. +// Returns nil for unsupported addresses. +// DEPRECATED! Use `-addressWithString:` instead. ++ (nullable instancetype) addressWithBase58String:(nullable NSString*)string DEPRECATED_ATTRIBUTE; +// Returns representation in base58 encoding. +// DEPRECATED! Use -string instead. +@property(nonatomic, readonly, nonnull) NSString* base58String DEPRECATED_ATTRIBUTE; + @end -// Standard pulic key address (19FGfswVqxNubJbh1NW8A4t51T9x9RDVWQ) +// Standard public key address (19FGfswVqxNubJbh1NW8A4t51T9x9RDVWQ) @interface BTCPublicKeyAddress : BTCAddress @end @interface BTCPublicKeyAddressTestnet : BTCPublicKeyAddress @@ -73,10 +93,10 @@ @property(nonatomic, getter=isPublicKeyCompressed) BOOL publicKeyCompressed; // Returns BTCKey containing a key pair. Its public key is compressed as specified by the address. -@property(nonatomic, readonly) BTCKey* key; +@property(nonatomic, readonly, nonnull) BTCKey* key; // Creates address from raw private key data. If the public key must be compressed, pass YES to publicKeyCompressed:. -+ (instancetype) addressWithData:(NSData*)data publicKeyCompressed:(BOOL)compressedPubkey; ++ (nullable instancetype) addressWithData:(nullable NSData*)data publicKeyCompressed:(BOOL)compressedPubkey; @end @interface BTCPrivateKeyAddressTestnet : BTCPrivateKeyAddress @end diff --git a/CoreBitcoin/BTCAddress.m b/CoreBitcoin/BTCAddress.m index edffd6ef..941c7e0e 100644 --- a/CoreBitcoin/BTCAddress.m +++ b/CoreBitcoin/BTCAddress.m @@ -1,9 +1,12 @@ // Oleg Andreev #import "BTCAddress.h" +#import "BTCAddressSubclass.h" +#import "BTCNetwork.h" #import "BTCData.h" #import "BTCBase58.h" #import "BTCKey.h" +#import enum { @@ -15,104 +18,89 @@ BTCScriptHashAddressVersionTestnet = 196, }; -@interface BTCAddress () -@property(nonatomic, readwrite) NSData* data; -@end - @implementation BTCAddress { char* _cstring; + NSData* _data; } -- (void) dealloc -{ +- (id) init { + if (self = [super init]) { + _data = nil; + } + return self; +} + +- (void) setData:(NSData *)data { + id d = [data copy]; + _data = d; +} + +- (NSData*) data { + return _data; +} + +- (void) dealloc { // The data may be retained by someone and should not be cleared like that. // [self clear]; if (_cstring) free(_cstring); - _data = nil; } -+ (instancetype) addressWithString:(NSString*)string -{ ++ (instancetype) addressWithString:(NSString*)string { return [self addressWithBase58CString:[string cStringUsingEncoding:NSASCIIStringEncoding]]; } -+ (instancetype) addressWithBase58String:(NSString*)string // DEPRECATED -{ ++ (instancetype) addressWithBase58String:(NSString*)string { // DEPRECATED return [self addressWithString:string]; } // Initializes address with raw data. Should only be used in subclasses, base class will raise exception. -+ (instancetype) addressWithData:(NSData*)data -{ ++ (instancetype) addressWithData:(NSData*)data { @throw [NSException exceptionWithName:@"BTCAddress Exception" reason:@"Cannot init base class with raw data. Please use specialized subclass." userInfo:nil]; return nil; } // prototype to make clang happy. -+ (instancetype) addressWithComposedData:(NSData*)data cstring:(const char*)cstring -{ ++ (instancetype) addressWithComposedData:(NSData*)data cstring:(const char*)cstring version:(uint8_t)version { return nil; } // Returns an instance of a specific subclass depending on version number. // Returns nil for unsupported addresses. -+ (id) addressWithBase58CString:(const char*)cstring -{ ++ (id) addressWithBase58CString:(const char*)cstring { NSMutableData* composedData = BTCDataFromBase58CheckCString(cstring); if (!composedData) return nil; if (composedData.length < 2) return nil; - int version = ((unsigned char*)composedData.bytes)[0]; + uint8_t version = ((unsigned char*)composedData.bytes)[0]; - BTCAddress* address = nil; - if (version == BTCPublicKeyAddressVersion) - { - address = [BTCPublicKeyAddress addressWithComposedData:composedData cstring:cstring]; - } - else if (version == BTCPrivateKeyAddressVersion) - { - address = [BTCPrivateKeyAddress addressWithComposedData:composedData cstring:cstring]; - } - else if (version == BTCScriptHashAddressVersion) - { - address = [BTCScriptHashAddress addressWithComposedData:composedData cstring:cstring]; - } - else if (version == BTCPublicKeyAddressVersionTestnet) - { - address = [BTCPublicKeyAddressTestnet addressWithComposedData:composedData cstring:cstring]; - } - else if (version == BTCPrivateKeyAddressVersionTestnet) - { - address = [BTCPrivateKeyAddressTestnet addressWithComposedData:composedData cstring:cstring]; - } - else if (version == BTCScriptHashAddressVersionTestnet) - { - address = [BTCScriptHashAddressTestnet addressWithComposedData:composedData cstring:cstring]; - } - else - { - // Unknown version. + NSDictionary* classes = [self registeredAddressClasses]; + Class cls = classes[@(version)]; + BTCAddress* address = [cls addressWithComposedData:composedData cstring:cstring version:version]; + if (!address) { NSLog(@"BTCAddress: unknown address version: %d", version); } - + + // Verify that address is compatible with the class being invoked. + // So if someone asked to parse P2PKH address with P2SH string, they will get nil instead of P2SH instance. + if (![address isKindOfClass:self]) { + return nil; + } + // Securely erase decoded address data BTCDataClear(composedData); return address; } -- (void) setBase58CString:(const char*)cstring -{ - if (_cstring) - { +- (void) setBase58CString:(const char*)cstring { + if (_cstring) { BTCSecureClearCString(_cstring); free(_cstring); _cstring = NULL; } - if (cstring) - { + if (cstring) { size_t len = strlen(cstring) + 1; // with \0 _cstring = malloc(len); memcpy(_cstring, cstring, len); @@ -120,15 +108,12 @@ - (void) setBase58CString:(const char*)cstring } // for subclasses -- (NSMutableData*) dataForBase58Encoding -{ +- (NSMutableData*) dataForBase58Encoding { return nil; } -- (const char*) base58CString -{ - if (!_cstring) - { +- (const char*) base58CString { + if (!_cstring) { NSMutableData* data = [self dataForBase58Encoding]; _cstring = BTCBase58CheckCStringWithData(data); BTCDataClear(data); @@ -137,57 +122,91 @@ - (const char*) base58CString } // Returns representation in base58 encoding. -- (NSString*) string -{ +- (NSString*) string { const char* cstr = [self base58CString]; if (!cstr) return nil; return [NSString stringWithCString:cstr encoding:NSASCIIStringEncoding]; } -- (NSString*) base58String -{ +- (NSString*) base58String { // deprecated return [self string]; } -- (BTCAddress*) publicAddress -{ +- (BTCAddress*) publicAddress { return self; } -- (BOOL) isTestnet -{ +- (BTCNetwork*) network { + // TODO: use this as a primary source and replace isTestnet + return [self isTestnet] ? [BTCNetwork testnet] : [BTCNetwork mainnet]; +} + +- (BOOL) isTestnet { + // TODO: replace this method with network property exclusively. return NO; } -- (void) clear -{ +- (uint8_t) versionByte { + return [[self class] BTCVersionPrefix]; +} + ++ (uint8_t) BTCVersionPrefix { + [NSException raise:@"BTCAddress BTCVersionPrefix must be accessed via subclasses" format:@""]; + return 0xff; +} + +- (void) clear { BTCSecureClearCString(_cstring); BTCDataClear(_data); } -- (NSString*) description -{ +- (NSString*) description { return [NSString stringWithFormat:@"<%@: %@>", [self class], self.string]; } -- (BOOL) isEqual:(BTCAddress*)other -{ +- (BOOL) isEqual:(BTCAddress*)other { if (![other isKindOfClass:[BTCAddress class]]) return NO; return [self.string isEqualToString:other.string]; } + +// Known Addresses + + ++ (NSMutableDictionary*) registeredAddressClasses { + static dispatch_once_t onceToken; + static NSMutableDictionary* registeredAddressClasses; + dispatch_once(&onceToken, ^{ + registeredAddressClasses = [NSMutableDictionary dictionary]; + }); + return registeredAddressClasses; +} + +// Registers a price source with a given name. ++ (void) registerAddressClass:(Class)addressClass version:(uint8_t)version { + if (!addressClass) return; + [self registeredAddressClasses][@(version)] = addressClass; +} + + @end @implementation BTCPublicKeyAddress ++ (void) load { + [BTCAddress registerAddressClass:self version:[self BTCVersionPrefix]]; +} + ++ (uint8_t) BTCVersionPrefix { + return BTCPublicKeyAddressVersion; +} + #define BTCPublicKeyAddressLength 20 -+ (instancetype) addressWithData:(NSData*)data -{ ++ (instancetype) addressWithData:(NSData*)data { if (!data) return nil; - if (data.length != BTCPublicKeyAddressLength) - { + if (data.length != BTCPublicKeyAddressLength) { NSLog(@"+[BTCPublicKeyAddress addressWithData] cannot init with hash %d bytes long", (int)data.length); return nil; } @@ -196,10 +215,8 @@ + (instancetype) addressWithData:(NSData*)data return addr; } -+ (instancetype) addressWithComposedData:(NSData*)composedData cstring:(const char*)cstring -{ - if (composedData.length != (1 + BTCPublicKeyAddressLength)) - { ++ (instancetype) addressWithComposedData:(NSData*)composedData cstring:(const char*)cstring version:(uint8_t)version { + if (composedData.length != (1 + BTCPublicKeyAddressLength)) { NSLog(@"BTCPublicKeyAddress: cannot init with %d bytes (need 20+1 bytes)", (int)composedData.length); return nil; } @@ -209,8 +226,7 @@ + (instancetype) addressWithComposedData:(NSData*)composedData cstring:(const ch return addr; } -- (NSMutableData*) dataForBase58Encoding -{ +- (NSMutableData*) dataForBase58Encoding { NSMutableData* data = [NSMutableData dataWithLength:1 + BTCPublicKeyAddressLength]; char* buf = data.mutableBytes; buf[0] = [self versionByte]; @@ -218,22 +234,19 @@ - (NSMutableData*) dataForBase58Encoding return data; } -- (unsigned char) versionByte -{ - return BTCPublicKeyAddressVersion; -} - @end @implementation BTCPublicKeyAddressTestnet -- (unsigned char) versionByte -{ ++ (void) load { + [BTCAddress registerAddressClass:self version:[self BTCVersionPrefix]]; +} + ++ (uint8_t) BTCVersionPrefix { return BTCPublicKeyAddressVersionTestnet; } -- (BOOL) isTestnet -{ +- (BOOL) isTestnet { return YES; } @@ -249,18 +262,23 @@ @implementation BTCPrivateKeyAddress { BOOL _publicKeyCompressed; } ++ (void) load { + [BTCAddress registerAddressClass:self version:[self BTCVersionPrefix]]; +} + ++ (uint8_t) BTCVersionPrefix { + return BTCPrivateKeyAddressVersion; +} + #define BTCPrivateKeyAddressLength 32 -+ (instancetype) addressWithData:(NSData*)data -{ ++ (instancetype) addressWithData:(NSData*)data { return [self addressWithData:data publicKeyCompressed:NO]; } -+ (instancetype) addressWithData:(NSData*)data publicKeyCompressed:(BOOL)compressedPubkey -{ ++ (instancetype) addressWithData:(NSData*)data publicKeyCompressed:(BOOL)compressedPubkey { if (!data) return nil; - if (data.length != BTCPrivateKeyAddressLength) - { + if (data.length != BTCPrivateKeyAddressLength) { NSLog(@"+[BTCPrivateKeyAddress addressWithData] cannot init with secret of %d bytes long", (int)data.length); return nil; } @@ -270,10 +288,8 @@ + (instancetype) addressWithData:(NSData*)data publicKeyCompressed:(BOOL)compres return addr; } -+ (id) addressWithComposedData:(NSData*)data cstring:(const char*)cstring -{ - if (data.length != (1 + BTCPrivateKeyAddressLength + 1) && data.length != (1 + BTCPrivateKeyAddressLength)) - { ++ (id) addressWithComposedData:(NSData*)data cstring:(const char*)cstring version:(uint8_t)version { + if (data.length != (1 + BTCPrivateKeyAddressLength + 1) && data.length != (1 + BTCPrivateKeyAddressLength)) { NSLog(@"BTCPrivateKeyAddress: cannot init with %d bytes (need 1+32(+1) bytes)", (int)data.length); return nil; } @@ -290,69 +306,58 @@ + (id) addressWithComposedData:(NSData*)data cstring:(const char*)cstring return addr; } -- (BTCKey*) key -{ +- (BTCKey*) key { BTCKey* key = [[BTCKey alloc] initWithPrivateKey:self.data]; key.publicKeyCompressed = self.isPublicKeyCompressed; return key; } -- (BTCAddress*) publicAddress -{ +- (BTCAddress*) publicAddress { return [BTCPublicKeyAddress addressWithData:BTCHash160(self.key.publicKey)]; } // Private key itself is not compressed, but it has extra 0x01 byte to indicate // that derived pubkey must be compressed (as this affects the pubkey address). -- (BOOL) isPublicKeyCompressed -{ +- (BOOL) isPublicKeyCompressed { return _publicKeyCompressed; } -- (void) setPublicKeyCompressed:(BOOL)compressed -{ - if (_publicKeyCompressed != compressed) - { +- (void) setPublicKeyCompressed:(BOOL)compressed { + if (_publicKeyCompressed != compressed) { _publicKeyCompressed = compressed; self.base58CString = NULL; } } -- (NSMutableData*) dataForBase58Encoding -{ +- (NSMutableData*) dataForBase58Encoding { NSMutableData* data = [NSMutableData dataWithLength:1 + BTCPrivateKeyAddressLength + (_publicKeyCompressed ? 1 : 0)]; char* buf = data.mutableBytes; buf[0] = [self versionByte]; memcpy(buf + 1, self.data.bytes, BTCPrivateKeyAddressLength); - if (_publicKeyCompressed) - { + if (_publicKeyCompressed) { // Add extra byte 0x01 in the end. buf[1 + BTCPrivateKeyAddressLength] = (unsigned char)1; } return data; } -- (unsigned char) versionByte -{ - return BTCPrivateKeyAddressVersion; -} - @end @implementation BTCPrivateKeyAddressTestnet -- (unsigned char) versionByte -{ ++ (void) load { + [BTCAddress registerAddressClass:self version:[self BTCVersionPrefix]]; +} + ++ (uint8_t) BTCVersionPrefix { return BTCPrivateKeyAddressVersionTestnet; } -- (BTCAddress*) publicAddress -{ +- (BTCAddress*) publicAddress { return [BTCPublicKeyAddressTestnet addressWithData:BTCHash160(self.key.publicKey)]; } -- (BOOL) isTestnet -{ +- (BOOL) isTestnet { return YES; } @@ -368,13 +373,20 @@ - (BOOL) isTestnet // P2SH address (e.g. 3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8) @implementation BTCScriptHashAddress ++ (void) load { + [BTCAddress registerAddressClass:self version:[self BTCVersionPrefix]]; +} + ++ (uint8_t) BTCVersionPrefix { + return BTCScriptHashAddressVersion; +} + + #define BTCScriptHashAddressLength 20 -+ (instancetype) addressWithData:(NSData*)data -{ ++ (instancetype) addressWithData:(NSData*)data { if (!data) return nil; - if (data.length != BTCScriptHashAddressLength) - { + if (data.length != BTCScriptHashAddressLength) { NSLog(@"+[BTCScriptHashAddress addressWithData] cannot init with hash %d bytes long", (int)data.length); return nil; } @@ -383,21 +395,19 @@ + (instancetype) addressWithData:(NSData*)data return addr; } -+ (id) addressWithComposedData:(NSData*)data cstring:(const char*)cstring -{ - if (data.length != (1 + BTCScriptHashAddressLength)) - { ++ (id) addressWithComposedData:(NSData*)data cstring:(const char*)cstring version:(uint8_t)version { + if (data.length != (1 + BTCScriptHashAddressLength)) { NSLog(@"BTCPublicKeyAddress: cannot init with %d bytes (need 20+1 bytes)", (int)data.length); return nil; } BTCScriptHashAddress* addr = [[self alloc] init]; - addr.data = [NSMutableData dataWithBytes:((const char*)data.bytes) + 1 length:data.length - 1]; + addr.data = [[NSMutableData dataWithBytes:((const char*)data.bytes) + 1 length:data.length - 1] copy]; + NSLog(@"Created P2SH data: %p (%@)", addr.data, addr.data); addr.base58CString = cstring; return addr; } -- (NSMutableData*) dataForBase58Encoding -{ +- (NSMutableData*) dataForBase58Encoding { NSMutableData* data = [NSMutableData dataWithLength:1 + BTCScriptHashAddressLength]; char* buf = data.mutableBytes; buf[0] = [self versionByte]; @@ -405,22 +415,19 @@ - (NSMutableData*) dataForBase58Encoding return data; } -- (unsigned char) versionByte -{ - return BTCScriptHashAddressVersion; -} - @end @implementation BTCScriptHashAddressTestnet -- (unsigned char) versionByte -{ ++ (void) load { + [BTCAddress registerAddressClass:self version:[self BTCVersionPrefix]]; +} + ++ (uint8_t) BTCVersionPrefix { return BTCScriptHashAddressVersionTestnet; } -- (BOOL) isTestnet -{ +- (BOOL) isTestnet { return YES; } diff --git a/CoreBitcoin/BTCAddressSubclass.h b/CoreBitcoin/BTCAddressSubclass.h new file mode 100644 index 00000000..242aaa88 --- /dev/null +++ b/CoreBitcoin/BTCAddressSubclass.h @@ -0,0 +1,10 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +#ifndef CoreBitcoin_BTCAddressSubclass_h +#define CoreBitcoin_BTCAddressSubclass_h + +@interface BTCAddress () +@property(nonatomic, readwrite) NSData* data; +@end + +#endif diff --git a/CoreBitcoin/BTCAssetAddress.h b/CoreBitcoin/BTCAssetAddress.h new file mode 100644 index 00000000..175d534b --- /dev/null +++ b/CoreBitcoin/BTCAssetAddress.h @@ -0,0 +1,8 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +#import "BTCAddress.h" + +@interface BTCAssetAddress : BTCAddress +@property(nonatomic, readonly, nonnull) BTCAddress* bitcoinAddress; ++ (nonnull instancetype) addressWithBitcoinAddress:(nonnull BTCAddress*)btcAddress; +@end diff --git a/CoreBitcoin/BTCAssetAddress.m b/CoreBitcoin/BTCAssetAddress.m new file mode 100644 index 00000000..ec2e10a7 --- /dev/null +++ b/CoreBitcoin/BTCAssetAddress.m @@ -0,0 +1,61 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +#import "BTCAssetAddress.h" +#import "BTCData.h" +#import "BTCBase58.h" + +@interface BTCAssetAddress () +@property(nonatomic, readwrite) BTCAddress* bitcoinAddress; +@end + +// OpenAssets Address, e.g. akB4NBW9UuCmHuepksob6yfZs6naHtRCPNy (corresponds to 16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM) +@implementation BTCAssetAddress + +#define BTCAssetAddressNamespace 0x13 + ++ (void) load { + [BTCAddress registerAddressClass:self version:BTCAssetAddressNamespace]; +} + ++ (instancetype) addressWithBitcoinAddress:(BTCAddress*)btcAddress { + if (!btcAddress) return nil; + BTCAssetAddress* addr = [[self alloc] init]; + addr.bitcoinAddress = btcAddress; + return addr; +} + ++ (instancetype) addressWithString:(NSString*)string { + NSMutableData* composedData = BTCDataFromBase58Check(string); + uint8_t version = ((unsigned char*)composedData.bytes)[0]; + return [self addressWithComposedData:composedData cstring:[string cStringUsingEncoding:NSUTF8StringEncoding] version:version]; +} + ++ (instancetype) addressWithComposedData:(NSData*)composedData cstring:(const char*)cstring version:(uint8_t)version { + if (!composedData) return nil; + if (composedData.length < 2) return nil; + + if (version == BTCAssetAddressNamespace) { // same for testnet and mainnet + BTCAddress* btcAddr = [BTCAddress addressWithString:BTCBase58CheckStringWithData([composedData subdataWithRange:NSMakeRange(1, composedData.length - 1)])]; + return [self addressWithBitcoinAddress:btcAddr]; + } else { + return nil; + } +} + +- (NSMutableData*) dataForBase58Encoding { + NSMutableData* data = [NSMutableData dataWithLength:1]; + char* buf = data.mutableBytes; + buf[0] = BTCAssetAddressNamespace; + [data appendData:[(BTCAssetAddress* /* cast only to expose the method that is defined in BTCAddress anyway */)self.bitcoinAddress dataForBase58Encoding]]; + return data; +} + +- (unsigned char) versionByte { + return BTCAssetAddressNamespace; +} + +- (BOOL) isTestnet { + return self.bitcoinAddress.isTestnet; +} + +@end diff --git a/CoreBitcoin/BTCAssetID.h b/CoreBitcoin/BTCAssetID.h new file mode 100644 index 00000000..1a40ad49 --- /dev/null +++ b/CoreBitcoin/BTCAssetID.h @@ -0,0 +1,11 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +#import "BTCAddress.h" + +@interface BTCAssetID : BTCAddress + ++ (nullable instancetype) assetIDWithHash:(nullable NSData*)data; + ++ (nullable instancetype) assetIDWithString:(nullable NSString*)string; + +@end diff --git a/CoreBitcoin/BTCAssetID.m b/CoreBitcoin/BTCAssetID.m new file mode 100644 index 00000000..b25bb5f0 --- /dev/null +++ b/CoreBitcoin/BTCAssetID.m @@ -0,0 +1,57 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +#import "BTCAssetID.h" +#import "BTCAddressSubclass.h" + +static const uint8_t BTCAssetIDVersionMainnet = 23; // "A" prefix +static const uint8_t BTCAssetIDVersionTestnet = 115; + +@implementation BTCAssetID + ++ (void) load { + [BTCAddress registerAddressClass:self version:BTCAssetIDVersionMainnet]; + [BTCAddress registerAddressClass:self version:BTCAssetIDVersionTestnet]; +} + +#define BTCAssetIDLength 20 + ++ (instancetype) assetIDWithString:(NSString*)string { + return [self addressWithString:string]; +} + ++ (instancetype) assetIDWithHash:(NSData*)data { + if (!data) return nil; + if (data.length != BTCAssetIDLength) { + NSLog(@"+[BTCAssetID addressWithData] cannot init with hash %d bytes long", (int)data.length); + return nil; + } + BTCAssetID* addr = [[self alloc] init]; + addr.data = [NSMutableData dataWithData:data]; + return addr; +} + ++ (instancetype) addressWithComposedData:(NSData*)composedData cstring:(const char*)cstring version:(uint8_t)version { + if (composedData.length != (1 + BTCAssetIDLength)) { + NSLog(@"BTCAssetID: cannot init with %d bytes (need 20+1 bytes)", (int)composedData.length); + return nil; + } + BTCAssetID* addr = [[self alloc] init]; + addr.data = [[NSMutableData alloc] initWithBytes:((const char*)composedData.bytes) + 1 length:composedData.length - 1]; + return addr; +} + +- (NSMutableData*) dataForBase58Encoding { + NSMutableData* data = [NSMutableData dataWithLength:1 + BTCAssetIDLength]; + char* buf = data.mutableBytes; + buf[0] = [self versionByte]; + memcpy(buf + 1, self.data.bytes, BTCAssetIDLength); + return data; +} + +- (uint8_t) versionByte { +// TODO: support testnet + return BTCAssetIDVersionMainnet; +} + + +@end diff --git a/CoreBitcoin/BTCAssetType.h b/CoreBitcoin/BTCAssetType.h new file mode 100644 index 00000000..e5445826 --- /dev/null +++ b/CoreBitcoin/BTCAssetType.h @@ -0,0 +1,6 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +#import + +extern NSString* __nonnull const BTCAssetTypeBitcoin; +extern NSString* __nonnull const BTCAssetTypeOpenAssets; diff --git a/CoreBitcoin/BTCAssetType.m b/CoreBitcoin/BTCAssetType.m new file mode 100644 index 00000000..3d338c04 --- /dev/null +++ b/CoreBitcoin/BTCAssetType.m @@ -0,0 +1,6 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +#import "BTCAssetType.h" + +NSString* __nonnull const BTCAssetTypeBitcoin = @"bitcoin"; +NSString* __nonnull const BTCAssetTypeOpenAssets = @"openassets"; diff --git a/CoreBitcoin/BTCBase58+Tests.m b/CoreBitcoin/BTCBase58+Tests.m index 85abd30a..a62de17a 100644 --- a/CoreBitcoin/BTCBase58+Tests.m +++ b/CoreBitcoin/BTCBase58+Tests.m @@ -3,8 +3,7 @@ #import "BTCBase58+Tests.h" #import "BTCData.h" -void BTCAssertHexEncodesToBase58(NSString* hex, NSString* base58) -{ +void BTCAssertHexEncodesToBase58(NSString* hex, NSString* base58) { NSData* data = BTCDataFromHex(hex); // Encode @@ -15,15 +14,13 @@ void BTCAssertHexEncodesToBase58(NSString* hex, NSString* base58) NSCAssert([data2 isEqual:data], @"should decode base58 correctly"); } -void BTCAssertDetectsInvalidBase58(NSString* text) -{ +void BTCAssertDetectsInvalidBase58(NSString* text) { NSData *data = BTCDataFromBase58Check(text); NSCAssert(data == nil, @"should return nil if base58 is invalid"); } -void BTCBase58RunAllTests() -{ +void BTCBase58RunAllTests() { BTCAssertDetectsInvalidBase58(nil); BTCAssertDetectsInvalidBase58(@" "); BTCAssertDetectsInvalidBase58(@"lLoO"); @@ -46,18 +43,15 @@ void BTCBase58RunAllTests() BTCAssertHexEncodesToBase58(@"10c8511e", @"Rt5zm"); BTCAssertHexEncodesToBase58(@"00000000000000000000", @"1111111111"); - if ((0)) - { + if ((0)) { // Search for vanity prefix NSString* prefix = @"s"; NSData* payload = BTCRandomDataWithLength(32); - for (uint32_t i = 0x10000000; i <= UINT32_MAX; i++) - { + for (uint32_t i = 0x10000000; i <= UINT32_MAX; i++) { int j = 10; NSString* serialization = nil; - do - { + do { NSMutableData* data = [NSMutableData data]; uint32_t idx = 0; @@ -71,8 +65,7 @@ void BTCBase58RunAllTests() } while ([serialization hasPrefix:prefix] && j-- > 0); - if ([serialization hasPrefix:prefix]) - { + if ([serialization hasPrefix:prefix]) { NSLog(@"integer for prefix %@ is %d", prefix, i); break; } diff --git a/CoreBitcoin/BTCBase58.m b/CoreBitcoin/BTCBase58.m index 70760e8e..7e8a0bd1 100644 --- a/CoreBitcoin/BTCBase58.m +++ b/CoreBitcoin/BTCBase58.m @@ -6,18 +6,15 @@ static const char* BTCBase58Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -NSMutableData* BTCDataFromBase58(NSString* string) -{ +NSMutableData* BTCDataFromBase58(NSString* string) { return BTCDataFromBase58CString([string cStringUsingEncoding:NSASCIIStringEncoding]); } -NSMutableData* BTCDataFromBase58Check(NSString* string) -{ +NSMutableData* BTCDataFromBase58Check(NSString* string) { return BTCDataFromBase58CheckCString([string cStringUsingEncoding:NSASCIIStringEncoding]); } -NSMutableData* BTCDataFromBase58CString(const char* cstring) -{ +NSMutableData* BTCDataFromBase58CString(const char* cstring) { if (cstring == NULL) return nil; // empty string -> empty data. @@ -41,15 +38,12 @@ // Convert big endian string to bignum - for (const char* p = cstring; *p; p++) - { + for (const char* p = cstring; *p; p++) { const char* p1 = strchr(BTCBase58Alphabet, *p); - if (p1 == NULL) - { + if (p1 == NULL) { while (isspace(*p)) p++; - if (*p != '\0') - { + if (*p != '\0') { finish(); return nil; } @@ -58,14 +52,12 @@ BN_set_word(&bnChar, (BN_ULONG)(p1 - BTCBase58Alphabet)); - if (!BN_mul(&bn, &bn, &bn58, pctx)) - { + if (!BN_mul(&bn, &bn, &bn58, pctx)) { finish(); return nil; } - if (!BN_add(&bn, &bn, &bnChar)) - { + if (!BN_add(&bn, &bn, &bnChar)) { finish(); return nil; } @@ -76,12 +68,9 @@ NSMutableData* bndata = nil; { size_t bnsize = BN_bn2mpi(&bn, NULL); - if (bnsize <= 4) - { + if (bnsize <= 4) { bndata = [NSMutableData data]; - } - else - { + } else { bndata = [NSMutableData dataWithLength:bnsize]; BN_bn2mpi(&bn, bndata.mutableBytes); [bndata replaceBytesInRange:NSMakeRange(0, 4) withBytes:NULL length:0]; @@ -93,8 +82,7 @@ // Trim off sign byte if present if (bnsize >= 2 && ((unsigned char*)bndata.bytes)[bnsize - 1] == 0 - && ((unsigned char*)bndata.bytes)[bnsize - 2] >= 0x80) - { + && ((unsigned char*)bndata.bytes)[bnsize - 2] >= 0x80) { bnsize -= 1; [bndata setLength:bnsize]; } @@ -117,21 +105,18 @@ return result; } -NSMutableData* BTCDataFromBase58CheckCString(const char* cstring) -{ +NSMutableData* BTCDataFromBase58CheckCString(const char* cstring) { if (cstring == NULL) return nil; NSMutableData* result = BTCDataFromBase58CString(cstring); size_t length = result.length; - if (length < 4) - { + if (length < 4) { return nil; } NSData* hash = BTCHash256([result subdataWithRange:NSMakeRange(0, length - 4)]); // Last 4 bytes should be equal first 4 bytes of the hash. - if (memcmp(hash.bytes, result.bytes + length - 4, 4) != 0) - { + if (memcmp(hash.bytes, result.bytes + length - 4, 4) != 0) { return nil; } [result setLength:length - 4]; @@ -139,8 +124,7 @@ } -char* BTCBase58CStringWithData(NSData* data) -{ +char* BTCBase58CStringWithData(NSData* data) { if (!data) return NULL; BN_CTX* pctx = BN_CTX_new(); @@ -188,10 +172,8 @@ // use 138% to be safe NSMutableData* stringData = [NSMutableData dataWithCapacity:data.length*138/100 + 1]; - while (BN_cmp(&bn, &bn0) > 0) - { - if (!BN_div(&dv, &rem, &bn, &bn58, pctx)) - { + while (BN_cmp(&bn, &bn0) > 0) { + if (!BN_div(&dv, &rem, &bn, &bn58, pctx)) { finish(); return nil; } @@ -204,8 +186,7 @@ // Leading zeroes encoded as base58 ones ("1") const unsigned char* pbegin = data.bytes; const unsigned char* pend = data.bytes + data.length; - for (const unsigned char* p = pbegin; p < pend && *p == 0; p++) - { + for (const unsigned char* p = pbegin; p < pend && *p == 0; p++) { [stringData appendBytes:BTCBase58Alphabet + 0 length:1]; } @@ -221,8 +202,7 @@ } // String in Base58 with checksum -char* BTCBase58CheckCStringWithData(NSData* immutabledata) -{ +char* BTCBase58CheckCStringWithData(NSData* immutabledata) { if (!immutabledata) return NULL; // add 4-byte hash check to the end NSMutableData* data = [immutabledata mutableCopy]; @@ -233,8 +213,7 @@ return result; } -NSString* BTCBase58StringWithData(NSData* data) -{ +NSString* BTCBase58StringWithData(NSData* data) { if (!data) return nil; char* s = BTCBase58CStringWithData(data); id r = [NSString stringWithCString:s encoding:NSASCIIStringEncoding]; @@ -244,8 +223,7 @@ } -NSString* BTCBase58CheckStringWithData(NSData* data) -{ +NSString* BTCBase58CheckStringWithData(NSData* data) { if (!data) return nil; char* s = BTCBase58CheckCStringWithData(data); id r = [NSString stringWithCString:s encoding:NSASCIIStringEncoding]; diff --git a/CoreBitcoin/BTCBigNumber+Tests.m b/CoreBitcoin/BTCBigNumber+Tests.m index 49aa65fc..83a48ccc 100644 --- a/CoreBitcoin/BTCBigNumber+Tests.m +++ b/CoreBitcoin/BTCBigNumber+Tests.m @@ -5,8 +5,7 @@ @implementation BTCBigNumber (Tests) -+ (void) runAllTests -{ ++ (void) runAllTests { NSAssert([[[BTCBigNumber alloc] init] isEqual:[BTCBigNumber zero]], @"default bignum should be zero"); NSAssert(![[[BTCBigNumber alloc] init] isEqual:[BTCBigNumber one]], @"default bignum should not be one"); NSAssert([@"0" isEqualToString:[[[BTCBigNumber alloc] init] stringInBase:10]], @"default bignum should be zero"); diff --git a/CoreBitcoin/BTCBigNumber.h b/CoreBitcoin/BTCBigNumber.h index b0c21b18..413cd9e1 100644 --- a/CoreBitcoin/BTCBigNumber.h +++ b/CoreBitcoin/BTCBigNumber.h @@ -32,6 +32,10 @@ // To modify, use [[bn mutableCopy] mutableBIGNUM] methods. @property(nonatomic, readonly) const BIGNUM* BIGNUM; +@property(nonatomic, readonly) BOOL isZero; +@property(nonatomic, readonly) BOOL isOne; + + // BTCBigNumber returns always the same object for these constants. // BTCMutableBigNumber returns a new object every time. + (instancetype) zero; // 0 @@ -135,5 +139,7 @@ - (instancetype) lshift:(unsigned int)shift; // <<= - (instancetype) rshift:(unsigned int)shift; // >>= - (instancetype) inverseMod:(BTCBigNumber*)mod; // (a^-1) mod n +- (instancetype) exp:(BTCBigNumber*)power; +- (instancetype) exp:(BTCBigNumber*)power mod:(BTCBigNumber *)mod; @end diff --git a/CoreBitcoin/BTCBigNumber.m b/CoreBitcoin/BTCBigNumber.m index cda094a1..4df4968e 100644 --- a/CoreBitcoin/BTCBigNumber.m +++ b/CoreBitcoin/BTCBigNumber.m @@ -151,60 +151,58 @@ - (const BIGNUM*) BIGNUM { return &_bignum; } +- (BOOL) isZero { + return BN_is_zero(&_bignum); +} + +- (BOOL) isOne { + return BN_is_one(&_bignum); +} + #pragma mark - NSObject -- (BTCBigNumber*) copy -{ +- (BTCBigNumber*) copy { return [self copyWithZone:nil]; } -- (BTCMutableBigNumber*) mutableCopy -{ +- (BTCMutableBigNumber*) mutableCopy { return [self mutableCopyWithZone:nil]; } -- (BTCBigNumber*) copyWithZone:(NSZone *)zone -{ +- (BTCBigNumber*) copyWithZone:(NSZone *)zone { BTCBigNumber* to = [[BTCBigNumber alloc] init]; - if (BN_copy(&(to->_bignum), &_bignum)) - { + if (BN_copy(&(to->_bignum), &_bignum)) { return to; } return nil; } -- (BTCMutableBigNumber*) mutableCopyWithZone:(NSZone *)zone -{ +- (BTCMutableBigNumber*) mutableCopyWithZone:(NSZone *)zone { BTCMutableBigNumber* to = [[BTCMutableBigNumber alloc] init]; - if (BN_copy(&(to->_bignum), &_bignum)) - { + if (BN_copy(&(to->_bignum), &_bignum)) { return to; } return nil; } -- (BOOL) isEqual:(BTCBigNumber*)other -{ +- (BOOL) isEqual:(BTCBigNumber*)other { if (![other isKindOfClass:[BTCBigNumber class]]) return NO; return BTCBigNumberCompare(self, other) == NSOrderedSame; } -- (NSComparisonResult)compare:(BTCBigNumber *)other -{ +- (NSComparisonResult)compare:(BTCBigNumber *)other { return BTCBigNumberCompare(self, other); } -- (NSUInteger)hash -{ +- (NSUInteger)hash { return (NSUInteger)BN_get_word(&_bignum); } -- (NSString*) description -{ +- (NSString*) description { return [NSString stringWithFormat:@"<%@:0x%p 0x%@ (%@)>", [self class], self, [self stringInBase:16], [self stringInBase:10]]; } @@ -214,13 +212,11 @@ - (NSString*) description #pragma mark - Comparison -- (BTCBigNumber*) min:(BTCBigNumber*)other -{ +- (BTCBigNumber*) min:(BTCBigNumber*)other { return (BTCBigNumberCompare(self, other) <= 0) ? self : other; } -- (BTCBigNumber*) max:(BTCBigNumber*)other -{ +- (BTCBigNumber*) max:(BTCBigNumber*)other { return (BTCBigNumberCompare(self, other) >= 0) ? self : other; } @@ -237,30 +233,25 @@ - (BOOL) greaterOrEqual:(BTCBigNumber *)other { return BTCBigNumberCompare(self, -- (NSString*) hexString -{ +- (NSString*) hexString { return [self stringInBase:16]; } -- (void) setHexString:(NSString *)hexString -{ +- (void) setHexString:(NSString *)hexString { [self throwIfImmutable]; [self setString:hexString base:16]; } -- (NSString*) decimalString -{ +- (NSString*) decimalString { return [self stringInBase:10]; } -- (void) setDecimalString:(NSString *)decimalString -{ +- (void) setDecimalString:(NSString *)decimalString { [self throwIfImmutable]; [self setString:decimalString base:10]; } -- (void) setString:(NSString*)string base:(NSUInteger)base -{ +- (void) setString:(NSString*)string base:(NSUInteger)base { [self throwIfImmutable]; if (base > 36 || base < 2) return; @@ -273,8 +264,7 @@ - (void) setString:(NSString*)string base:(NSUInteger)base while (isspace(*psz)) psz++; bool isNegative = false; - if (*psz == '-') - { + if (*psz == '-') { isNegative = true; psz++; } @@ -313,39 +303,27 @@ - (void) setString:(NSString*)string base:(NSUInteger)base BN_CTX* pctx = NULL; BIGNUM bnBase; BN_init(&bnBase); BN_set_word(&bnBase, (BN_ULONG)base); - while (1) - { + while (1) { unsigned char c = (unsigned char)*psz++; if (c == 0) break; // break when null-terminator is hit - if (c != 0x20) // skip space - { + if (c != 0x20) { // skip space + int n = digits[c]; if (n == 0 && c != 0x30) break; // discard characters outside the 36-char range if (n >= base) break; // discard character outside the base range. - if (base == 16) - { + if (base == 16) { BN_lshift(&_bignum, &_bignum, 4); - } - else if (base == 8) - { + } else if (base == 8) { BN_lshift(&_bignum, &_bignum, 3); - } - else if (base == 4) - { + } else if (base == 4) { BN_lshift(&_bignum, &_bignum, 2); - } - else if (base == 2) - { + } else if (base == 2) { BN_lshift(&_bignum, &_bignum, 1); - } - else if (base == 32) - { + } else if (base == 32) { BN_lshift(&_bignum, &_bignum, 5); - } - else - { + } else { if (!pctx) pctx = BN_CTX_new(); BN_mul(&_bignum, &_bignum, &bnBase, pctx); } @@ -354,8 +332,7 @@ - (void) setString:(NSString*)string base:(NSUInteger)base } } - if (isNegative) - { + if (isNegative) { BN_set_negative(&_bignum, 1); } @@ -363,8 +340,7 @@ - (void) setString:(NSString*)string base:(NSUInteger)base if (pctx) BN_CTX_free(pctx); } -- (NSString*) stringInBase:(NSUInteger)base -{ +- (NSString*) stringInBase:(NSUInteger)base { if (base > 36 || base < 2) return nil; NSMutableData* resultData = nil; @@ -379,16 +355,11 @@ - (NSString*) stringInBase:(NSUInteger)base BIGNUM dv; BN_init(&dv); BIGNUM rem; BN_init(&rem); - if (BN_cmp(&bn, &bn0) == 0) - { + if (BN_cmp(&bn, &bn0) == 0) { resultData = [NSMutableData dataWithBytes:"0" length:1]; - } - else - { - while (BN_cmp(&bn, &bn0) > 0) - { - if (!BN_div(&dv, &rem, &bn, &bnBase, pctx)) - { + } else { + while (BN_cmp(&bn, &bn0) > 0) { + if (!BN_div(&dv, &rem, &bn, &bnBase, pctx)) { NSLog(@"BTCBigNumber: stringInBase failed to BN_div"); break; } @@ -402,8 +373,7 @@ - (NSString*) stringInBase:(NSUInteger)base [resultData replaceBytesInRange:NSMakeRange(0, 0) withBytes:&ch length:1]; } - if (resultData && BN_is_negative(&_bignum)) - { + if (resultData && BN_is_negative(&_bignum)) { unsigned char ch = '-'; [resultData replaceBytesInRange:NSMakeRange(0, 0) withBytes:&ch length:1]; } @@ -441,16 +411,12 @@ - (NSString*) stringInBase:(NSUInteger)base // // This implementation directly uses shifts instead of going // through an intermediate MPI representation. -- (uint32_t) compact -{ +- (uint32_t) compact { uint32_t size = BN_num_bytes(&_bignum); uint32_t result = 0; - if (size <= 3) - { + if (size <= 3) { result = (uint32_t)(BN_get_word(&_bignum) << 8*(3-size)); - } - else - { + } else { BIGNUM bn; BN_init(&bn); BN_rshift(&bn, &_bignum, 8*(size-3)); @@ -458,8 +424,7 @@ - (uint32_t) compact } // The 0x00800000 bit denotes the sign. // Thus, if it is already set, divide the mantissa by 256 and increase the exponent. - if (result & 0x00800000) - { + if (result & 0x00800000) { result >>= 8; size++; } @@ -468,48 +433,38 @@ - (uint32_t) compact return result; } -- (void) setCompact:(uint32_t)value -{ +- (void) setCompact:(uint32_t)value { [self throwIfImmutable]; unsigned int size = value >> 24; bool isNegative = (value & 0x00800000) != 0; unsigned int word = value & 0x007fffff; - if (size <= 3) - { + if (size <= 3) { word >>= 8*(3-size); BN_set_word(&_bignum, word); - } - else - { + } else { BN_set_word(&_bignum, word); BN_lshift(&_bignum, &_bignum, 8*(size-3)); } BN_set_negative(&_bignum, isNegative); } -- (uint32_t) uint32value -{ +- (uint32_t) uint32value { return (uint32_t)BN_get_word(&_bignum); } -- (void) setUint32value:(uint32_t)value -{ +- (void) setUint32value:(uint32_t)value { [self throwIfImmutable]; BN_set_word(&_bignum, value); } -- (int32_t) int32value -{ +- (int32_t) int32value { uint32_t value = [self uint32value]; - if (!BN_is_negative(&_bignum)) - { + if (!BN_is_negative(&_bignum)) { if (value > INT32_MAX) return INT32_MAX; else return value; - } - else - { + } else { if (value > INT32_MAX) return INT32_MIN; else @@ -517,42 +472,33 @@ - (int32_t) int32value } } -- (void) setInt32value:(int32_t)value -{ +- (void) setInt32value:(int32_t)value { [self throwIfImmutable]; - if (value >= 0) - { + if (value >= 0) { self.uint32value = value; - } - else - { + } else { self.int64value = value; } } -- (uint64_t) uint64value -{ +- (uint64_t) uint64value { return (uint64_t)BN_get_word(&_bignum); } -- (int64_t) int64value -{ +- (int64_t) int64value { return (int64_t)BN_get_word(&_bignum); } -- (void) setUint64value:(uint64_t)value -{ +- (void) setUint64value:(uint64_t)value { [self throwIfImmutable]; [self setUint64valuePrivate:value negative:NO]; } -- (void) setInt64value:(int64_t)value -{ +- (void) setInt64value:(int64_t)value { [self throwIfImmutable]; bool isNegative = NO; uint64_t uintValue; - if (value < 0) - { + if (value < 0) { // Since the minimum signed integer cannot be represented as // positive so long as its type is signed, and it's not well-defined // what happens if you make it unsigned before negating it, we @@ -561,36 +507,30 @@ - (void) setInt64value:(int64_t)value uintValue = -(value + 1); ++uintValue; isNegative = YES; - } - else - { + } else { uintValue = value; } [self setUint64valuePrivate:uintValue negative:isNegative]; } -- (void) setUint64valuePrivate:(uint64_t)value negative:(BOOL)isNegative -{ +- (void) setUint64valuePrivate:(uint64_t)value negative:(BOOL)isNegative { // Numbers are represented in OpenSSL using the MPI format. 4 byte length. unsigned char rawMPI[sizeof(value) + 6]; unsigned char* currentByte = &rawMPI[4]; BOOL leadingZeros = YES; - for (int i = 0; i < 8; ++i) - { + for (int i = 0; i < 8; ++i) { uint8_t c = (value >> 56) & 0xff; value <<= 8; - if (leadingZeros) - { + if (leadingZeros) { if (c == 0) continue; // Skip beginning zeros - if (c & 0x80) - { + if (c & 0x80) { *currentByte = (isNegative ? 0x80 : 0); ++currentByte; - } - else if (isNegative) + } else if (isNegative) { c |= 0x80; + } leadingZeros = false; } *currentByte = c; @@ -604,11 +544,9 @@ - (void) setUint64valuePrivate:(uint64_t)value negative:(BOOL)isNegative BN_mpi2bn(rawMPI, (int)(currentByte - rawMPI), &_bignum); } -- (NSData*) signedLittleEndian -{ +- (NSData*) signedLittleEndian { size_t size = BN_bn2mpi(&_bignum, NULL); - if (size <= 4) - { + if (size <= 4) { return [NSData data]; } NSMutableData* data = [NSMutableData dataWithLength:size]; @@ -618,8 +556,7 @@ - (NSData*) signedLittleEndian return data; } -- (void) setSignedLittleEndian:(NSData *)data -{ +- (void) setSignedLittleEndian:(NSData *)data { [self throwIfImmutable]; NSUInteger size = data.length; NSMutableData* mdata = [data mutableCopy]; @@ -718,33 +655,27 @@ @implementation BTCMutableBigNumber @dynamic littleEndianData; @dynamic unsignedData; -- (BIGNUM*) mutableBIGNUM -{ +- (BIGNUM*) mutableBIGNUM { return &(self->_bignum); } -+ (instancetype) zero -{ ++ (instancetype) zero { return [[BTCBigNumber zero] mutableCopy]; } -+ (instancetype) one -{ ++ (instancetype) one { return [[BTCBigNumber one] mutableCopy]; } -+ (instancetype) negativeOne -{ ++ (instancetype) negativeOne { return [[BTCBigNumber negativeOne] mutableCopy]; } // We are mutable, disable checks. -- (void) throwIfImmutable -{ +- (void) throwIfImmutable { } -- (void) setString:(NSString*)string base:(NSUInteger)base -{ +- (void) setString:(NSString*)string base:(NSUInteger)base { [super setString:string base:base]; } @@ -752,80 +683,69 @@ - (void) setString:(NSString*)string base:(NSUInteger)base #pragma mark - Operations -- (instancetype) add:(BTCBigNumber*)other // += -{ +- (instancetype) add:(BTCBigNumber*)other { // += BN_add(&(self->_bignum), &(self->_bignum), &(other->_bignum)); return self; } -- (instancetype) add:(BTCBigNumber*)other mod:(BTCBigNumber*)mod -{ +- (instancetype) add:(BTCBigNumber*)other mod:(BTCBigNumber*)mod { BN_CTX* pctx = BN_CTX_new(); BN_mod_add(&(self->_bignum), &(self->_bignum), &(other->_bignum), &(mod->_bignum), pctx); BN_CTX_free(pctx); return self; } -- (instancetype) subtract:(BTCBigNumber *)other // -= -{ +- (instancetype) subtract:(BTCBigNumber *)other { // -= BN_sub(&(self->_bignum), &(self->_bignum), &(other->_bignum)); return self; } -- (instancetype) subtract:(BTCBigNumber*)other mod:(BTCBigNumber*)mod -{ +- (instancetype) subtract:(BTCBigNumber*)other mod:(BTCBigNumber*)mod { BN_CTX* pctx = BN_CTX_new(); BN_mod_sub(&(self->_bignum), &(self->_bignum), &(other->_bignum), &(mod->_bignum), pctx); BN_CTX_free(pctx); return self; } -- (instancetype) multiply:(BTCBigNumber*)other // *= -{ +- (instancetype) multiply:(BTCBigNumber*)other { // *= BN_CTX* pctx = BN_CTX_new(); BN_mul(&(self->_bignum), &(self->_bignum), &(other->_bignum), pctx); BN_CTX_free(pctx); return self; } -- (instancetype) multiply:(BTCBigNumber*)other mod:(BTCBigNumber *)mod -{ +- (instancetype) multiply:(BTCBigNumber*)other mod:(BTCBigNumber *)mod { BN_CTX* pctx = BN_CTX_new(); BN_mod_mul(&(self->_bignum), &(self->_bignum), &(other->_bignum), &(mod->_bignum), pctx); BN_CTX_free(pctx); return self; } -- (instancetype) divide:(BTCBigNumber*)other // /= -{ +- (instancetype) divide:(BTCBigNumber*)other { // /= BN_CTX* pctx = BN_CTX_new(); BN_div(&(self->_bignum), NULL, &(self->_bignum), &(other->_bignum), pctx); BN_CTX_free(pctx); return self; } -- (instancetype) mod:(BTCBigNumber*)other // %= -{ +- (instancetype) mod:(BTCBigNumber*)other { // %= BN_CTX* pctx = BN_CTX_new(); BN_div(NULL, &(self->_bignum), &(self->_bignum), &(other->_bignum), pctx); BN_CTX_free(pctx); return self; } -- (instancetype) lshift:(unsigned int)shift // <<= -{ +- (instancetype) lshift:(unsigned int)shift { // <<= BN_lshift(&(self->_bignum), &(self->_bignum), shift); return self; } -- (instancetype) rshift:(unsigned int)shift // >>= -{ +- (instancetype) rshift:(unsigned int)shift { // >>= // Note: BN_rshift segfaults on 64-bit if 2^shift is greater than the number // if built on ubuntu 9.04 or 9.10, probably depends on version of OpenSSL BTCMutableBigNumber* a = [BTCMutableBigNumber one]; [a lshift:shift]; - if (BN_cmp(&(a->_bignum), &(self->_bignum)) > 0) - { + if (BN_cmp(&(a->_bignum), &(self->_bignum)) > 0) { BN_zero(&(self->_bignum)); return self; } @@ -834,14 +754,29 @@ - (instancetype) rshift:(unsigned int)shift // >>= return self; } -- (instancetype) inverseMod:(BTCBigNumber*)mod // (a^-1) mod n -{ +- (instancetype) inverseMod:(BTCBigNumber*)mod { // (a^-1) mod n BN_CTX* pctx = BN_CTX_new(); BN_mod_inverse(&(self->_bignum), &(self->_bignum), &(mod->_bignum), pctx); BN_CTX_free(pctx); return self; } +- (instancetype) exp:(BTCBigNumber*)power { // pow(self, p) + BN_CTX* pctx = BN_CTX_new(); + BN_exp(&(self->_bignum), &(self->_bignum), &(power->_bignum), pctx); + BN_CTX_free(pctx); + return self; +} + +- (instancetype) exp:(BTCBigNumber*)power mod:(BTCBigNumber *)mod { // pow(self,p) % m + BN_CTX* pctx = BN_CTX_new(); + BN_mod_exp(&(self->_bignum), &(self->_bignum), &(power->_bignum), &(mod->_bignum), pctx); + BN_CTX_free(pctx); + return self; +} + + + @end diff --git a/CoreBitcoin/BTCBitcoinURL+Tests.h b/CoreBitcoin/BTCBitcoinURL+Tests.h new file mode 100644 index 00000000..0899d829 --- /dev/null +++ b/CoreBitcoin/BTCBitcoinURL+Tests.h @@ -0,0 +1,17 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + +// +// BTCBitcoinURL+Tests.h +// CoreBitcoin +// +// Created by Oleg Andreev on 02.04.2015. +// Copyright (c) 2015 Oleg Andreev. All rights reserved. +// + +#import "BTCBitcoinURL.h" + +@interface BTCBitcoinURL (Tests) + ++ (void) runAllTests; + +@end diff --git a/CoreBitcoin/BTCBitcoinURL+Tests.m b/CoreBitcoin/BTCBitcoinURL+Tests.m new file mode 100644 index 00000000..e7f2db4c --- /dev/null +++ b/CoreBitcoin/BTCBitcoinURL+Tests.m @@ -0,0 +1,87 @@ +// +// BTCBitcoinURL+Tests.m +// CoreBitcoin +// +// Created by Oleg Andreev on 02.04.2015. +// Copyright (c) 2015 Oleg Andreev. All rights reserved. +// + +#import "BTCBitcoinURL+Tests.h" +#import "BTCAddress.h" + +@implementation BTCBitcoinURL (Tests) + ++ (void) runAllTests { + + [self testSimpleURL]; + [self testCompatiblePaymentRequest]; + [self testNakedPaymentRequest]; + [self testInvalidURL]; + [self testMalformedURL]; +} + ++ (void) testSimpleURL { + BTCBitcoinURL* burl = [[BTCBitcoinURL alloc] initWithURL:[NSURL URLWithString:@"bitcoin:1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T?amount=1.23450009&label=Hello%20world"]]; + NSAssert(burl, @"Must parse"); + NSAssert(burl.isValid == YES, @"Must be valid"); + NSAssert(burl.amount == 123450009, @"Must parse amount formatted as btc"); + NSAssert([burl.address.string isEqual:@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T"], @"Must parse address"); + NSAssert(burl.paymentRequestURL == nil, @"Must parse payment request"); + NSAssert([burl.label isEqualToString:@"Hello world"], @"Must parse label"); + NSAssert([burl.queryParameters[@"label"] isEqualToString:@"Hello world"], @"Must provide raw query items access"); + NSAssert([burl.queryParameters[@"amount"] isEqualToString:@"1.23450009"], @"Must provide raw query items access"); + NSAssert([burl[@"label"] isEqualToString:@"Hello world"], @"Must provide raw query items access"); + NSAssert([burl[@"amount"] isEqualToString:@"1.23450009"], @"Must provide raw query items access"); +} + ++ (void) testCompatiblePaymentRequest { + BTCBitcoinURL* burl = [[BTCBitcoinURL alloc] initWithURL:[NSURL URLWithString:@"bitcoin:1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T?amount=1.23450009&r=http://example.com/order-1000123"]]; + NSAssert(burl, @"Must parse"); + NSAssert(burl.isValid == YES, @"Must be valid"); + NSAssert(burl.amount == 123450009, @"Must parse amount formatted as btc"); + NSAssert([burl.address.string isEqual:@"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T"], @"Must parse address"); + NSAssert([burl.paymentRequestURL.absoluteString isEqual:@"http://example.com/order-1000123"], @"Must parse payment request"); +} + ++ (void) testNakedPaymentRequest { + BTCBitcoinURL* burl = [[BTCBitcoinURL alloc] initWithURL:[NSURL URLWithString:@"bitcoin:?r=http://example.com/order-1000123"]]; + NSAssert(burl, @"Must parse"); + NSAssert(burl.isValid == YES, @"Must be valid"); + NSAssert(burl.amount == 0, @"Default amount is zero"); + NSAssert(burl.address == nil, @"Default address is nil"); + NSAssert([burl.paymentRequestURL.absoluteString isEqual:@"http://example.com/order-1000123"], @"Must parse payment request"); +} + ++ (void) testInvalidURL { + { + BTCBitcoinURL* burl = [[BTCBitcoinURL alloc] initWithURL:[NSURL URLWithString:@"bitcoin:?x=something"]]; + NSAssert(burl, @"Must parse"); + NSAssert(burl.isValid == NO, @"Must not be valid"); + NSAssert(burl.amount == 0, @"Default amount is zero"); + NSAssert(burl.address == nil, @"Default address is nil"); + NSAssert(burl.paymentRequestURL == nil, @"Must have nil payment request"); + NSAssert([burl[@"x"] isEqual: @"something"], @"Must have query item"); + } + + { + BTCBitcoinURL* burl = [[BTCBitcoinURL alloc] initWithURL:[NSURL URLWithString:@"bitcoin:?amount=1.2"]]; + NSAssert(burl, @"Must parse"); + NSAssert(burl.isValid == NO, @"Must not be valid"); + NSAssert(burl.amount == 120000000, @"Must parse amount"); + NSAssert(burl.address == nil, @"Default address is nil"); + NSAssert(burl.paymentRequestURL == nil, @"Must have nil payment request"); + NSAssert([burl[@"amount"] isEqual: @"1.2"], @"Must have query item"); + } +} + ++ (void) testMalformedURL { + { + BTCBitcoinURL* burl = [[BTCBitcoinURL alloc] initWithURL:[NSURL URLWithString:@"bitcoin:xxxx"]]; + NSAssert(!burl, @"Must not parse broken address"); + } + { + BTCBitcoinURL* burl = [[BTCBitcoinURL alloc] initWithURL:[NSURL URLWithString:@"http://example.com"]]; + NSAssert(!burl, @"Must not parse other schemas than bitcoin:"); + } +} +@end diff --git a/CoreBitcoin/BTCBitcoinURL.h b/CoreBitcoin/BTCBitcoinURL.h index edddc41e..18e87fda 100644 --- a/CoreBitcoin/BTCBitcoinURL.h +++ b/CoreBitcoin/BTCBitcoinURL.h @@ -1,7 +1,8 @@ +// CoreBitcoin by Oleg Andreev , WTFPL. + #import #import "BTCUnitsAndLimits.h" -// TODO: support arbitrary keys and values. // TODO: support handling URL from UIApplicationDelegate. /*! @@ -9,61 +10,95 @@ * See: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki */ @class BTCAddress; +@class BTCAssetID; @interface BTCBitcoinURL : NSObject /*! * Encoded address. */ -@property(nonatomic) BTCAddress* address; +@property(nonatomic, nullable) BTCAddress* address; /*! * Amount in satoshis. Default is 0. */ @property(nonatomic) BTCAmount amount; +/*! + * Asset ID for Open Assets URL. + */ +@property(nonatomic, nullable) BTCAssetID* assetID; + /*! * Label. Default is nil. */ -@property(nonatomic) NSString* label; +@property(nonatomic, nullable) NSString* label; /*! * Message. Default is nil. */ -@property(nonatomic) NSString* message; +@property(nonatomic, nullable) NSString* message; + +/*! + * Query parameters. Default is nil. + */ +@property(nonatomic, nonnull) NSDictionary* queryParameters; /*! * Payment request URL (r=...). Default is nil. */ -@property(nonatomic) NSURL* paymentRequestURL; +@property(nonatomic, nullable) NSURL* paymentRequestURL; /*! * Complete URL built from the individual properties. */ -@property(nonatomic, readonly) NSURL* URL; +@property(nonatomic, readonly, nonnull) NSURL* URL; /*! * Returns YES if it has a valid address or paymentRequestURL. */ @property(nonatomic, readonly) BOOL isValid; +/*! + * Returns YES if it is a pure bitcoin URL. That does not specify asset_id and not uses openassets: scheme. + */ +@property(nonatomic, readonly) BOOL isValidBitcoinURL; + +/*! + * Returns YES if it is an Open Assets URL. + */ +@property(nonatomic, readonly) BOOL isValidOpenAssetsURL; + /*! * Makes a URL in form "bitcoin:
?amount=1.2345&label=