types

package
v0.0.0-...-b416896 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthGsetTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGsetTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGsetTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthIntTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowIntTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupIntTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var CDTType_name = map[int32]string{
	0: "CDT_TYPE_UNKNOWN",
	1: "CDT_TYPE_INT64",
	2: "CDT_TYPE_GSET",
}
View Source
var CDTType_value = map[string]int32{
	"CDT_TYPE_UNKNOWN": 0,
	"CDT_TYPE_INT64":   1,
	"CDT_TYPE_GSET":    2,
}
View Source
var (
	ErrIndefiniteState = errors.New("indefinite state")
)
View Source
var (
	// ModuleCdc references the global x/ibc-transfer module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding.
	//
	// The actual codec used for serialization should be provided to x/ibc-transfer and
	// defined at the application level.
	ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
)

Functions

func ContextWithOPManager

func ContextWithOPManager(ctx context.Context, opmgr OPManager) context.Context

func NewOPManager

func NewOPManager() *opManager

NewOPManager returns a OPManager instance

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the ibc transfer module interfaces to protobuf Any.

Types

type AddInt64OP

type AddInt64OP struct {
	K []byte `protobuf:"bytes,1,opt,name=k,proto3" json:"k,omitempty"`
	V int64  `protobuf:"varint,2,opt,name=v,proto3" json:"v,omitempty"`
}

func (AddInt64OP) AddTo

func (op AddInt64OP) AddTo(v int64) int64

func (AddInt64OP) Compose

func (op AddInt64OP) Compose(other OP) OP

func (*AddInt64OP) Descriptor

func (*AddInt64OP) Descriptor() ([]byte, []int)

func (AddInt64OP) Inverse

func (op AddInt64OP) Inverse() OP

func (AddInt64OP) Key

func (op AddInt64OP) Key() []byte

func (*AddInt64OP) Marshal

func (m *AddInt64OP) Marshal() (dAtA []byte, err error)

func (*AddInt64OP) MarshalTo

func (m *AddInt64OP) MarshalTo(dAtA []byte) (int, error)

func (*AddInt64OP) MarshalToSizedBuffer

func (m *AddInt64OP) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AddInt64OP) ProtoMessage

func (*AddInt64OP) ProtoMessage()

func (*AddInt64OP) Reset

func (m *AddInt64OP) Reset()

func (*AddInt64OP) Size

func (m *AddInt64OP) Size() (n int)

func (*AddInt64OP) String

func (m *AddInt64OP) String() string

func (*AddInt64OP) Unmarshal

func (m *AddInt64OP) Unmarshal(dAtA []byte) error

func (AddInt64OP) Value

func (op AddInt64OP) Value() int64

func (*AddInt64OP) XXX_DiscardUnknown

func (m *AddInt64OP) XXX_DiscardUnknown()

func (*AddInt64OP) XXX_Marshal

func (m *AddInt64OP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddInt64OP) XXX_Merge

func (m *AddInt64OP) XXX_Merge(src proto.Message)

func (*AddInt64OP) XXX_Size

func (m *AddInt64OP) XXX_Size() int

func (*AddInt64OP) XXX_Unmarshal

func (m *AddInt64OP) XXX_Unmarshal(b []byte) error

type AnyCDTState

type AnyCDTState struct {
	State types.Any `protobuf:"bytes,1,opt,name=state,proto3" json:"state"`
}

func PackCDTState

func PackCDTState(s CDTState) *AnyCDTState

func (*AnyCDTState) Descriptor

func (*AnyCDTState) Descriptor() ([]byte, []int)

func (*AnyCDTState) Marshal

func (m *AnyCDTState) Marshal() (dAtA []byte, err error)

func (*AnyCDTState) MarshalTo

func (m *AnyCDTState) MarshalTo(dAtA []byte) (int, error)

func (*AnyCDTState) MarshalToSizedBuffer

func (m *AnyCDTState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AnyCDTState) ProtoMessage

func (*AnyCDTState) ProtoMessage()

func (*AnyCDTState) Reset

func (m *AnyCDTState) Reset()

func (*AnyCDTState) Size

func (m *AnyCDTState) Size() (n int)

func (*AnyCDTState) String

func (m *AnyCDTState) String() string

func (*AnyCDTState) Unmarshal

func (m *AnyCDTState) Unmarshal(dAtA []byte) error

func (*AnyCDTState) XXX_DiscardUnknown

