cosmos-sdk/core/registry/interface_registrar.go

28 lines
1.1 KiB
Go

package registry
import (
"cosmossdk.io/core/transaction"
)
// InterfaceRegistrar is an interface for registering interfaces and their implementation.
// It is a subset of the Cosmos SDK InterfaceRegistry for registration only.
type InterfaceRegistrar interface {
// RegisterInterface associates protoName as the public name for the
// interface passed in as iface. This is to be used primarily to create
// a public facing registry of interface implementations for clients.
// protoName should be a well-chosen public facing name that remains stable.
// RegisterInterface takes an optional list of impls to be registered
// as implementations of iface.
//
// Ex:
// registry.RegisterInterface("cosmos.base.v1beta1.Msg", (*sdk.Msg)(nil))
RegisterInterface(protoName string, iface interface{}, impls ...transaction.Msg)
// RegisterImplementations registers impls as concrete implementations of
// the interface iface.
//
// Ex:
// registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{})
RegisterImplementations(iface interface{}, impls ...transaction.Msg)
}