cosmos-sdk/testutil/testdata/test_helper.go
SaReN 919e906866
Minor Code Cleanup - gRPC queries (#6862)
* add missing RegisterQueryService

* Update generated proto files

* Update grpc tests for auth,bank

* Make format

* fix godoc

* Address suggestions

* Update godoc
2020-07-28 12:53:35 +00:00

42 lines
977 B
Go

package testdata
import (
amino "github.com/tendermint/go-amino"
"github.com/cosmos/cosmos-sdk/codec/types"
)
func NewTestInterfaceRegistry() types.InterfaceRegistry {
registry := types.NewInterfaceRegistry()
registry.RegisterInterface("Animal", (*Animal)(nil))
registry.RegisterImplementations(
(*Animal)(nil),
&Dog{},
&Cat{},
)
registry.RegisterImplementations(
(*HasAnimalI)(nil),
&HasAnimal{},
)
registry.RegisterImplementations(
(*HasHasAnimalI)(nil),
&HasHasAnimal{},
)
return registry
}
func NewTestAmino() *amino.Codec {
cdc := amino.NewCodec()
cdc.RegisterInterface((*Animal)(nil), nil)
cdc.RegisterConcrete(&Dog{}, "testdata/Dog", nil)
cdc.RegisterConcrete(&Cat{}, "testdata/Cat", nil)
cdc.RegisterInterface((*HasAnimalI)(nil), nil)
cdc.RegisterConcrete(&HasAnimal{}, "testdata/HasAnimal", nil)
cdc.RegisterInterface((*HasHasAnimalI)(nil), nil)
cdc.RegisterConcrete(&HasHasAnimal{}, "testdata/HasHasAnimal", nil)
return cdc
}