func (m *AnyCDTState) XXX_DiscardUnknown()

func (*AnyCDTState) XXX_Marshal

func (m *AnyCDTState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AnyCDTState) XXX_Merge

func (m *AnyCDTState) XXX_Merge(src proto.Message)

func (*AnyCDTState) XXX_Size

func (m *AnyCDTState) XXX_Size() int

func (*AnyCDTState) XXX_Unmarshal

func (m *AnyCDTState) XXX_Unmarshal(b []byte) error

type AnyOPs

type AnyOPs struct {
	Ops []types.Any `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops"`
}

func PackOPs

func PackOPs(ops []OP) *AnyOPs

func (*AnyOPs) Descriptor

func (*AnyOPs) Descriptor() ([]byte, []int)

func (*AnyOPs) Marshal

func (m *AnyOPs) Marshal() (dAtA []byte, err error)

func (*AnyOPs) MarshalTo

func (m *AnyOPs) MarshalTo(dAtA []byte) (int, error)

func (*AnyOPs) MarshalToSizedBuffer

func (m *AnyOPs) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AnyOPs) ProtoMessage

func (*AnyOPs) ProtoMessage()

func (*AnyOPs) Reset

func (m *AnyOPs) Reset()

func (*AnyOPs) Size

func (m *AnyOPs) Size() (n int)

func (*AnyOPs) String

func (m *AnyOPs) String() string

func (*AnyOPs) Unmarshal

func (m *AnyOPs) Unmarshal(dAtA []byte) error

func (*AnyOPs) XXX_DiscardUnknown

func (m *AnyOPs) XXX_DiscardUnknown()

func (*AnyOPs) XXX_Marshal

func (m *AnyOPs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AnyOPs) XXX_Merge

func (m *AnyOPs) XXX_Merge(src proto.Message)

func (*AnyOPs) XXX_Size

func (m *AnyOPs) XXX_Size() int

func (*AnyOPs) XXX_Unmarshal

func (m *AnyOPs) XXX_Unmarshal(b []byte) error

type CDTState

type CDTState interface {
	proto.Message
	Apply(OP) error
	IsEmpty() bool
}

CDTState manages the provisonal state

func GetEmptyCDTState

func GetEmptyCDTState(ct CDTType) CDTState

func UnpackCDTState

func UnpackCDTState(m codec.Codec, any *AnyCDTState) (CDTState, error)

type CDTType

type CDTType int32
const (
	CDT_TYPE_UNKNOWN CDTType = 0
	CDT_TYPE_INT64   CDTType = 1
	CDT_TYPE_GSET    CDTType = 2
)

func (CDTType) EnumDescriptor

func (CDTType) EnumDescriptor() ([]byte, []int)

func (CDTType) String

func (x CDTType) String() string

type Element

type Element = []byte

type GSetCDTState

type GSetCDTState struct {
	AddSet [][]byte `protobuf:"bytes,1,rep,name=add_set,json=addSet,proto3" json:"add_set,omitempty"`
}

func NewGSetCDTState

func NewGSetCDTState() *GSetCDTState

func (*GSetCDTState) Apply

func (s *GSetCDTState) Apply(op OP) error

func (*GSetCDTState) Descriptor

func (*GSetCDTState) Descriptor() ([]byte, []int)

func (*GSetCDTState) IsEmpty

func (s *GSetCDTState) IsEmpty() bool

func (*GSetCDTState) Lookup

func (s *GSetCDTState) Lookup(elements []Element) bool

func (*GSetCDTState) Marshal

func (m *GSetCDTState) Marshal() (dAtA []byte, err error)

func (*GSetCDTState) MarshalTo

func (m *GSetCDTState) MarshalTo(dAtA []byte) (int, error)

func (*GSetCDTState) MarshalToSizedBuffer

func (m *GSetCDTState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GSetCDTState) ProtoMessage

func (*GSetCDTState) ProtoMessage()

func (*GSetCDTState) Reset

func (m *GSetCDTState) Reset()

func (*GSetCDTState) Size

func (m *GSetCDTState) Size() (n int)

func (*GSetCDTState) String

func (m *GSetCDTState) String() string

func (*GSetCDTState) Unmarshal

func (m *GSetCDTState) Unmarshal(dAtA []byte) error

func (*GSetCDTState) XXX_DiscardUnknown

func (m *GSetCDTState) XXX_DiscardUnknown()

