Skip to content

Commit fb796ea

Browse files
committed
Make typos in code
1 parent 3850262 commit fb796ea

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

Sources/Web3Core/KeystoreManager/IBAN.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public struct IBAN {
6464

6565
internal static func decodeToInts(_ iban: String) -> String {
6666
let uppercasedIBAN = iban.replacingOccurrences(of: " ", with: "").uppercased()
67-
let beginning = String(uppercasedIBAN[0..<4])
67+
let begining = String(uppercasedIBAN[0..<4])
6868
let end = String(uppercasedIBAN[4...])
69-
let IBAN = end + beginning
69+
let IBAN = end + begining
7070
var arrayOfInts = [Int]()
7171
for ch in IBAN {
7272
guard let dataPoint = String(ch).data(using: .ascii) else {return ""}

Sources/Web3Core/Utility/Utilities.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ public struct Utilities {
1919
guard let decompressedKey = SECP256K1.combineSerializedPublicKeys(keys: [publicKey], outputCompressed: false) else {return nil}
2020
return publicToAddressData(decompressedKey)
2121
}
22-
var stripped = publicKey
23-
if stripped.count == 65 {
24-
if stripped[0] != 4 {
22+
var stipped = publicKey
23+
if stipped.count == 65 {
24+
if stipped[0] != 4 {
2525
return nil
2626
}
27-
stripped = stripped[1...64]
27+
stipped = stipped[1...64]
2828
}
29-
if stripped.count != 64 {
29+
if stipped.count != 64 {
3030
return nil
3131
}
32-
let sha3 = stripped.sha3(.keccak256)
32+
let sha3 = stipped.sha3(.keccak256)
3333
let addressData = sha3[12...31]
3434
return addressData
3535
}

Sources/web3swift/Utils/EIP/EIP712.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fileprivate extension EIP712Hashable {
100100
}
101101

102102
func encodePrimaryType() -> String {
103-
let parameters: [String] = Mirror(reflecting: self).children.compactMap { key, value in
103+
let parametrs: [String] = Mirror(reflecting: self).children.compactMap { key, value in
104104
guard let key = key else { return nil }
105105

106106
func checkIfValueIsNil(value: Any) -> Bool {
@@ -127,7 +127,7 @@ fileprivate extension EIP712Hashable {
127127
}
128128
return typeName + " " + key
129129
}
130-
return name + "(" + parameters.joined(separator: ",") + ")"
130+
return name + "(" + parametrs.joined(separator: ",") + ")"
131131
}
132132
}
133133

Tests/web3swiftTests/localTests/EIP1559BlockTests.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class EIP1559BlockTests: LocalTestCase {
5757
(40_000_000, 12_965_000, 39_960_938, false) // Lower limit -1
5858
]
5959

60-
headerArray.forEach { (tuple: (parentGasLimit: BigUInt, parentNumber: BigUInt, currentGasLimit: BigUInt, is1559: Bool)) in
61-
let parent = Block(number: tuple.parentNumber,
60+
headerArray.forEach { (touple: (parentGasLimit: BigUInt, parentNumber: BigUInt, currentGasLimit: BigUInt, is1559: Bool)) in
61+
let parent = Block(number: touple.parentNumber,
6262
hash: uselessBlockPart.hash,
6363
parentHash: uselessBlockPart.parentHash,
6464
nonce: uselessBlockPart.nonce,
@@ -72,14 +72,14 @@ class EIP1559BlockTests: LocalTestCase {
7272
totalDifficulty: uselessBlockPart.totalDifficulty,
7373
extraData: uselessBlockPart.extraData,
7474
size: uselessBlockPart.size,
75-
gasLimit: tuple.parentGasLimit,
76-
gasUsed: tuple.parentGasLimit / 2,
75+
gasLimit: touple.parentGasLimit,
76+
gasUsed: touple.parentGasLimit / 2,
7777
baseFeePerGas: Web3.InitialBaseFee,
7878
timestamp: uselessBlockPart.timestamp,
7979
transactions: uselessBlockPart.transactions,
8080
uncles: uselessBlockPart.uncles)
8181

82-
let current = Block(number: tuple.parentNumber + 1,
82+
let current = Block(number: touple.parentNumber + 1,
8383
hash: uselessBlockPart.hash,
8484
parentHash: uselessBlockPart.parentHash,
8585
nonce: uselessBlockPart.nonce,
@@ -93,16 +93,16 @@ class EIP1559BlockTests: LocalTestCase {
9393
totalDifficulty: uselessBlockPart.totalDifficulty,
9494
extraData: uselessBlockPart.extraData,
9595
size: uselessBlockPart.size,
96-
gasLimit: tuple.currentGasLimit,
97-
gasUsed: tuple.currentGasLimit / 2,
96+
gasLimit: touple.currentGasLimit,
97+
gasUsed: touple.currentGasLimit / 2,
9898
baseFeePerGas: Web3.InitialBaseFee,
9999
timestamp: uselessBlockPart.timestamp,
100100
transactions: uselessBlockPart.transactions,
101101
uncles: uselessBlockPart.uncles)
102102

103-
if tuple.is1559 {
103+
if touple.is1559 {
104104
XCTAssertTrue(Web3.isEip1559Block(parent: parent, current: current),
105-
"Should not fail, got parent: \(parent.gasLimit), current: \(current.gasLimit)")
105+
"Shoult not fail, got parent: \(parent.gasLimit), current: \(current.gasLimit)")
106106
} else {
107107
XCTAssertFalse(Web3.isEip1559Block(parent: parent, current: current),
108108
"Should fail, got parent: \(parent.gasLimit), current: \(current.gasLimit)")
@@ -124,8 +124,8 @@ class EIP1559BlockTests: LocalTestCase {
124124
(Web3.InitialBaseFee, 12_965_000, 20000000, 11000000, 1012500000) // current above target
125125
]
126126

127-
headerArray.forEach { (tuple: (parentBaseFee: BigUInt, parentNumber: BigUInt, parentGasLimit: BigUInt, parentGasUsed: BigUInt, expectedBaseFee: BigUInt)) in
128-
let parent = Block(number: tuple.parentNumber,
127+
headerArray.forEach { (touple: (parentBaseFee: BigUInt, parentNumber: BigUInt, parentGasLimit: BigUInt, parentGasUsed: BigUInt, expectedBaseFee: BigUInt)) in
128+
let parent = Block(number: touple.parentNumber,
129129
hash: uselessBlockPart.hash,
130130
parentHash: uselessBlockPart.parentHash,
131131
nonce: uselessBlockPart.nonce,
@@ -139,16 +139,16 @@ class EIP1559BlockTests: LocalTestCase {
139139
totalDifficulty: uselessBlockPart.totalDifficulty,
140140
extraData: uselessBlockPart.extraData,
141141
size: uselessBlockPart.size,
142-
gasLimit: tuple.parentGasLimit,
143-
gasUsed: tuple.parentGasUsed,
142+
gasLimit: touple.parentGasLimit,
143+
gasUsed: touple.parentGasUsed,
144144
baseFeePerGas: Web3.InitialBaseFee,
145145
timestamp: uselessBlockPart.timestamp,
146146
transactions: uselessBlockPart.transactions,
147147
uncles: uselessBlockPart.uncles)
148148

149149
let calculatedBaseFee = Web3.calcBaseFee(parent)
150150

151-
XCTAssertEqual(calculatedBaseFee, tuple.expectedBaseFee, "Base fee calculation fails: should be \(tuple.expectedBaseFee), got: \(String(describing: calculatedBaseFee))")
151+
XCTAssertEqual(calculatedBaseFee, touple.expectedBaseFee, "Base fee calculation fails: should be \(touple.expectedBaseFee), got: \(String(describing: calculatedBaseFee))")
152152
}
153153
}
154154
}

0 commit comments

Comments
 (0)