Skip to content

Commit 984cf79

Browse files
authored
Merge pull request #157 from BANKEX/develop
reduce verbosity, make tests more strict
2 parents 8d2cd5d + d3299ba commit 984cf79

File tree

8 files changed

+87
-80
lines changed

8 files changed

+87
-80
lines changed

Example/web3swiftExample/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ EXTERNAL SOURCES:
4949

5050
CHECKOUT OPTIONS:
5151
web3swift:
52-
:commit: 670e012c95044e19a186de04d74011f46aff9da7
52+
:commit: 8d2cd5d484fb7e1d44dccd6422e19191cd9da024
5353
:git: https://github.com/bankex/web3swift.git
5454

5555
SPEC CHECKSUMS:

Example/web3swiftExample/Pods/Manifest.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/web3swiftExample/Pods/web3swift/web3swift/Promises/Classes/Promise+Web3+Contract+GetIndexedEvents.swift

Lines changed: 4 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/web3swiftExample/Pods/web3swift/web3swift/Web3/Classes/Web3+EventParser.swift

Lines changed: 68 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/web3swiftExample/web3swiftExample/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ class ViewController: UIViewController {
102102
// print("Address mismatch")
103103
// }
104104
guard case .success(let sendingResult) = sendResult else {return}
105-
let txid = sendingResult["txhash"]
106-
print("On Rinkeby TXid = " + txid!)
105+
let txid = sendingResult.hash
106+
print("On Rinkeby TXid = " + txid)
107107

108108
//Send ETH on Rinkeby using BIP32 keystore. Should fail due to insufficient balance
109109
web3Rinkeby.addKeystoreManager(bip32keystoreManager)

web3swift/Promises/Classes/Promise+HttpProvider.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ extension Web3HttpProvider {
8787
return rp.promise.ensure(on: queue) {
8888
task = nil
8989
}.map(on: queue){ (data: Data) throws -> JSONRPCresponseBatch in
90-
let debugValue = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions(rawValue: 0))
91-
print(debugValue)
90+
// let debugValue = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions(rawValue: 0))
91+
// print(debugValue)
9292
let parsedResponse = try JSONDecoder().decode(JSONRPCresponseBatch.self, from: data)
9393
return parsedResponse
9494
}

web3swift/Web3/Classes/Web3+TransactionIntermediate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ extension web3.web3contract {
248248
self.web3.queue.addOperation(operation)
249249
}
250250

251-
func assemble(password:String = "BANKEXFOUNDATION", options: Web3Options? = nil, onBlock: String = "pending") -> Result<EthereumTransaction, Web3Error> {
251+
func assemble(options: Web3Options? = nil, onBlock: String = "pending") -> Result<EthereumTransaction, Web3Error> {
252252
do {
253-
let result = try self.assemblePromise(password:password, options: options, onBlock: onBlock).wait()
253+
let result = try self.assemblePromise(options: options, onBlock: onBlock).wait()
254254
return Result(result)
255255
} catch {
256256
if let err = error as? Web3Error {
@@ -265,7 +265,7 @@ extension web3.web3contract {
265265

266266
extension web3.web3contract.TransactionIntermediate {
267267

268-
func assemblePromise(password:String = "BANKEXFOUNDATION", options: Web3Options? = nil, onBlock: String = "pending") -> Promise<EthereumTransaction> {
268+
func assemblePromise(options: Web3Options? = nil, onBlock: String = "pending") -> Promise<EthereumTransaction> {
269269
var assembledTransaction : EthereumTransaction = self.transaction
270270
let queue = self.web3.requestDispatcher.queue
271271
let returnPromise = Promise<EthereumTransaction> { seal in
@@ -317,7 +317,7 @@ extension web3.web3contract.TransactionIntermediate {
317317

318318
func sendPromise(password:String = "BANKEXFOUNDATION", options: Web3Options? = nil, onBlock: String = "pending") -> Promise<TransactionSendingResult>{
319319
let queue = self.web3.requestDispatcher.queue
320-
return self.assemblePromise(password: password, options: options, onBlock: onBlock).then(on: queue) { transaction throws -> Promise<TransactionSendingResult> in
320+
return self.assemblePromise(options: options, onBlock: onBlock).then(on: queue) { transaction throws -> Promise<TransactionSendingResult> in
321321
guard let mergedOptions = Web3Options.merge(self.options, with: options) else {
322322
throw Web3Error.inputError("Provided options are invalid")
323323
}

web3swiftTests/web3swift_promises_Tests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class web3swift_promises_Tests: XCTestCase {
5252
XCTAssert(esimate == 21000)
5353
} catch{
5454
print(error)
55+
XCTFail()
5556
}
5657
}
5758

@@ -72,6 +73,7 @@ class web3swift_promises_Tests: XCTestCase {
7273
print(result)
7374
} catch {
7475
print(error)
76+
XCTFail()
7577
}
7678
}
7779

@@ -85,6 +87,7 @@ class web3swift_promises_Tests: XCTestCase {
8587
print(String(bal))
8688
} catch {
8789
print(error)
90+
XCTFail()
8891
}
8992
}
9093

@@ -105,6 +108,7 @@ class web3swift_promises_Tests: XCTestCase {
105108
XCTAssert(eventParserResult[0].eventLog != nil)
106109
}catch {
107110
print(error)
111+
XCTFail()
108112
}
109113
}
110114

@@ -122,6 +126,7 @@ class web3swift_promises_Tests: XCTestCase {
122126
XCTAssert(present.count == 1)
123127
} catch{
124128
print(error)
129+
XCTFail()
125130
}
126131
}
127132

0 commit comments

Comments
 (0)