Skip to content

Commit c584da6

Browse files
Fixin typos and revert unnecessary code changes.
1 parent 92f288a commit c584da6

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

Sources/web3swift/Convenience/Array+Extension.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ extension Array {
1717
}
1818

1919
extension Array where Element: Comparable {
20-
2120
/// Sorts array and drops most and least values.
2221
/// - Returns: Sorted array without most and least values, nil if `array.count` <= 2
2322
func cropAnomalyValues() -> Self? {

Sources/web3swift/Convenience/Decodable+Extensions.swift

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

11+
struct AnyCodingKey: CodingKey {
12+
var stringValue: String
13+
var intValue: Int?
14+
15+
init?(stringValue: String) {
16+
self.stringValue = stringValue
17+
}
18+
19+
init?(intValue: Int) {
20+
self.intValue = intValue
21+
self.stringValue = String(intValue)
22+
}
23+
}
24+
1125
extension KeyedDecodingContainer {
1226
/// Decodes a value of the given type for the given key.
1327
///

Sources/web3swift/Convenience/Encodable+Extensions.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@
77
//
88
import Foundation
99

10-
struct AnyCodingKey: CodingKey {
11-
var stringValue: String
12-
var intValue: Int?
13-
14-
init?(stringValue: String) {
15-
self.stringValue = stringValue
16-
}
17-
18-
init?(intValue: Int) {
19-
self.intValue = intValue
20-
self.stringValue = String(intValue)
21-
}
22-
}
23-
2410
extension KeyedEncodingContainer {
2511
/// Encodes the given value for the given key.
2612
///

Sources/web3swift/Web3/Web3+GasOracle.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ extension Web3 {
148148

149149
public extension Web3.Oracle {
150150
// MARK: - Base Fee
151-
/// Softed baseFee amount
151+
/// Soften baseFee amount
152152
///
153153
/// - Returns: `[percentile_1, percentile_2, percentile_3, ...].count == self.percentile.count`
154-
/// empty array if failed to perdict. By default there's 3 percentile.
154+
/// empty array if failed to predict. By default there's 3 percentile.
155155
var baseFeePercentiles: [BigUInt] {
156156
guard let value = try? suggestBaseFee() else { return [] }
157157
return value
@@ -161,7 +161,7 @@ public extension Web3.Oracle {
161161
/// Tip amount
162162
///
163163
/// - Returns: `[percentile_1, percentile_2, percentile_3, ...].count == self.percentile.count`
164-
/// empty array if failed to perdict. By default there's 3 percentile.
164+
/// empty array if failed to predict. By default there's 3 percentile.
165165
var tipFeePercentiles: [BigUInt] {
166166
guard let value = try? suggestTipValue() else { return [] }
167167
return value
@@ -171,7 +171,7 @@ public extension Web3.Oracle {
171171
/// Summary fees amount
172172
///
173173
/// - Returns: `[percentile_1, percentile_2, percentile_3, ...].count == self.percentile.count`
174-
/// nil if failed to perdict. By default there's 3 percentile.
174+
/// nil if failed to predict. By default there's 3 percentile.
175175
var bothFeesPercentiles: (baseFee: [BigUInt], tip: [BigUInt])? {
176176
var baseFeeArr: [BigUInt] = []
177177
var tipArr: [BigUInt] = []
@@ -188,7 +188,7 @@ public extension Web3.Oracle {
188188
/// Legacy gasPrice amount
189189
///
190190
/// - Returns: `[percentile_1, percentile_2, percentile_3, ...].count == self.percentile.count`
191-
/// empty array if failed to perdict. By default there's 3 percentile.
191+
/// empty array if failed to predict. By default there's 3 percentile.
192192
var gasPriceLegacyPercentiles: [BigUInt] {
193193
guard let value = try? suggestGasFeeLegacy() else { return [] }
194194
return value

0 commit comments

Comments
 (0)