Skip to content

Commit 25d4fda

Browse files
committed
minor stylistic cleanup in Web3+Structures
--this commit is really to try and force a resync between my fork and the main. GitHub is acting weirdly
1 parent 62686d9 commit 25d4fda

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/web3swift/Web3/Web3+Structures.swift

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

1010
fileprivate func decodeHexToData<T>(_ container: KeyedDecodingContainer<T>, key: KeyedDecodingContainer<T>.Key, allowOptional: Bool = false) throws -> Data? {
11-
if (allowOptional) {
11+
if allowOptional {
1212
let string = try? container.decode(String.self, forKey: key)
1313
if string != nil {
1414
guard let data = Data.fromHex(string!) else {throw Web3Error.dataError}
@@ -23,7 +23,7 @@ fileprivate func decodeHexToData<T>(_ container: KeyedDecodingContainer<T>, key:
2323
}
2424

2525
fileprivate func decodeHexToBigUInt<T>(_ container: KeyedDecodingContainer<T>, key: KeyedDecodingContainer<T>.Key, allowOptional: Bool = false) throws -> BigUInt? {
26-
if (allowOptional) {
26+
if allowOptional {
2727
let string = try? container.decode(String.self, forKey: key)
2828
if string != nil {
2929
guard let number = BigUInt(string!.stripHexPrefix(), radix: 16) else {throw Web3Error.dataError}
@@ -117,7 +117,7 @@ extension EthereumTransaction: Decodable {
117117
// test to see if it is a EIP-1559 wrapper
118118
if let envelope = try decodeHexToBigUInt(container, key: .type, allowOptional: true) {
119119
// if present and non-sero we are a new wrapper we can't decode
120-
if(envelope != BigInt(0)) { throw Web3Error.dataError }
120+
if envelope != BigInt(0) { throw Web3Error.dataError }
121121
}
122122
var data = try decodeHexToData(container, key: .data, allowOptional: true)
123123
if data != nil {
@@ -168,7 +168,7 @@ extension EthereumTransaction: Decodable {
168168
}
169169

170170
let inferedChainID = self.inferedChainID
171-
if (self.inferedChainID != nil && self.v >= BigUInt(37)) {
171+
if self.inferedChainID != nil && self.v >= BigUInt(37) {
172172
self.chainID = inferedChainID
173173
}
174174
}
@@ -259,7 +259,7 @@ public struct TransactionReceipt: Decodable {
259259
self.gasUsed = gasUsed
260260

261261
let status = try decodeHexToBigUInt(container, key: .status, allowOptional: true)
262-
if (status == nil) {
262+
if status == nil {
263263
self.status = TXStatus.notYetProcessed
264264
} else if status == 1 {
265265
self.status = TXStatus.ok
@@ -370,7 +370,7 @@ public struct EventLog: Decodable {
370370
self.logIndex = logIndex
371371

372372
let removed = try decodeHexToBigUInt(container, key: .removed, allowOptional: true)
373-
if (removed == 1) {
373+
if removed == 1 {
374374
self.removed = true
375375
} else {
376376
self.removed = false

0 commit comments

Comments
 (0)