diff --git a/store/cachemultistore.go b/store/cachemultistore.go index 837e52dfe1..b1a7548811 100644 --- a/store/cachemultistore.go +++ b/store/cachemultistore.go @@ -72,16 +72,3 @@ func (cms cacheMultiStore) GetStore(key StoreKey) Store { func (cms cacheMultiStore) GetKVStore(key StoreKey) KVStore { return cms.stores[key].(KVStore) } - -// GetStoreByName will first convert the original name to -// a special key, before looking up the CommitStore. -// This is not exposed to the extensions (which will need the -// StoreKey), but is useful in main, and particularly app.Query, -// in order to convert human strings into CommitStores. -func (cms cacheMultiStore) GetStoreByName(name string) Store { - key := cms.keysByName[name] - if key == nil { - return nil - } - return cms.stores[key].(Store) -} diff --git a/store/rootmultistore.go b/store/rootmultistore.go index 62131611b2..4b0ad4375f 100644 --- a/store/rootmultistore.go +++ b/store/rootmultistore.go @@ -176,12 +176,12 @@ func (rs *rootMultiStore) GetKVStore(key StoreKey) KVStore { return rs.stores[key].(KVStore) } -// GetStoreByName will first convert the original name to +// getStoreByName will first convert the original name to // a special key, before looking up the CommitStore. // This is not exposed to the extensions (which will need the // StoreKey), but is useful in main, and particularly app.Query, // in order to convert human strings into CommitStores. -func (rs *rootMultiStore) GetStoreByName(name string) Store { +func (rs *rootMultiStore) getStoreByName(name string) Store { key := rs.keysByName[name] if key == nil { return nil @@ -199,7 +199,7 @@ func (rs *rootMultiStore) Query(req abci.RequestQuery) abci.ResponseQuery { return err.Result().ToQuery() } - store := rs.GetStoreByName(storeName) + store := rs.getStoreByName(storeName) if store == nil { msg := fmt.Sprintf("no such store: %s", storeName) return sdk.ErrUnknownRequest(msg).Result().ToQuery() diff --git a/store/rootmultistore_test.go b/store/rootmultistore_test.go index d2cc44230d..a8145d80ed 100644 --- a/store/rootmultistore_test.go +++ b/store/rootmultistore_test.go @@ -21,11 +21,11 @@ func TestMultistoreCommitLoad(t *testing.T) { checkStore(t, store, commitID, commitID) // make sure we can get stores by name - s1 := store.GetStoreByName("store1") + s1 := store.getStoreByName("store1") assert.NotNil(t, s1) - s3 := store.GetStoreByName("store3") + s3 := store.getStoreByName("store3") assert.NotNil(t, s3) - s77 := store.GetStoreByName("store77") + s77 := store.getStoreByName("store77") assert.Nil(t, s77) // make a few commits and check them diff --git a/types/store.go b/types/store.go index e9894d0d61..6802a4bf10 100644 --- a/types/store.go +++ b/types/store.go @@ -48,8 +48,6 @@ type MultiStore interface { // Convenience for fetching substores. GetStore(StoreKey) Store GetKVStore(StoreKey) KVStore - - GetStoreByName(string) Store } // From MultiStore.CacheMultiStore()....