diff --git a/Podfile b/Podfile index dffe80c2..f1bcb904 100644 --- a/Podfile +++ b/Podfile @@ -10,7 +10,7 @@ target 'web3swift' do pod 'CryptoSwift' pod 'Sodium' pod 'libsodium' - pod 'secp256k1_ios' + pod 'secp256k1_ios', :git => 'https://github.com/shamatar/secp256k1_ios.git' target 'web3swiftTests' do inherit! :search_paths end diff --git a/Podfile.lock b/Podfile.lock index 5dd32db4..40edaede 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -32,9 +32,18 @@ DEPENDENCIES: - libsodium - PromiseKit (~> 4.4) - PromiseKit/Alamofire (~> 4.0) - - secp256k1_ios + - secp256k1_ios (from `https://github.com/shamatar/secp256k1_ios.git`) - Sodium +EXTERNAL SOURCES: + secp256k1_ios: + :git: https://github.com/shamatar/secp256k1_ios.git + +CHECKOUT OPTIONS: + secp256k1_ios: + :commit: 5485b37b8bf56ab7d24fb09a9d5d7089c5b355e3 + :git: https://github.com/shamatar/secp256k1_ios.git + SPEC CHECKSUMS: Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4 AwaitKit: daf1af84544413a8dfadb4fc25d8b0f9706e5c83 @@ -46,6 +55,6 @@ SPEC CHECKSUMS: SipHash: c6e9e43e9c531b5bc6602545130c26194a6d31ce Sodium: bf524b0a3d5ad6870dcf343205cca7e659c15ad5 -PODFILE CHECKSUM: b7e3342b3886fb758c9969fb39a7970d47f8d515 +PODFILE CHECKSUM: 93b5c3d81d1dade55ad25efc38f4ccd85f195d4f COCOAPODS: 1.3.1 diff --git a/Pods/Local Podspecs/secp256k1_ios.podspec.json b/Pods/Local Podspecs/secp256k1_ios.podspec.json new file mode 100644 index 00000000..8b949ba8 --- /dev/null +++ b/Pods/Local Podspecs/secp256k1_ios.podspec.json @@ -0,0 +1,36 @@ +{ + "name": "secp256k1_ios", + "version": "0.0.5", + "summary": "Reference sepc256k1 implementation as pod", + "description": "secp256k1 libraty portable pod", + "homepage": "https://github.com/shamatar/secp256k1_ios", + "license": "MIT", + "authors": { + "Alex Vlasov": "alex.m.vlasov@gmail.com" + }, + "source": { + "git": "https://github.com/shamatar/secp256k1_ios.git", + "tag": "0.0.5" + }, + "social_media_url": "https://twitter.com/shamatar", + "module_name": "secp256k1_ios", + "platforms": { + "ios": "9.0", + "osx": "10.10" + }, + "pod_target_xcconfig": { + "OTHER_CFLAGS": "-DHAVE_CONFIG_H=1", + "HEADER_SEARCH_PATHS": "\"${PODS_ROOT}/secp256k1_ios/secp256k1_ios/\"" + }, + "private_header_files": "secp256k1_ios/*.h", + "source_files": [ + "secp256k1_ios/**/*.{h,c}", + "secp256k1_ios/*.h", + "secp256k1_ios/**/*.h" + ], + "public_header_files": [ + "secp256k1_ios/include/secp256k1.h", + "secp256k1_ios/include/secp256k1_recovery.h", + "secp256k1_ios/include/secp256k1_ecdh.h" + ] +} diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 5dd32db4..40edaede 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -32,9 +32,18 @@ DEPENDENCIES: - libsodium - PromiseKit (~> 4.4) - PromiseKit/Alamofire (~> 4.0) - - secp256k1_ios + - secp256k1_ios (from `https://github.com/shamatar/secp256k1_ios.git`) - Sodium +EXTERNAL SOURCES: + secp256k1_ios: + :git: https://github.com/shamatar/secp256k1_ios.git + +CHECKOUT OPTIONS: + secp256k1_ios: + :commit: 5485b37b8bf56ab7d24fb09a9d5d7089c5b355e3 + :git: https://github.com/shamatar/secp256k1_ios.git + SPEC CHECKSUMS: Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4 AwaitKit: daf1af84544413a8dfadb4fc25d8b0f9706e5c83 @@ -46,6 +55,6 @@ SPEC CHECKSUMS: SipHash: c6e9e43e9c531b5bc6602545130c26194a6d31ce Sodium: bf524b0a3d5ad6870dcf343205cca7e659c15ad5 -PODFILE CHECKSUM: b7e3342b3886fb758c9969fb39a7970d47f8d515 +PODFILE CHECKSUM: 93b5c3d81d1dade55ad25efc38f4ccd85f195d4f COCOAPODS: 1.3.1 diff --git a/Pods/secp256k1_ios/secp256k1_ios/libsecp256k1-config.h b/Pods/secp256k1_ios/secp256k1_ios/libsecp256k1-config.h index 8f3ac748..11322d84 100644 --- a/Pods/secp256k1_ios/secp256k1_ios/libsecp256k1-config.h +++ b/Pods/secp256k1_ios/secp256k1_ios/libsecp256k1-config.h @@ -13,7 +13,9 @@ #define USE_FIELD_INV_BUILTIN 1 #define USE_SCALAR_INV_BUILTIN 1 #define ENABLE_MODULE_RECOVERY 1 -#ifdef _BIT64 +#ifdef __LP64__ +typedef __int128 int128_t; +typedef unsigned __int128 uint128_t; #define USE_FIELD_5X52 1 #define USE_SCALAR_4X64 1 #else diff --git a/web3Swift-Demo/ViewController.swift b/web3Swift-Demo/ViewController.swift index 96a5f98e..529d6fe0 100644 --- a/web3Swift-Demo/ViewController.swift +++ b/web3Swift-Demo/ViewController.swift @@ -100,8 +100,6 @@ class ViewController: UIViewController { } let res = try await((intermediateSend?.send(network: .Rinkeby))!) print(res) - - } catch{ print(error) diff --git a/web3swift.xcodeproj/project.pbxproj b/web3swift.xcodeproj/project.pbxproj index eff00be3..2c9df95d 100644 --- a/web3swift.xcodeproj/project.pbxproj +++ b/web3swift.xcodeproj/project.pbxproj @@ -743,7 +743,7 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_MODULES = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -784,7 +784,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.1; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -804,7 +804,7 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_MODULES = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -839,7 +839,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.1; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -857,16 +857,13 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; + DEFINES_MODULE = NO; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/web3swift/secp256k1", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = web3swift/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -894,6 +891,7 @@ "-framework", "\"libsodium\"", ); + PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES; PRODUCT_BUNDLE_IDENTIFIER = BF.web3swift; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = NO; @@ -913,16 +911,13 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; + DEFINES_MODULE = NO; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/web3swift/secp256k1", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = web3swift/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -950,6 +945,7 @@ "-framework", "\"libsodium\"", ); + PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES; PRODUCT_BUNDLE_IDENTIFIER = BF.web3swift; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = NO; diff --git a/web3swift/ABI/Classes/ABIDecoder.swift b/web3swift/ABI/Classes/ABIDecoder.swift index 71b2651e..33d1903e 100644 --- a/web3swift/ABI/Classes/ABIDecoder.swift +++ b/web3swift/ABI/Classes/ABIDecoder.swift @@ -144,8 +144,6 @@ extension ABIElement.ParameterType.DynamicType { returnArray.append(value) } return (totalConsumed, returnArray) - default: - return (nil, nil) } return (nil, nil) } diff --git a/web3swift/ABI/Classes/ABIRecordParser.swift b/web3swift/ABI/Classes/ABIRecordParser.swift index b90a7f11..12cb8603 100644 --- a/web3swift/ABI/Classes/ABIRecordParser.swift +++ b/web3swift/ABI/Classes/ABIRecordParser.swift @@ -61,10 +61,7 @@ fileprivate func parseToElement(from abiRecord: ABIRecord, type: ElementType) th case .event: let event = try parseEvent(abiRecord: abiRecord) return ABIElement.event(event) - default: - throw ParsingError.elementTypeInvalid } - throw ParsingError.elementTypeInvalid } fileprivate func parseFunction(abiRecord:ABIRecord) throws -> ABIElement.Function { diff --git a/web3swift/web3swift.h b/web3swift/web3swift.h index 7c2d49c6..4f9d78db 100644 --- a/web3swift/web3swift.h +++ b/web3swift/web3swift.h @@ -5,7 +5,6 @@ // Created by Petr Korolev on 06/12/2017. // Copyright © 2017 Bankex Foundation. All rights reserved. // - #import //! Project version number for web3swift. FOUNDATION_EXPORT double web3swiftVersionNumber;