func (*GSetCDTState) XXX_Marshal

func (m *GSetCDTState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GSetCDTState) XXX_Merge

func (m *GSetCDTState) XXX_Merge(src proto.Message)

func (*GSetCDTState) XXX_Size

func (m *GSetCDTState) XXX_Size() int

func (*GSetCDTState) XXX_Unmarshal

func (m *GSetCDTState) XXX_Unmarshal(b []byte) error

type GSetInverseOP

type GSetInverseOP struct {
	K   []byte   `protobuf:"bytes,1,opt,name=k,proto3" json:"k,omitempty"`
	Add [][]byte `protobuf:"bytes,2,rep,name=add,proto3" json:"add,omitempty"`
}

func NewGSetInverseOP

func NewGSetInverseOP(k []byte, add [][]byte) *GSetInverseOP

func (GSetInverseOP) AddTo

func (op GSetInverseOP) AddTo(elements [][]byte) [][]byte

func (GSetInverseOP) Compose

func (op GSetInverseOP) Compose(other OP) OP

func (*GSetInverseOP) Descriptor

func (*GSetInverseOP) Descriptor() ([]byte, []int)

func (GSetInverseOP) Inverse

func (op GSetInverseOP) Inverse() OP

func (GSetInverseOP) Key

func (op GSetInverseOP) Key() []byte

func (*GSetInverseOP) Marshal

func (m *GSetInverseOP) Marshal() (dAtA []byte, err error)

func (*GSetInverseOP) MarshalTo

func (m *GSetInverseOP) MarshalTo(dAtA []byte) (int, error)

func (*GSetInverseOP) MarshalToSizedBuffer

func (m *GSetInverseOP) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GSetInverseOP) ProtoMessage

func (*GSetInverseOP) ProtoMessage()

func (*GSetInverseOP) Reset

func (m *GSetInverseOP) Reset()

func (*GSetInverseOP) Size

func (m *GSetInverseOP) Size() (n int)

func (*GSetInverseOP) String

func (m *GSetInverseOP) String() string

func (*GSetInverseOP) Unmarshal

func (m *GSetInverseOP) Unmarshal(dAtA []byte) error

func (*GSetInverseOP) XXX_DiscardUnknown

func (m *GSetInverseOP) XXX_DiscardUnknown()

func (*GSetInverseOP) XXX_Marshal

func (m *GSetInverseOP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GSetInverseOP) XXX_Merge

func (m *GSetInverseOP) XXX_Merge(src proto.Message)

func (*GSetInverseOP) XXX_Size

func (m *GSetInverseOP) XXX_Size() int

func (*GSetInverseOP) XXX_Unmarshal

func (m *GSetInverseOP) XXX_Unmarshal(b []byte) error

type GSetOP

type GSetOP struct {
	K   []byte   `protobuf:"bytes,1,opt,name=k,proto3" json:"k,omitempty"`
	Add [][]byte `protobuf:"bytes,2,rep,name=add,proto3" json:"add,omitempty"`
}

func NewGSetOP

func NewGSetOP(k []byte, add [][]byte) *GSetOP

func (GSetOP) AddTo

func (op GSetOP) AddTo(elements [][]byte) [][]byte

func (GSetOP) Compose

func (op GSetOP) Compose(other OP) OP

func (*GSetOP) Descriptor

func (*GSetOP) Descriptor() ([]byte, []int)

func (GSetOP) Inverse

func (op GSetOP) Inverse() OP

func (GSetOP) Key

func (op GSetOP) Key() []byte

func (*GSetOP) Marshal

func (m *GSetOP) Marshal() (dAtA []byte, err error)

func (*GSetOP) MarshalTo

func (m *GSetOP) MarshalTo(dAtA []byte) (int, error)

func (*GSetOP) MarshalToSizedBuffer

func (m *GSetOP) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GSetOP) ProtoMessage

func (*GSetOP) ProtoMessage()

func (*GSetOP) Reset

func (m *GSetOP) Reset()

func (*GSetOP) Size

func (m *GSetOP) Size() (n int)

func (*GSetOP) String

func (m *GSetOP) String() string

func (*GSetOP) Unmarshal

func (m *GSetOP) Unmarshal(dAtA []byte) error

func (*GSetOP) XXX_DiscardUnknown

func (m *GSetOP) XXX_DiscardUnknown()

func (*GSetOP) XXX_Marshal

func (m *GSetOP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GSetOP) XXX_Merge

