Skip to content

Commit 85f7261

Browse files
chore: spacing + removed redundant comments
1 parent 1c0f2f7 commit 85f7261

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

Sources/Web3Core/KeystoreManager/BIP32HDNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class HDNode {
9797
let hmacKey = "Bitcoin seed".data(using: .ascii)!
9898
let hmac: Authenticator = HMAC(key: hmacKey.bytes, variant: HMAC.Variant.sha2(.sha512))
9999
guard let entropy = try? hmac.authenticate(seed.bytes) else { return nil }
100-
guard entropy.count == 64 else { return nil}
100+
guard entropy.count == 64 else { return nil }
101101
let I_L = entropy[0..<32]
102102
let I_R = entropy[32..<64]
103103
chaincode = Data(I_R)

Sources/Web3Core/Utility/Utilities.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,9 @@ public struct Utilities {
202202
}
203203

204204
/// Recover the Ethereum address from recoverable secp256k1 signature. Message is first hashed using the "personal hash" protocol.
205-
/// BE WARNED - changing a message will result in different Ethereum address, but not in error.
206-
///
207-
/// Input parameters should be Data objects.
205+
/// BE WARNED - changing a message will result in different Ethereum address, but not in an error.
208206
public static func personalECRecover(_ personalMessage: Data, signature: Data) -> EthereumAddress? {
209-
if signature.count != 65 { return nil}
207+
if signature.count != 65 { return nil }
210208
let rData = signature[0..<32].bytes
211209
let sData = signature[32..<64].bytes
212210
var vData = signature[64]
@@ -226,10 +224,8 @@ public struct Utilities {
226224

227225
/// Recover the Ethereum address from recoverable secp256k1 signature.
228226
/// Takes a hash of some message. What message is hashed should be checked by user separately.
229-
///
230-
/// Input parameters should be Data objects.
231227
public static func hashECRecover(hash: Data, signature: Data) -> EthereumAddress? {
232-
if signature.count != 65 { return nil}
228+
if signature.count != 65 { return nil }
233229
let rData = signature[0..<32].bytes
234230
let sData = signature[32..<64].bytes
235231
var vData = signature[64]

Sources/web3swift/HookedFunctions/Web3+BrowserFunctions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extension Web3.BrowserFunctions {
5252
}
5353

5454
public func personalECRecover(_ personalMessage: Data, signature: Data) -> String? {
55-
if signature.count != 65 { return nil}
55+
if signature.count != 65 { return nil }
5656
let rData = signature[0..<32].bytes
5757
let sData = signature[32..<64].bytes
5858
var vData = signature[64]

0 commit comments

Comments
 (0)