Skip to content

Commit 0b21f85

Browse files
committed
removed leading and trailing spaces within parenthesis
1 parent f9cfbdb commit 0b21f85

18 files changed

+27
-27
lines changed

Sources/web3swift/Convenience/Decodable+Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extension KeyedDecodingContainer {
6060
///
6161
/// This method returns `nil` if the container does not have a value
6262
/// associated with `key`, or if the value is null. The difference between
63-
/// these states can be distinguished with a `contains(_: )` call.
63+
/// these states can be distinguished with a `contains(_:)` call.
6464
///
6565
/// - parameter type: The type of value to decode.
6666
/// - parameter key: The key that the decoded value is associated with.
@@ -79,7 +79,7 @@ extension KeyedDecodingContainer {
7979
///
8080
/// This method returns `nil` if the container does not have a value
8181
/// associated with `key`, or if the value is null. The difference between
82-
/// these states can be distinguished with a `contains(_: )` call.
82+
/// these states can be distinguished with a `contains(_:)` call.
8383
///
8484
/// - parameter type: The type of value to decode.
8585
/// - parameter key: The key that the decoded value is associated with.

Sources/web3swift/Convenience/NativeTypesEncoding+Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
import BigInt
99

1010
extension Data {
11-
func setLengthLeft(_ toBytes: UInt64, isNegative: Bool = false ) -> Data? {
11+
func setLengthLeft(_ toBytes: UInt64, isNegative: Bool = false) -> Data? {
1212
let existingLength = UInt64(self.count)
1313
if (existingLength == toBytes) {
1414
return Data(self)
@@ -25,7 +25,7 @@ extension Data {
2525
return data
2626
}
2727

28-
func setLengthRight(_ toBytes: UInt64, isNegative: Bool = false ) -> Data? {
28+
func setLengthRight(_ toBytes: UInt64, isNegative: Bool = false) -> Data? {
2929
let existingLength = UInt64(self.count)
3030
if (existingLength == toBytes) {
3131
return Data(self)

Sources/web3swift/Convenience/RIPEMD160+StackOveflow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public struct RIPEMD160 {
2828
/* ROL(x, n) cyclically rotates x over n bits to the left */
2929
/* x must be of an unsigned 32 bits type and 0 <= n < 32. */
3030
func ROL(_ x: UInt32, _ n: UInt32) -> UInt32 {
31-
return (x << n) | ( x >> (32 - n))
31+
return (x << n) | (x >> (32 - n))
3232
}
3333

3434
/* the five basic functions F(), G() and H() */

Sources/web3swift/EthereumABI/ABIElements.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,18 +189,18 @@ extension ABI.Element {
189189
case .function(let function):
190190
// the response size greater than equal 100 bytes, when read function aborted by "require" statement.
191191
// if "require" statement has no message argument, the response is empty (0 byte).
192-
if( data.bytes.count >= 100 ) {
193-
let check00_31 = BigUInt( "08C379A000000000000000000000000000000000000000000000000000000000", radix: 16 )!
194-
let check32_63 = BigUInt( "0000002000000000000000000000000000000000000000000000000000000000", radix: 16 )!
192+
if(data.bytes.count >= 100) {
193+
let check00_31 = BigUInt("08C379A000000000000000000000000000000000000000000000000000000000", radix: 16)!
194+
let check32_63 = BigUInt("0000002000000000000000000000000000000000000000000000000000000000", radix: 16)!
195195

196196
// check data[00-31] and data[32-63]
197-
if check00_31 == BigUInt( data[0...31] ) && check32_63 == BigUInt( data[32...63] ) {
197+
if check00_31 == BigUInt(data[0...31]) && check32_63 == BigUInt(data[32...63]) {
198198
// data.bytes[64-67] contains the length of require message
199199
let len = (Int(data.bytes[64])<<24) | (Int(data.bytes[65])<<16) | (Int(data.bytes[66])<<8) | Int(data.bytes[67])
200200

201-
let message = String( bytes: data.bytes[68..<(68+len)], encoding: .utf8 )!
201+
let message = String(bytes: data.bytes[68..<(68+len)], encoding: .utf8)!
202202

203-
print( "read function aborted by require statement: \(message)" )
203+
print("read function aborted by require statement: \(message)")
204204

205205
var returnArray = [String: Any]()
206206

Sources/web3swift/Promises/Promise+Web3+Eth+Call.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extension web3.Eth {
1616
throw Web3Error.processingError(desc: "Transaction is invalid")
1717
}
1818
let rp = web3.dispatch(request)
19-
return rp.map(on: queue ) { response in
19+
return rp.map(on: queue) { response in
2020
guard let value: Data = response.getValue() else {
2121
if response.error != nil {
2222
throw Web3Error.nodeError(desc: response.error!.message)

Sources/web3swift/Promises/Promise+Web3+Eth+EstimateGas.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension web3.Eth {
1717
throw Web3Error.processingError(desc: "Transaction is invalid")
1818
}
1919
let rp = web3.dispatch(request)
20-
return rp.map(on: queue ) { response in
20+
return rp.map(on: queue) { response in
2121
guard let value: BigUInt = response.getValue() else {
2222
if response.error != nil {
2323
throw Web3Error.nodeError(desc: response.error!.message)

Sources/web3swift/Promises/Promise+Web3+Eth+GetAccounts.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension web3.Eth {
2525
}
2626
let request = JSONRPCRequestFabric.prepareRequest(.getAccounts, parameters: [])
2727
let rp = web3.dispatch(request)
28-
return rp.map(on: queue ) { response in
28+
return rp.map(on: queue) { response in
2929
guard let value: [EthereumAddress] = response.getValue() else {
3030
if response.error != nil {
3131
throw Web3Error.nodeError(desc: response.error!.message)

Sources/web3swift/Promises/Promise+Web3+Eth+GetBalance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension web3.Eth {
1717
let request = JSONRPCRequestFabric.prepareRequest(.getBalance, parameters: [address.lowercased(), onBlock])
1818
let rp = web3.dispatch(request)
1919
let queue = web3.requestDispatcher.queue
20-
return rp.map(on: queue ) { response in
20+
return rp.map(on: queue) { response in
2121
guard let value: BigUInt = response.getValue() else {
2222
if response.error != nil {
2323
throw Web3Error.nodeError(desc: response.error!.message)

Sources/web3swift/Promises/Promise+Web3+Eth+GetBlockByHash.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extension web3.Eth {
1818
let request = JSONRPCRequestFabric.prepareRequest(.getBlockByHash, parameters: [hash, fullTransactions])
1919
let rp = web3.dispatch(request)
2020
let queue = web3.requestDispatcher.queue
21-
return rp.map(on: queue ) { response in
21+
return rp.map(on: queue) { response in
2222
guard let value: Block = response.getValue() else {
2323
if response.error != nil {
2424
throw Web3Error.nodeError(desc: response.error!.message)

Sources/web3swift/Promises/Promise+Web3+Eth+GetBlockByNumber.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension web3.Eth {
2323
let request = JSONRPCRequestFabric.prepareRequest(.getBlockByNumber, parameters: [number, fullTransactions])
2424
let rp = web3.dispatch(request)
2525
let queue = web3.requestDispatcher.queue
26-
return rp.map(on: queue ) { response in
26+
return rp.map(on: queue) { response in
2727
guard let value: Block = response.getValue() else {
2828
if response.error != nil {
2929
throw Web3Error.nodeError(desc: response.error!.message)

0 commit comments

Comments
 (0)