File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Sources/Web3Core/Structure Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ disabled_rules:
10
10
- identifier_name
11
11
- line_length
12
12
- multiple_closures_with_trailing_closure
13
- - todo
14
- - indentation_width
13
+ - todo
15
14
- function_parameter_count
16
15
- nesting
17
16
@@ -29,6 +28,7 @@ opt_in_rules:
29
28
- empty_string
30
29
- closure_body_length
31
30
- fallthrough
31
+ - indentation_width
32
32
33
33
# force warnings
34
34
force_cast : error
Original file line number Diff line number Diff line change @@ -133,11 +133,13 @@ extension SECP256K1 {
133
133
let serializedPubkeyPointer = serializedPkRawPointer. assumingMemoryBound ( to: UInt8 . self)
134
134
return withUnsafeMutablePointer ( to: & keyLength) { ( keyPtr: UnsafeMutablePointer < Int > ) -> Int32 in
135
135
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
+ )
141
143
return res
142
144
}
143
145
}
@@ -152,8 +154,10 @@ extension SECP256K1 {
152
154
}
153
155
154
156
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 {
157
161
return nil
158
162
}
159
163
let keyLen : Int = Int ( serializedKey. count)
You can’t perform that action at this time.
0 commit comments