2020-01-24 07:32:00 -08:00
|
|
|
package testdata
|
|
|
|
|
|
|
|
// DONTCOVER
|
|
|
|
// nolint
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-05-05 07:28:20 -07:00
|
|
|
|
2020-12-08 01:27:08 -08:00
|
|
|
"github.com/gogo/protobuf/proto"
|
|
|
|
|
2020-05-05 07:28:20 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
2020-01-24 07:32:00 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
type Animal interface {
|
2020-12-08 01:27:08 -08:00
|
|
|
proto.Message
|
|
|
|
|
2020-01-24 07:32:00 -08:00
|
|
|
Greet() string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c Cat) Greet() string {
|
|
|
|
return fmt.Sprintf("Meow, my name is %s", c.Moniker)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d Dog) Greet() string {
|
|
|
|
return fmt.Sprintf("Roof, my name is %s", d.Name)
|
|
|
|
}
|
2020-05-05 07:28:20 -07:00
|
|
|
|
|
|
|
var _ types.UnpackInterfacesMessage = HasAnimal{}
|
|
|
|
|
|
|
|
func (m HasAnimal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
|
|
|
|
var animal Animal
|
|
|
|
return unpacker.UnpackAny(m.Animal, &animal)
|
|
|
|
}
|
2020-05-06 13:47:03 -07:00
|
|
|
|
|
|
|
type HasAnimalI interface {
|
|
|
|
TheAnimal() Animal
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ HasAnimalI = &HasAnimal{}
|
|
|
|
|
|
|
|
func (m HasAnimal) TheAnimal() Animal {
|
|
|
|
return m.Animal.GetCachedValue().(Animal)
|
|
|
|
}
|
|
|
|
|
|
|
|
type HasHasAnimalI interface {
|
|
|
|
TheHasAnimal() HasAnimalI
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ HasHasAnimalI = &HasHasAnimal{}
|
|
|
|
|
|
|
|
func (m HasHasAnimal) TheHasAnimal() HasAnimalI {
|
|
|
|
return m.HasAnimal.GetCachedValue().(HasAnimalI)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ types.UnpackInterfacesMessage = HasHasAnimal{}
|
|
|
|
|
|
|
|
func (m HasHasAnimal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
|
|
|
|
var animal HasAnimalI
|
|
|
|
return unpacker.UnpackAny(m.HasAnimal, &animal)
|
|
|
|
}
|
|
|
|
|
|
|
|
type HasHasHasAnimalI interface {
|
|
|
|
TheHasHasAnimal() HasHasAnimalI
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ HasHasAnimalI = &HasHasAnimal{}
|
|
|
|
|
|
|
|
func (m HasHasHasAnimal) TheHasHasAnimal() HasHasAnimalI {
|
|
|
|
return m.HasHasAnimal.GetCachedValue().(HasHasAnimalI)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ types.UnpackInterfacesMessage = HasHasHasAnimal{}
|
|
|
|
|
|
|
|
func (m HasHasHasAnimal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
|
|
|
|
var animal HasHasAnimalI
|
|
|
|
return unpacker.UnpackAny(m.HasHasAnimal, &animal)
|
|
|
|
}
|