Skip to content

Commit c3abf93

Browse files
chore: fixed spacing; KeystoreParamsV3 init - removed local names of arguments;
1 parent dd93a0c commit c3abf93

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Sources/Web3Core/KeystoreManager/KeystoreParams.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public struct KdfParamsV3: Decodable, Encodable {
1212
var r: Int?
1313
var c: Int?
1414
var prf: String?
15+
1516
public init(salt: String, dklen: Int, n: Int? = nil, p: Int? = nil, r: Int? = nil, c: Int? = nil, prf: String? = nil) {
1617
self.salt = salt
1718
self.dklen = dklen
@@ -25,6 +26,7 @@ public struct KdfParamsV3: Decodable, Encodable {
2526

2627
public struct CipherParamsV3: Decodable, Encodable {
2728
var iv: String
29+
2830
public init(iv: String) {
2931
self.iv = iv
3032
}
@@ -38,6 +40,7 @@ public struct CryptoParamsV3: Decodable, Encodable {
3840
var kdfparams: KdfParamsV3
3941
var mac: String
4042
var version: String?
43+
4144
public init(ciphertext: String, cipher: String, cipherparams: CipherParamsV3, kdf: String, kdfparams: KdfParamsV3, mac: String, version: String? = nil) {
4245
self.ciphertext = ciphertext
4346
self.cipher = cipher
@@ -54,12 +57,12 @@ public protocol AbstractKeystoreParams: Codable {
5457
var id: String? { get }
5558
var version: Int { get }
5659
var isHDWallet: Bool { get }
57-
5860
}
5961

6062
public struct PathAddressPair: Codable {
6163
public let path: String
6264
public let address: String
65+
6366
public init(path: String, address: String) {
6467
self.path = path
6568
self.address = address
@@ -97,23 +100,20 @@ public struct KeystoreParamsBIP32: AbstractKeystoreParams {
97100
self.rootPath = rootPath
98101
self.isHDWallet = true
99102
}
100-
101103
}
102104

103105
public struct KeystoreParamsV3: AbstractKeystoreParams {
106+
public var address: String?
104107
public var crypto: CryptoParamsV3
105108
public var id: String?
106109
public var version: Int
107110
public var isHDWallet: Bool
108111

109-
public var address: String?
110-
111-
public init(address ad: String?, crypto cr: CryptoParamsV3, id i: String, version ver: Int) {
112-
address = ad
113-
self.crypto = cr
114-
self.id = i
115-
self.version = ver
112+
public init(address: String?, crypto: CryptoParamsV3, id: String, version: Int) {
113+
self.address = address
114+
self.crypto = crypto
115+
self.id = id
116+
self.version = version
116117
self.isHDWallet = false
117118
}
118-
119119
}

0 commit comments

Comments
 (0)