Skip to content

Commit

Permalink
add version to keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
robdefeo committed Oct 23, 2019
1 parent 06ca8b1 commit a961e06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/keystore/nacl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"github.com/google/uuid"
"github.com/mailchain/mailchain"
"github.com/mailchain/mailchain/crypto"
"github.com/mailchain/mailchain/internal/keystore"
"github.com/mailchain/mailchain/internal/keystore/kdf"
Expand All @@ -41,6 +42,7 @@ func (fs FileStore) Store(private crypto.PrivateKey, curveType string, deriveKey
if err != nil {
return nil, errors.WithMessage(err, "could seal storage key")
}

address := private.PublicKey().Address()
keyJSON := keystore.EncryptedKey{
Address: hex.EncodeToString(address),
Expand All @@ -50,7 +52,7 @@ func (fs FileStore) Store(private crypto.PrivateKey, curveType string, deriveKey
ID: uuid.New().String(),
KDF: keyDefFunc,
Timestamp: time.Now(),
Version: "0.0.0", // TODO: get the actual version of this
Version: mailchain.Version,
}
if keyDefFunc != kdf.Scrypt {
return nil, errors.Errorf("kdf not supported")
Expand Down

0 comments on commit a961e06

Please sign in to comment.