func (m *GSetOP) XXX_Merge(src proto.Message)

func (*GSetOP) XXX_Size

func (m *GSetOP) XXX_Size() int

func (*GSetOP) XXX_Unmarshal

func (m *GSetOP) XXX_Unmarshal(b []byte) error

type GSetOPComposer

type GSetOPComposer struct{}

func (GSetOPComposer) Compose

func (GSetOPComposer) Compose(a []OP, b OP) []OP

type GSetValue

type GSetValue struct {
	Elements [][]byte `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
}

func NewGSetValue

func NewGSetValue(elements ...Element) *GSetValue

func NewGSetValueFromBytes

func NewGSetValueFromBytes(bz []byte) *GSetValue

func (*GSetValue) Add

func (s *GSetValue) Add(elements ...Element)

func (*GSetValue) Bytes

func (s *GSetValue) Bytes() []byte

func (*GSetValue) Descriptor

func (*GSetValue) Descriptor() ([]byte, []int)

func (*GSetValue) Lookup

func (s *GSetValue) Lookup(elements []Element) bool

func (*GSetValue) Marshal

func (m *GSetValue) Marshal() (dAtA []byte, err error)

func (*GSetValue) MarshalTo

func (m *GSetValue) MarshalTo(dAtA []byte) (int, error)

func (*GSetValue) MarshalToSizedBuffer

func (m *GSetValue) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GSetValue) ProtoMessage

func (*GSetValue) ProtoMessage()

func (*GSetValue) Reset

func (m *GSetValue) Reset()

func (*GSetValue) Size

func (m *GSetValue) Size() (n int)

func (*GSetValue) String

func (m *GSetValue) String() string

func (*GSetValue) Unmarshal

func (m *GSetValue) Unmarshal(dAtA []byte) error

func (*GSetValue) XXX_DiscardUnknown

func (m *GSetValue) XXX_DiscardUnknown()

func (*GSetValue) XXX_Marshal

func (m *GSetValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GSetValue) XXX_Merge

func (m *GSetValue) XXX_Merge(src proto.Message)

func (*GSetValue) XXX_Size

func (m *GSetValue) XXX_Size() int

func (*GSetValue) XXX_Unmarshal

func (m *GSetValue) XXX_Unmarshal(b []byte) error

type Int64CDTState

type Int64CDTState struct {
	Max int64 `protobuf:"varint,1,opt,name=max,proto3" json:"max,omitempty"`
	Min int64 `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"`
}

func NewInt64CDTState

func NewInt64CDTState() *Int64CDTState

func (*Int64CDTState) Apply

func (s *Int64CDTState) Apply(op OP) error

func (*Int64CDTState) Descriptor

func (*Int64CDTState) Descriptor() ([]byte, []int)

func (*Int64CDTState) IsEmpty

func (s *Int64CDTState) IsEmpty() bool

func (*Int64CDTState) Marshal

func (m *Int64CDTState) Marshal() (dAtA []byte, err error)

func (*Int64CDTState) MarshalTo

func (m *Int64CDTState) MarshalTo(dAtA []byte) (int, error)

func (*Int64CDTState) MarshalToSizedBuffer

func (m *Int64CDTState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Int64CDTState) ProtoMessage

func (*Int64CDTState) ProtoMessage()

func (*Int64CDTState) Reset

func (m *Int64CDTState) Reset()

func (*Int64CDTState) Size

func (m *Int64CDTState) Size() (n int)

func (*Int64CDTState) String

func (m *Int64CDTState) String() string

func (*Int64CDTState) Unmarshal

func (m *Int64CDTState) Unmarshal(dAtA []byte) error

func (*Int64CDTState) XXX_DiscardUnknown

func (m *Int64CDTState) XXX_DiscardUnknown()

func (*Int64CDTState) XXX_Marshal

func (m *Int64CDTState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Int64CDTState) XXX_Merge

func (m *Int64CDTState) XXX_Merge(src proto.Message)

func (*Int64CDTState) XXX_Size

func (m *Int64CDTState) XXX_Size() int

func (*Int64CDTState) XXX_Unmarshal

func (m *Int64CDTState) XXX_Unmarshal(b []byte) error

type Int64OP

type Int64OP interface {
	OP
	Value() int64
	AddTo(v int64) int64
}

func NewInt64OP

func NewInt64OP(k []byte, v int64) Int64OP

type Int64OPComposer

