Skip to content

Commit

Permalink
Merge pull request #171 from yenom/feature/make-HDKeychain-properties…
Browse files Browse the repository at this point in the history
…-public

✏️ add public
  • Loading branch information
akifuji committed Sep 27, 2018
2 parents 55a6f8a + 81533a6 commit 4470cd6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/BitcoinKit/Core/Keys/HDKeychain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
import Foundation

public final class HDKeychain {
let privateKey: HDPrivateKey
private let rootKey: HDPrivateKey

init(privateKey: HDPrivateKey) {
self.privateKey = privateKey
public init(rootKey: HDPrivateKey) {
self.rootKey = rootKey
}

public convenience init(seed: Data, network: Network) {
self.init(privateKey: HDPrivateKey(seed: seed, network: network))
self.init(rootKey: HDPrivateKey(seed: seed, network: network))
}
/// Parses the BIP32 path and derives the chain of keychains accordingly.
/// Path syntax: (m?/)?([0-9]+'?(/[0-9]+'?)*)?
Expand All @@ -54,8 +54,8 @@ public final class HDKeychain {
/// "m / 0 / 1" (contains spaces)
/// "m/b/c" (alphabetical characters instead of numerical indexes)
/// "m/1.2^3" (contains illegal characters)
func derivedKey(path: String) throws -> HDPrivateKey {
var key = privateKey
public func derivedKey(path: String) throws -> HDPrivateKey {
var key = rootKey

var path = path
if path == "m" || path == "/" || path == "" {
Expand Down

0 comments on commit 4470cd6

Please sign in to comment.