diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..e094c87 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,60 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + claide (1.0.2) + claide-plugins (0.9.2) + cork + nap + open4 (~> 1.3) + colored2 (3.1.2) + cork (0.3.0) + colored2 (~> 3.1) + danger (5.5.11) + claide (~> 1.0) + claide-plugins (>= 0.9.2) + colored2 (~> 3.1) + cork (~> 0.1) + faraday (~> 0.9) + faraday-http-cache (~> 1.0) + git (~> 1) + kramdown (~> 1.5) + no_proxy_fix + octokit (~> 4.7) + terminal-table (~> 1) + danger-swiftlint (0.16.0) + danger + rake (> 10) + thor (~> 0.19) + faraday (0.14.0) + multipart-post (>= 1.2, < 3) + faraday-http-cache (1.3.1) + faraday (~> 0.8) + git (1.3.0) + kramdown (1.16.2) + multipart-post (2.0.0) + nap (1.1.0) + no_proxy_fix (0.1.2) + octokit (4.8.0) + sawyer (~> 0.8.0, >= 0.5.3) + open4 (1.3.4) + public_suffix (3.0.2) + rake (12.3.1) + sawyer (0.8.1) + addressable (>= 2.3.5, < 2.6) + faraday (~> 0.8, < 1.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thor (0.20.0) + unicode-display_width (1.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + danger + danger-swiftlint + +BUNDLED WITH + 1.16.0 diff --git a/Tests/AddressTests.swift b/Tests/AddressTests.swift index 54fdc32..998bf05 100644 --- a/Tests/AddressTests.swift +++ b/Tests/AddressTests.swift @@ -8,6 +8,11 @@ import TrustCore import XCTest class AddressTests: XCTestCase { + func testInvalid() { + XCTAssertNil(Address(string: "abc")) + XCTAssertNil(Address(eip55: "5aaeb6053f3e94c9b9a09f33669435e7ef1beaed")) + } + func testEIP55() { XCTAssertEqual( Address(string: "5aaeb6053f3e94c9b9a09f33669435e7ef1beaed")!.eip55String, @@ -30,4 +35,9 @@ class AddressTests: XCTestCase { "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb" ) } + + func testDescription() { + let address = Address(string: "5aaeb6053f3e94c9b9a09f33669435e7ef1beaed")! + XCTAssertEqual(address.description, "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed") + } } diff --git a/Tests/RLPTests.swift b/Tests/RLPTests.swift index 0f3a276..ef437c0 100644 --- a/Tests/RLPTests.swift +++ b/Tests/RLPTests.swift @@ -60,4 +60,9 @@ class RLPTests: XCTestCase { print(encoded.hexString) XCTAssert(encoded.hexString.hasPrefix("f90400")) } + + func testInvalid() { + XCTAssertNil(RLP.encode(-1)) + XCTAssertNil(RLP.encode([0, -1])) + } } diff --git a/TrustCore.xcodeproj/project.pbxproj b/TrustCore.xcodeproj/project.pbxproj index 5499545..26ca9cc 100644 --- a/TrustCore.xcodeproj/project.pbxproj +++ b/TrustCore.xcodeproj/project.pbxproj @@ -221,7 +221,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0920; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = Trust; TargetAttributes = { 6149A69F201E433A00A2F35C = { @@ -425,6 +425,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -432,6 +433,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -487,6 +489,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -494,6 +497,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/TrustCore.xcodeproj/xcshareddata/xcschemes/TrustCore.xcscheme b/TrustCore.xcodeproj/xcshareddata/xcschemes/TrustCore.xcscheme index d513595..5216982 100644 --- a/TrustCore.xcodeproj/xcshareddata/xcschemes/TrustCore.xcscheme +++ b/TrustCore.xcodeproj/xcshareddata/xcschemes/TrustCore.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -57,7 +56,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/TrustCore.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/TrustCore.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/TrustCore.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + +