Skip to content

Commit

Permalink
remove reduntant code
Browse files Browse the repository at this point in the history
  • Loading branch information
unclezoro committed Jul 22, 2019
1 parent 2280cae commit 468bcc6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
23 changes: 0 additions & 23 deletions keys/hdpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/btcsuite/btcd/btcec"
)

// BIP44Prefix is the parts of the BIP32 HD path that are fixed by what we used during the fundraiser.
const (
BIPPurpose = 44
BIPCoinType = 714
Expand Down Expand Up @@ -47,28 +46,6 @@ func NewParams(purpose, coinType, account uint32, change bool, addressIdx uint32
}
}

func hardenedInt(field string) (uint32, error) {
field = strings.TrimSuffix(field, "'")
i, err := strconv.Atoi(field)
if err != nil {
return 0, err
}
if i < 0 {
return 0, fmt.Errorf("fields must not be negative. got %d", i)
}
return uint32(i), nil
}

func isHardened(field string) bool {
return strings.HasSuffix(field, "'")
}

// NewFundraiserParams creates a BIP 44 parameter object from the params:
// m / 44' / 714' / account' / 0 / address_index
// The fixed parameters (purpose', coin_type', and change) are determined by what was used in the fundraiser.
func NewFundraiserParams(account uint32, addressIdx uint32) *BIP44Params {
return NewParams(BIPPurpose, BIPCoinType, account, BIPChange, addressIdx)
}

// NewBinanceBIP44Params creates a BIP 44 parameter object from the params:
// m / 44' / 714' / account' / 0 / address_index
Expand Down
2 changes: 1 addition & 1 deletion keys/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewMnemonicKeyManager(mnemonic string) (KeyManager, error) {
return &k, err
}

// The full fundraiser path is "purpose' / coin_type' / account' / change / address_index".
// The full path is "purpose' / coin_type' / account' / change / address_index".
// "purpose' / coin_type'" is fixed as "44'/714'/", user can customize the rest part.
func NewMnemonicPathKeyManager(mnemonic, keyPath string) (KeyManager, error) {
k := keyManager{}
Expand Down

0 comments on commit 468bcc6

Please sign in to comment.