-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from argentlabs/develop
Version 0.1
- Loading branch information
Showing
26 changed files
with
249 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
source "https://rubygems.org" | ||
|
||
#iOS | ||
gem 'cocoapods' | ||
gem 'cocoapods', '1.5.3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
def all_pods | ||
pod 'BigInt', '~> 3.0.1' | ||
pod 'BigInt', '3.1.0' | ||
end | ||
|
||
target 'web3swift' do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
PODS: | ||
- BigInt (3.0.1): | ||
- BigInt (3.1.0): | ||
- SipHash (~> 1.2) | ||
- SipHash (1.2.0) | ||
- SipHash (1.2.2) | ||
|
||
DEPENDENCIES: | ||
- BigInt (~> 3.0.1) | ||
- BigInt (= 3.1.0) | ||
|
||
SPEC REPOS: | ||
https://github.com/cocoapods/specs.git: | ||
- BigInt | ||
- SipHash | ||
|
||
SPEC CHECKSUMS: | ||
BigInt: 8e8a52161c745cd3ab78e3dc346a9fbee51e6cf6 | ||
SipHash: c6e9e43e9c531b5bc6602545130c26194a6d31ce | ||
BigInt: 76b5dfdfa3e2e478d4ffdf161aeede5502e2742f | ||
SipHash: fad90a4683e420c52ef28063063dbbce248ea6d4 | ||
|
||
PODFILE CHECKSUM: 67f19944c0b15799d71ad44aab63ca30fcbd5189 | ||
PODFILE CHECKSUM: 7d6817b2b66ca961a4ac6f21b073018916aa7067 | ||
|
||
COCOAPODS: 1.5.2 | ||
COCOAPODS: 1.5.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'web3.swift' | ||
s.version = '0.0.5' | ||
s.version = '0.1.0' | ||
s.license = 'MIT' | ||
s.summary = 'Ethereum API for Swift' | ||
s.homepage = 'https://github.com/argentlabs/web3.swift' | ||
s.authors = { 'Julien Niset' => 'julien@argent.im', 'Matt Marshall' => 'matt@argent.im' } | ||
s.authors = { 'Julien Niset' => 'julien@argent.xyz', 'Matt Marshall' => 'matt@argent.xyz', 'Miguel Angel Quiñones' => 'miguel@argent.xyz' } | ||
s.source = { :git => 'https://github.com/argentlabs/web3.swift.git', :tag => s.version.to_s } | ||
s.module_name = 'web3' | ||
|
||
s.swift_version = '4.1' | ||
s.swift_version = '4.2' | ||
s.ios.deployment_target = '9.0' | ||
|
||
s.source_files = 'web3swift/web3swift.h', 'web3swift/src/**/*.swift', 'web3swift/lib/**/*.{c,h}' | ||
s.pod_target_xcconfig = { | ||
'SWIFT_INCLUDE_PATHS[sdk=iphonesimulator*]' => '$(PODS_TARGET_SRCROOT)/web3swift/lib/** $(PODS_TARGET_SRCROOT)/web3swift/frameworks/CommonCrypto/iphonesimulator/', | ||
'SWIFT_INCLUDE_PATHS[sdk=iphoneos*]' => '$(PODS_TARGET_SRCROOT)/web3swift/lib/** $(PODS_TARGET_SRCROOT)/web3swift/frameworks/CommonCrypto/iphoneos/' | ||
'SWIFT_INCLUDE_PATHS[sdk=iphonesimulator*]' => '$(PODS_TARGET_SRCROOT)/web3swift/lib/**', | ||
'SWIFT_INCLUDE_PATHS[sdk=iphoneos*]' => '$(PODS_TARGET_SRCROOT)/web3swift/lib/**' | ||
} | ||
s.preserve_paths = 'web3swift/lib/**/module.map', 'web3swift/frameworks/CommonCrypto/**/*' | ||
s.preserve_paths = 'web3swift/lib/**/module.map' | ||
|
||
|
||
# Do not include the C libs in export | ||
s.public_header_files = 'web3swift/web3swift.h' | ||
|
||
s.dependency 'BigInt', '~> 3.0.1' | ||
s.dependency 'BigInt', '~> 3.1.0' | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// ABIFunctionEncoderTests.swift | ||
// web3swift | ||
// | ||
// Created by Miguel on 28/11/2018. | ||
// Copyright © 2018 Argent Labs Limited. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
import BigInt | ||
@testable import web3swift | ||
|
||
class ABIFuncionEncoderTests: XCTestCase { | ||
var encoder: ABIFunctionEncoder! | ||
|
||
override func setUp() { | ||
encoder = ABIFunctionEncoder("test") | ||
|
||
} | ||
|
||
func testGivenEmptyString_ThenEncodesCorrectly() { | ||
try! encoder.encode("") | ||
let encoded = try! encoder.encoded() | ||
XCTAssertEqual(String(hexFromBytes: encoded.bytes), "0xf9fbd554000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") | ||
} | ||
|
||
func testGivenNonEmptyString_ThenEncodesCorrectly() { | ||
try! encoder.encode("hi") | ||
let encoded = try! encoder.encoded() | ||
XCTAssertEqual(String(hexFromBytes: encoded.bytes), "0xf9fbd554000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000026869000000000000000000000000000000000000000000000000000000000000") | ||
} | ||
|
||
func testGivenEmptyData_ThenEncodesCorrectly() { | ||
try! encoder.encode(Data()) | ||
let encoded = try! encoder.encoded() | ||
XCTAssertEqual(String(hexFromBytes: encoded.bytes), "0x2f570a2300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000") | ||
} | ||
|
||
func testGivenNonEmptyData_ThenEncodesCorrectly() { | ||
try! encoder.encode(Data(bytes: "hi".bytes)) | ||
let encoded = try! encoder.encoded() | ||
XCTAssertEqual(String(hexFromBytes: encoded.bytes), "0x2f570a23000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000026869000000000000000000000000000000000000000000000000000000000000") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.