Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/podspec #135

Merged
merged 3 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions web3swift.podspec
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
Pod::Spec.new do |s|
s.name = "web3swift"
s.version = "2.0.1"
s.version = "2.1.1"
s.summary = "Web3 implementation in vanilla Swift for iOS ans macOS"

s.description = <<-DESC
Web3 implementation in vanilla Swift, intended for mobile developers of wallets, Dapps and Web3.0
DESC

s.homepage = "https://github.com/matterinc/web3swift"
s.homepage = "https://github.com/matter-labs/web3swift"
s.license = 'Apache License 2.0'
s.author = { "Alex Vlasov" => "alex.m.vlasov@gmail.com" }
s.source = { :git => 'https://github.com/matterinc/web3swift.git', :tag => s.version.to_s }
s.source = { :git => 'https://github.com/matter-labs/web3swift.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/shamatar'

s.swift_version = '4.1'
s.module_name = 'Web3swift'
s.ios.deployment_target = "9.0"
s.osx.deployment_target = "10.11"
s.source_files = "web3swift/{PrecompiledContracts,Promises,Web3,Contract,KeystoreManager,Transaction,Convenience}/Classes/*.{h,swift}", "web3swift/Utils/Classes/{EIP67Code, EIP681}.swift", "web3swift/HookedFunctions/Classes/*.swift", "web3swift/web3swift.h"
s.source_files = "web3swift/{Promises,HookedFunctions,Web3,Contract,KeystoreManager,Transaction,Convenience}/Classes/*.{h,swift}", "web3swift/Utils/Classes/{EIP67Code, EIP681, ENS, ENSResolver, NameHash}.swift", "web3swift/PrecompiledContracts/**/*.swift", "web3swift/web3swift.h"
s.public_header_files = "web3swift/web3swift.h"
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }

s.frameworks = 'CoreImage'
s.dependency 'scrypt', '~> 2.0'
s.dependency 'PromiseKit', '~> 6.4.1'
s.dependency 'BigInt', '~> 3.1'
s.dependency 'CryptoSwift', '~> 0.13'
s.dependency 'PromiseKit', '~> 6.3'
s.dependency 'scrypt', '~> 2.0'
s.dependency 'Result', '~> 4.0'
s.dependency 'secp256k1_swift', '~> 1.0.3'
s.dependency 'SwiftRLP', '~> 1.1'
s.dependency 'EthereumAddress', '~> 1.0.0'
s.dependency 'EthereumABI', '~> 1.1.1'

end
4 changes: 0 additions & 4 deletions web3swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@
81DFB400210775320011DC85 /* Web3+Infura.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81DFB3FE210775320011DC85 /* Web3+Infura.swift */; };
81EB1E4B208173D7003BD47F /* Web3+Personal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81EB1E4A208173D7003BD47F /* Web3+Personal.swift */; };
81EB1E4C208173D7003BD47F /* Web3+Personal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81EB1E4A208173D7003BD47F /* Web3+Personal.swift */; };
81ED4EA82190D922003E932E /* NonceMiddleware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81ED4EA72190D922003E932E /* NonceMiddleware.swift */; };
81ED4EA92190D922003E932E /* NonceMiddleware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81ED4EA72190D922003E932E /* NonceMiddleware.swift */; };
81FA43F62044097100EE14D5 /* web3swift_macOS_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81FA43F52044097100EE14D5 /* web3swift_macOS_Tests.swift */; };
81FA43F82044097100EE14D5 /* web3swift_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 417715D420362916005C3E16 /* web3swift_macOS.framework */; };
81FB21FE207BB297007F9A83 /* EIP67Code.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81FB21F8207BA78B007F9A83 /* EIP67Code.swift */; };
Expand Down Expand Up @@ -1239,7 +1237,6 @@
8160E5CE20B8245A0070070B /* IBAN.swift in Sources */,
81909D1521862D37007D2AE5 /* Web3+MutatingTransaction.swift in Sources */,
810B0F9C1FEC520500CF0DA2 /* Web3+Methods.swift in Sources */,
81ED4EA82190D922003E932E /* NonceMiddleware.swift in Sources */,
81A1822520D678590016741F /* Promise+Web3+Eth+GetGasPrice.swift in Sources */,
8113DE7C1FD8514400CD8DF1 /* NSRegularExpressionExtension.swift in Sources */,
E2F8082A21CAA07000B6BF15 /* Web3+ERC1643.swift in Sources */,
Expand Down Expand Up @@ -1369,7 +1366,6 @@
41948131203630530065A83B /* BIP32KeystoreJSONStructure.swift in Sources */,
41948132203630530065A83B /* BIP32HDNode.swift in Sources */,
81A7B2522143C3A8004CD2C7 /* NameHash.swift in Sources */,
81ED4EA92190D922003E932E /* NonceMiddleware.swift in Sources */,
81A1824920D7DDA20016741F /* Promise+Web3+Personal+Sign.swift in Sources */,
81A1822620D678590016741F /* Promise+Web3+Eth+GetGasPrice.swift in Sources */,
81909D1621862D37007D2AE5 /* Web3+MutatingTransaction.swift in Sources */,
Expand Down
54 changes: 27 additions & 27 deletions web3swiftTests/web3swift_Eventloop_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,33 @@ class web3swift_Eventloop_Tests: XCTestCase {
waitForExpectations(timeout: 60, handler: nil)
}

