types

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STALE_ENTRY_TIME int64  = 1440 // 1440 blocks (equivalent to 24 hours when block_time = 1min)
	MODULE_NAME      string = "common"
)
View Source
const (
	EntryIndexKey string = "Entry_Index_"
	EntryKey      string = "Entry_Value_"
)

Variables

View Source
var (
	ErrEntryNotFound = sdkerrors.Register(MODULE_NAME, 1, "entry not found")
	ErrInvalidIndex  = sdkerrors.Register(MODULE_NAME, 2, "entry index is invalid")
)

x/pairing module sentinel errors

View Source
var (
	ErrInvalidLengthFixationEntry        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFixationEntry          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFixationEntry = fmt.Errorf("proto: unexpected end of group")
)

Functions

func EncodeKey added in v0.7.0

func EncodeKey(key uint64) []byte

func KeyPrefix added in v0.7.0

func KeyPrefix(p string) []byte

Types

type Entry added in v0.7.0

type Entry struct {
	Index    string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
	Block    uint64 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"`
	StaleAt  uint64 `protobuf:"varint,3,opt,name=stale_at,json=staleAt,proto3" json:"stale_at,omitempty"`
	Refcount uint64 `protobuf:"varint,4,opt,name=refcount,proto3" json:"refcount,omitempty"`
	Data     []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
}

func (*Entry) Descriptor added in v0.7.0

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

func (*Entry) GetBlock added in v0.7.0

func (m *Entry) GetBlock() uint64

func (*Entry) GetData added in v0.7.0

func (m *Entry) GetData() []byte

func (*Entry) GetIndex added in v0.7.0

func (m *Entry) GetIndex() string

func (*Entry) GetRefcount added in v0.7.0

func (m *Entry) GetRefcount() uint64

func (*Entry) GetStaleAt added in v0.8.1

func (m *Entry) GetStaleAt() uint64

func (Entry) IsStale added in v0.8.1

func (entry Entry) IsStale(ctx sdk.Context) bool

IsEntryStale tests whether an entry is stale, i.e. has refcount zero _and_ has passed its stale_at time (more than STALE_ENTRY_TIME since deletion).

func (*Entry) Marshal added in v0.7.0

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

func (*Entry) MarshalTo added in v0.7.0

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

func (*Entry) MarshalToSizedBuffer added in v0.7.0

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

func (*Entry) ProtoMessage added in v0.7.0

func (*Entry) ProtoMessage()

func (*Entry) Reset added in v0.7.0

func (m *Entry) Reset()

func (*Entry) Size added in v0.7.0

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

func (*Entry) String added in v0.7.0

func (m *Entry) String() string

func (*Entry) Unmarshal added in v0.7.0

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

func (*Entry) XXX_DiscardUnknown added in v0.7.0

func (m *Entry) XXX_DiscardUnknown()

func (*Entry) XXX_Marshal added in v0.7.0

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

func (*Entry) XXX_Merge added in v0.7.0

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

func (*Entry) XXX_Size added in v0.7.0

func (m *Entry) XXX_Size() int

func (*Entry) XXX_Unmarshal added in v0.7.0

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

Jump to

Keyboard shortcuts

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