Skip to content

Commit

Permalink
[key_store] moved struc's to top of file
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Lenz committed Apr 17, 2018
1 parent a95ffd1 commit f2f5a06
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions keyStore/keyStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ import (
bip39 "github.com/Bit-Nation/panthalassa/bip39"
)

type KeyStore struct {
mnemonic string
keys map[string]string
version uint8
}

//Only used for json marshalling
type jsonKeyStore struct {
Mnemonic string `json:"mnemonic"`
Keys map[string]string `json:"keys"`
Version uint8 `json:"version"`
}

var newMnemonic = bip39.NewMnemonic

//Ethereum private key validation rule
Expand Down Expand Up @@ -45,19 +58,6 @@ var validationRules = map[uint8][]func(ks KeyStore) error{
},
}

type KeyStore struct {
mnemonic string
keys map[string]string
version uint8
}

//Only used for json marshalling
type jsonKeyStore struct {
Mnemonic string `json:"mnemonic"`
Keys map[string]string `json:"keys"`
Version uint8 `json:"version"`
}

func (ks KeyStore) GetKey(key string) (string, error) {

_, exist := ks.keys[key]
Expand Down

0 comments on commit f2f5a06

Please sign in to comment.