fix keys and glide

This commit is contained in:
Ethan Buchman
2017-03-14 17:29:43 -04:00
parent fa5d7b30f2
commit de5506dd8f
10 changed files with 118 additions and 80 deletions
+4 -2
View File
@@ -28,12 +28,14 @@ func NewState(store types.KVStore) *State {
func (s *State) SetChainID(chainID string) {
s.chainID = chainID
s.store.Set([]byte("base/chain_id"), []byte(chainID))
}
func (s *State) GetChainID() string {
if s.chainID == "" {
PanicSanity("Expected to have set SetChainID")
if s.chainID != "" {
return s.chainID
}
s.chainID = string(s.store.Get([]byte("base/chain_id")))
return s.chainID
}