func testNonceMiddleware() {
let web3 = Web3.InfuraRinkebyWeb3()
let middleware = Web3.Utils.NonceMiddleware()
middleware.attach(web3)
let sendToAddress = EthereumAddress("0xe22b8979739D724343bd002F9f432F5990879901")!
let ksData = getKeystoreData()
let tempKeystore = EthereumKeystoreV3(ksData!)
let keystoreManager = KeystoreManager([tempKeystore!])
web3.addKeystoreManager(keystoreManager)
var tx = web3.eth.sendETH(to: sendToAddress, amount: 1000)
tx!.transactionOptions.from = tempKeystore!.addresses!.first!
var result = try! tx!.send(password: "web3swift")
let newNonce = result.transaction.nonce
sleep(1)
let hookNewNonce = middleware.nonceLookups[tempKeystore!.addresses!.first!]!
XCTAssertEqual(newNonce, hookNewNonce)
tx = web3.eth.sendETH(to: sendToAddress, amount: 1000)
tx!.transactionOptions.from = tempKeystore!.addresses!.first!
result = try! tx!.send(password: "web3swift")
sleep(1)
let newNonce2 = result.transaction.nonce
let hookNewNonce2 = middleware.nonceLookups[tempKeystore!.addresses!.first!]!
XCTAssert(newNonce2 == hookNewNonce2)
}
// func testNonceMiddleware() {
// let web3 = Web3.InfuraRinkebyWeb3()
// let middleware = Web3.Utils.NonceMiddleware()
// middleware.attach(web3)
//
// let sendToAddress = EthereumAddress("0xe22b8979739D724343bd002F9f432F5990879901")!
// let ksData = getKeystoreData()
// let tempKeystore = EthereumKeystoreV3(ksData!)
// let keystoreManager = KeystoreManager([tempKeystore!])
// web3.addKeystoreManager(keystoreManager)
//
// var tx = web3.eth.sendETH(to: sendToAddress, amount: 1000)
// tx!.transactionOptions.from = tempKeystore!.addresses!.first!
// var result = try! tx!.send(password: "web3swift")
// let newNonce = result.transaction.nonce
// sleep(1)
// let hookNewNonce = middleware.nonceLookups[tempKeystore!.addresses!.first!]!
// XCTAssertEqual(newNonce, hookNewNonce)
//
// tx = web3.eth.sendETH(to: sendToAddress, amount: 1000)
// tx!.transactionOptions.from = tempKeystore!.addresses!.first!
// result = try! tx!.send(password: "web3swift")
// sleep(1)
// let newNonce2 = result.transaction.nonce
// let hookNewNonce2 = middleware.nonceLookups[tempKeystore!.addresses!.first!]!
// XCTAssert(newNonce2 == hookNewNonce2)
// }


func getKeystoreData() -> Data? {
Expand Down