Skip to content

Commit

Permalink
unifying constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni committed Feb 2, 2019
1 parent 88e8a57 commit 0eb3f04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const (
)

const (
defaultBIP39Passphrase = ""
maxValidAccountValue = int(0x80000000 - 1)
maxValidIndexalue = int(0x80000000 - 1)
)
Expand Down Expand Up @@ -245,7 +244,7 @@ func runAddCmd(cmd *cobra.Command, args []string) error {
}
}

info, err := kb.CreateAccount(name, mnemonic, defaultBIP39Passphrase, encryptPassword, account, index)
info, err := kb.CreateAccount(name, mnemonic, keys.DefaultBIP39Passphrase, encryptPassword, account, index)
if err != nil {
return err
}
Expand Down Expand Up @@ -386,7 +385,7 @@ func AddNewKeyRequestHandler(indent bool) http.HandlerFunc {
// create account
account := uint32(m.Account)
index := uint32(m.Index)
info, err := kb.CreateAccount(m.Name, mnemonic, defaultBIP39Passphrase, m.Password, account, index)
info, err := kb.CreateAccount(m.Name, mnemonic, keys.DefaultBIP39Passphrase, m.Password, account, index)
if CheckAndWriteErrorResponse(w, http.StatusInternalServerError, err) {
return
}
Expand Down Expand Up @@ -477,7 +476,7 @@ func RecoverRequestHandler(indent bool) http.HandlerFunc {
account := uint32(m.Account)
index := uint32(m.Index)

info, err := kb.CreateAccount(name, mnemonic, defaultBIP39Passphrase, m.Password, account, index)
info, err := kb.CreateAccount(name, mnemonic, keys.DefaultBIP39Passphrase, m.Password, account, index)
if CheckAndWriteErrorResponse(w, http.StatusInternalServerError, err) {
return
}
Expand Down
4 changes: 2 additions & 2 deletions crypto/keys/keybase.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const (

const (
// used for deriving seed from mnemonic
defaultBIP39Passphrase = ""
DefaultBIP39Passphrase = ""

// bits of entropy to draw when creating a mnemonic
defaultEntropySize = 256
Expand Down Expand Up @@ -109,7 +109,7 @@ func (kb dbKeybase) CreateMnemonic(name string, language Language, passwd string
return
}

seed := bip39.NewSeed(mnemonic, defaultBIP39Passphrase)
seed := bip39.NewSeed(mnemonic, DefaultBIP39Passphrase)
info, err = kb.persistDerivedKey(seed, passwd, name, hd.FullFundraiserPath)
return
}
Expand Down

0 comments on commit 0eb3f04

Please sign in to comment.