Skip to content

Commit 52919e7

Browse files
fix: re-enabled indentation_width; fixed SECP256K1.swift indentation_width issues.
1 parent 93bdc1c commit 52919e7

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.swiftlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ disabled_rules:
1010
- identifier_name
1111
- line_length
1212
- multiple_closures_with_trailing_closure
13-
- todo
14-
- indentation_width
13+
- todo
1514
- function_parameter_count
1615
- nesting
1716

@@ -29,6 +28,7 @@ opt_in_rules:
2928
- empty_string
3029
- closure_body_length
3130
- fallthrough
31+
- indentation_width
3232

3333
# force warnings
3434
force_cast: error

Sources/Web3Core/Structure/SECP256k1.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ extension SECP256K1 {
133133
let serializedPubkeyPointer = serializedPkRawPointer.assumingMemoryBound(to: UInt8.self)
134134
return withUnsafeMutablePointer(to: &keyLength) { (keyPtr: UnsafeMutablePointer<Int>) -> Int32 in
135135
withUnsafeMutablePointer(to: &publicKey) { (pubKeyPtr: UnsafeMutablePointer<secp256k1_pubkey>) -> Int32 in
136-
let res = secp256k1_ec_pubkey_serialize(context,
137-
serializedPubkeyPointer,
138-
keyPtr,
139-
pubKeyPtr,
140-
UInt32(compressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED))
136+
let res = secp256k1_ec_pubkey_serialize(
137+
context,
138+
serializedPubkeyPointer,
139+
keyPtr,
140+
pubKeyPtr,
141+
UInt32(compressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED)
142+
)
141143
return res
142144
}
143145
}
@@ -152,8 +154,10 @@ extension SECP256K1 {
152154
}
153155

154156
internal static func parsePublicKey(serializedKey: Data) -> secp256k1_pubkey? {
155-
guard let context = context,
156-
serializedKey.count == 33 || serializedKey.count == 65 else {
157+
guard
158+
let context = context,
159+
(serializedKey.count == 33 || serializedKey.count == 65)
160+
else {
157161
return nil
158162
}
159163
let keyLen: Int = Int(serializedKey.count)

0 commit comments

Comments
 (0)