common

package
v0.0.0-...-69704c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultFactory = func(higherThan func(h int64) bool, version SelectVersion, internal interface{}) SelectorFactory {
		return func() Selector {
			return NewCommonHeightSelector(higherThan, version, internal)
		}
	}
)

Functions

func MarshalChannel

func MarshalChannel(cdc *codec.CodecProxy, c *types.Channel) ([]byte, error)

func MustMarshalChannel

func MustMarshalChannel(cdc *codec.CodecProxy, c *types.Channel) []byte

func MustMarshalConnection

func MustMarshalConnection(cdc *codec.CodecProxy, c *conntypes.ConnectionEnd) []byte

func MustUnmarshalChannel

func MustUnmarshalChannel(cdc *codec.CodecProxy, data []byte) *types.Channel

func MustUnmarshalConnection

func MustUnmarshalConnection(cdc *codec.CodecProxy, data []byte) *conntypes.ConnectionEnd

func UnmarshalConnection

func UnmarshalConnection(cdc *codec.CodecProxy, data []byte) (*conntypes.ConnectionEnd, error)

Types

type CommonHeightSelector

type CommonHeightSelector struct {
	// contains filtered or unexported fields
}

func NewCommonHeightSelector

func NewCommonHeightSelector(higherThan func(h int64) bool, version SelectVersion, internal interface{}) *CommonHeightSelector

func (*CommonHeightSelector) Select

func (c *CommonHeightSelector) Select(ctx sdk.Context) (interface{}, bool)

func (*CommonHeightSelector) Version

func (c *CommonHeightSelector) Version() SelectVersion

type SelectVersion

type SelectVersion float64

type Selector

type Selector interface {
	Version() SelectVersion
	Select(ctx sdk.Context) (interface{}, bool)
}

TODO,use genesis

type SelectorFactory

type SelectorFactory func() Selector

type SelectorStrategy

type SelectorStrategy struct {
	// contains filtered or unexported fields
}

func NewSelectorStrategy

func NewSelectorStrategy(internal interface{}) *SelectorStrategy

func (*SelectorStrategy) GetInternal

func (f *SelectorStrategy) GetInternal() interface{}

func (*SelectorStrategy) GetProxy

func (f *SelectorStrategy) GetProxy(ctx sdk.Context) interface{}

func (*SelectorStrategy) RegisterSelectors

func (f *SelectorStrategy) RegisterSelectors(factories ...SelectorFactory)

func (*SelectorStrategy) Seal

func (f *SelectorStrategy) Seal()

func (*SelectorStrategy) Seald

func (f *SelectorStrategy) Seald() bool

type Selectors

type Selectors []Selector

func (Selectors) Len

func (m Selectors) Len() int

func (Selectors) Less

func (m Selectors) Less(i, j int) bool

func (Selectors) Swap

func (m Selectors) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL