func (s Subspace) Get(ctx sdk.Context, key []byte, ptr interface{}) {
	s.checkType(key, ptr)
	store := s.kvStore(ctx)
	bz := store.Get(key)
	if err := s.cdc.UnmarshalJSON(bz, ptr); err != nil {
		panic(err)
	}
}
Get queries for a parameter by key from the Subspace's KVStore and sets the
value to the provided pointer. If the value does not exist, it will panic.
package types
import (
	"fmt"
	"reflect"
	"github.com/cosmos/cosmos-sdk/codec"
	"github.com/cosmos/cosmos-sdk/store/prefix"
	sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
	StoreKey = "params"
	TStoreKey = "transient_params"
)
type Subspace struct {
	cdc   *codec.Codec
	key   sdk.StoreKey  
	tkey  sdk.StoreKey  
	name  []byte
	table KeyTable
}
func NewSubspace(cdc *codec.Codec, key sdk.StoreKey, tkey sdk.StoreKey, name string) Subspace {
	return Subspace{
		cdc:   cdc,
		key:   key,
		tkey:  tkey,
		name:  []byte(name),
		table: NewKeyTable(),
	}
}
func (s Subspace) HasKeyTable() bool {
	return len(s.table.m) > 0
}
func (s Subspace) WithKeyTable(table KeyTable) Subspace {
	if table.m == nil {
		panic("SetKeyTable() called with nil KeyTable")
	}
	if len(s.table.m) != 0 {
		panic("SetKeyTable() called on already initialized Subspace")
	}
	for k, v := range table.m {
		s.table.m[k] = v
	}
	name := s.name
	s.name = make([]byte, len(name), len(name)+table.maxKeyLength())
	copy(s.name, name)
	return s
}
func (s Subspace) kvStore(ctx sdk.Context) sdk.KVStore {
	return prefix.NewStore(ctx.KVStore(s.key), append(s.name, '/'))
}
func (s Subspace) transientStore(ctx sdk.Context) sdk.KVStore {
	return prefix.NewStore(ctx.TransientStore(s.tkey), append(s.name, '/'))
}
func (s Subspace) Validate(ctx sdk.Context, key []byte, value interface{}) error {
	attr, ok := s.table.m[string(key)]
	if !ok {
		return fmt.Errorf("parameter %s not registered", string(key))
	}
	if err := attr.vfn(value); err != nil {
		return fmt.Errorf("invalid parameter value: %s", err)
	}
	return nil
}