type Int64OPComposer struct{}

func (Int64OPComposer) Compose

func (Int64OPComposer) Compose(a []OP, b OP) []OP

type KVStoreI

type KVStoreI interface {
	Prefix(prefix []byte) KVStoreI
	KVStore(ctx sdk.Context) sdk.KVStore

	Set(ctx sdk.Context, key, value []byte)
	Get(ctx sdk.Context, key []byte) []byte
	Has(ctx sdk.Context, key []byte) bool
	Delete(ctx sdk.Context, key []byte)

	GetInt64(ctx sdk.Context, key []byte) int64
	SetInt64(ctx sdk.Context, key []byte, value int64)
}

KVStoreI defines the expected key-value store

type OP

type OP interface {
	proto.Message
	Key() []byte
	Compose(OP) OP
	Inverse() OP
}

func UnpackOPs

func UnpackOPs(m codec.Codec, anyOPs []codectypes.Any) ([]OP, error)

type OPComposer

type OPComposer interface {
	Compose([]OP, OP) []OP
}

type OPManager

type OPManager interface {
	Add(op OP, composer OPComposer)
	OPs() []OP
	GetOPs(key []byte) []OP
}

func OPManagerFromContext

func OPManagerFromContext(ctx context.Context) OPManager

type Schema

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

func NewSchema

func NewSchema() *Schema

func (Schema) Match

func (s Schema) Match(key []byte, tp CDTType) error

func (Schema) MatchGSet

func (s Schema) MatchGSet(key []byte) bool

func (Schema) MatchInt64

func (s Schema) MatchInt64(key []byte) bool

func (Schema) MatchType

func (s Schema) MatchType(key []byte) (CDTType, bool)

func (Schema) MustMatchGSet

func (s Schema) MustMatchGSet(key []byte)

func (Schema) MustMatchInt64

func (s Schema) MustMatchInt64(key []byte)

func (*Schema) Set

func (s *Schema) Set(prefix []byte, tp CDTType)

type SimpleOPComposer

type SimpleOPComposer struct{}

func (SimpleOPComposer) Compose

func (SimpleOPComposer) Compose(a []OP, b OP) []OP

type StoreI

type StoreI interface{}

type SubInt64OP

type SubInt64OP struct {
	K []byte `protobuf:"bytes,1,opt,name=k,proto3" json:"k,omitempty"`
	V int64  `protobuf:"varint,2,opt,name=v,proto3" json:"v,omitempty"`
}

func (SubInt64OP) AddTo

func (op SubInt64OP) AddTo(v int64) int64

func (SubInt64OP) Compose

func (op SubInt64OP) Compose(other OP) OP

func (*SubInt64OP) Descriptor

func (*SubInt64OP) Descriptor() ([]byte, []int)

func (SubInt64OP) Inverse

func (op SubInt64OP) Inverse() OP

func (SubInt64OP) Key

func (op SubInt64OP) Key() []byte

func (*SubInt64OP) Marshal

func (m *SubInt64OP) Marshal() (dAtA []byte, err error)

func (*SubInt64OP) MarshalTo

func (m *SubInt64OP) MarshalTo(dAtA []byte) (int, error)

func (*SubInt64OP) MarshalToSizedBuffer

func (m *SubInt64OP) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SubInt64OP) ProtoMessage

func (*SubInt64OP) ProtoMessage()

func (*SubInt64OP) Reset

func (m *SubInt64OP) Reset()

func (*SubInt64OP) Size

func (m *SubInt64OP) Size() (n int)

func (*SubInt64OP) String

func (m *SubInt64OP) String() string

func (*SubInt64OP) Unmarshal

func (m *SubInt64OP) Unmarshal(dAtA []byte) error

func (SubInt64OP) Value

func (op SubInt64OP) Value() int64

func (*SubInt64OP) XXX_DiscardUnknown

func (m *SubInt64OP) XXX_DiscardUnknown()

func (*SubInt64OP) XXX_Marshal

func (m *SubInt64OP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubInt64OP) XXX_Merge

func (m *SubInt64OP) XXX_Merge(src proto.Message)

func (*SubInt64OP) XXX_Size

func (m *SubInt64OP) XXX_Size() int

func (*SubInt64OP) XXX_Unmarshal

func (m *SubInt64OP) XXX_Unmarshal(b []byte) error

type Tree

type Tree = radix.Tree

Jump to

Keyboard shortcuts

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