types

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OperatorParamsPrefix is the prefix used to store the operator params
	// This has been replaced by OperatorServicesPrefix that is
	// used to store the services secured by an operator, the operator params
	// instead have been moved to the x/operators module.
	OperatorParamsPrefix = []byte{0x11}

	// ServiceParamsPrefix is the prefix used to store the service params
	ServiceParamsPrefix = []byte{0x12}
)
View Source
var (
	ErrInvalidLengthModels        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowModels          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group")
)

Functions

func OperatorParamsStoreKey

func OperatorParamsStoreKey(operatorID uint32) []byte

OperatorParamsStoreKey returns the key used to store the operator params The operator params are stored in the x/operator module, now in this module we only keep the list of services secured by a operator.

func ParseOperatorParamsKey

func ParseOperatorParamsKey(bz []byte) (operatorID uint32, err error)

ParseOperatorParamsKey parses the operator ID from the given key The operator params are stored in the x/operator module, now in this module we only keep the list of services secured by a operator.

func ParseServiceParamsKey

func ParseServiceParamsKey(bz []byte) (serviceID uint32, err error)

ParseServiceParamsKey parses the service ID from the given key

func ServiceParamsStoreKey

func ServiceParamsStoreKey(serviceID uint32) []byte

ServiceParamsStoreKey returns the key used to store the service params

Types

type LegacyOperatorParams

type LegacyOperatorParams struct {
	// CommissionRate defines the commission rate charged to delegators, as a
	// fraction.
	CommissionRate cosmossdk_io_math.LegacyDec `` /* 132-byte string literal not displayed */
	// JoinedServicesIDs defines the list of service IDs that the operator has
	// joined.
	JoinedServicesIDs []uint32 `protobuf:"varint,2,rep,packed,name=joined_services_ids,json=joinedServicesIds,proto3" json:"joined_services_ids,omitempty"`
}

LegacyOperatorParams represent previous format that we where using to store a operator params.

func DefaultLegacyOperatorParams

func DefaultLegacyOperatorParams() LegacyOperatorParams

DefaultLegacyOperatorParams returns the default operator params

func NewLegacyOperatorParams

func NewLegacyOperatorParams(commissionRate math.LegacyDec, joinedServicesIDs []uint32) LegacyOperatorParams

NewLegacyOperatorParams creates a new OperatorParams instance

func (*LegacyOperatorParams) Descriptor

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

func (*LegacyOperatorParams) GetJoinedServicesIDs

func (m *LegacyOperatorParams) GetJoinedServicesIDs() []uint32

func (*LegacyOperatorParams) Marshal

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

func (*LegacyOperatorParams) MarshalTo

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

func (*LegacyOperatorParams) MarshalToSizedBuffer

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

func (*LegacyOperatorParams) ProtoMessage

func (*LegacyOperatorParams) ProtoMessage()

func (*LegacyOperatorParams) Reset

func (m *LegacyOperatorParams) Reset()

func (*LegacyOperatorParams) Size

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

func (*LegacyOperatorParams) String

func (m *LegacyOperatorParams) String() string

func (*LegacyOperatorParams) Unmarshal

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

func (*LegacyOperatorParams) Validate

func (p *LegacyOperatorParams) Validate() error

Validate validates the operator params

func (*LegacyOperatorParams) XXX_DiscardUnknown

func (m *LegacyOperatorParams) XXX_DiscardUnknown()

func (*LegacyOperatorParams) XXX_Marshal

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

func (*LegacyOperatorParams) XXX_Merge

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

func (*LegacyOperatorParams) XXX_Size

func (m *LegacyOperatorParams) XXX_Size() int

func (*LegacyOperatorParams) XXX_Unmarshal

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

type LegacyServiceParams

type LegacyServiceParams struct {
	// SlashFraction defines the fraction of the delegation that will be slashed
	// in case of a misbehavior.
	SlashFraction cosmossdk_io_math.LegacyDec `` /* 129-byte string literal not displayed */
	// WhitelistedPoolsIDs defines the list of pool IDs that are providing
	// cryptoeconomic security to the service.
	WhitelistedPoolsIDs []uint32 `` /* 128-byte string literal not displayed */
	// WhitelistedOperatorsIDs defines the list of operator IDs that are allowed
	// to validate this service.
	WhitelistedOperatorsIDs []uint32 `` /* 140-byte string literal not displayed */
}

LegacyServiceParams represent the previous format that we where using to store the params that have been set for an individual service.

func DefaultLegacyServiceParams

func DefaultLegacyServiceParams() LegacyServiceParams

DefaultServiceParams returns the default service params

func NewLegacyServiceParams

func NewLegacyServiceParams(
	slashFraction math.LegacyDec,
	whitelistedPoolsIDs []uint32,
	whitelistedOperatorsIDs []uint32,
) LegacyServiceParams

NewLegacyServiceParams creates a new LegacyServiceParams instance

func (*LegacyServiceParams) Descriptor

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

func (*LegacyServiceParams) GetWhitelistedOperatorsIDs

func (m *LegacyServiceParams) GetWhitelistedOperatorsIDs() []uint32

func (*LegacyServiceParams) GetWhitelistedPoolsIDs

func (m *LegacyServiceParams) GetWhitelistedPoolsIDs() []uint32

func (*LegacyServiceParams) Marshal

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

func (*LegacyServiceParams) MarshalTo

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

func (*LegacyServiceParams) MarshalToSizedBuffer

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

func (*LegacyServiceParams) ProtoMessage

func (*LegacyServiceParams) ProtoMessage()

func (*LegacyServiceParams) Reset

func (m *LegacyServiceParams) Reset()

func (*LegacyServiceParams) Size

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

func (*LegacyServiceParams) String

func (m *LegacyServiceParams) String() string

func (*LegacyServiceParams) Unmarshal

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

func (*LegacyServiceParams) Validate

func (p *LegacyServiceParams) Validate() error

Validate validates the service params

func (*LegacyServiceParams) XXX_DiscardUnknown

func (m *LegacyServiceParams) XXX_DiscardUnknown()

func (*LegacyServiceParams) XXX_Marshal

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

func (*LegacyServiceParams) XXX_Merge

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

func (*LegacyServiceParams) XXX_Size

func (m *LegacyServiceParams) XXX_Size() int

func (*LegacyServiceParams) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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