types

package
v22.0.0-testnet Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// we don't use a `-` as RouterKey must be alphanumeric
	ModuleName = "downtimedetector"
	StoreKey   = ModuleName
	RouterKey  = ModuleName

	QuerierRoute = ModuleName
)

Variables

View Source
var (
	DowntimeToDuration  = btree.NewMap[Downtime, time.Duration](16)
	DefaultLastDowntime = time.Unix(0, 0)
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Downtime_name = map[int32]string{
	0:  "DURATION_30S",
	1:  "DURATION_1M",
	2:  "DURATION_2M",
	3:  "DURATION_3M",
	4:  "DURATION_4M",
	5:  "DURATION_5M",
	6:  "DURATION_10M",
	7:  "DURATION_20M",
	8:  "DURATION_30M",
	9:  "DURATION_40M",
	10: "DURATION_50M",
	11: "DURATION_1H",
	12: "DURATION_1_5H",
	13: "DURATION_2H",
	14: "DURATION_2_5H",
	15: "DURATION_3H",
	16: "DURATION_4H",
	17: "DURATION_5H",
	18: "DURATION_6H",
	19: "DURATION_9H",
	20: "DURATION_12H",
	21: "DURATION_18H",
	22: "DURATION_24H",
	23: "DURATION_36H",
	24: "DURATION_48H",
}
View Source
var Downtime_value = map[string]int32{
	"DURATION_30S":  0,
	"DURATION_1M":   1,
	"DURATION_2M":   2,
	"DURATION_3M":   3,
	"DURATION_4M":   4,
	"DURATION_5M":   5,
	"DURATION_10M":  6,
	"DURATION_20M":  7,
	"DURATION_30M":  8,
	"DURATION_40M":  9,
	"DURATION_50M":  10,
	"DURATION_1H":   11,
	"DURATION_1_5H": 12,
	"DURATION_2H":   13,
	"DURATION_2_5H": 14,
	"DURATION_3H":   15,
	"DURATION_4H":   16,
	"DURATION_5H":   17,
	"DURATION_6H":   18,
	"DURATION_9H":   19,
	"DURATION_12H":  20,
	"DURATION_18H":  21,
	"DURATION_24H":  22,
	"DURATION_36H":  23,
	"DURATION_48H":  24,
}

Functions

func DowntimeStrings

func DowntimeStrings() []string

func GetLastBlockTimestampKey

func GetLastBlockTimestampKey() []byte

func GetLastDowntimeOfLengthKey

func GetLastDowntimeOfLengthKey(downtimeDur Downtime) []byte

Types

type Downtime

type Downtime int32
const (
	Downtime_DURATION_30S  Downtime = 0
	Downtime_DURATION_1M   Downtime = 1
	Downtime_DURATION_2M   Downtime = 2
	Downtime_DURATION_3M   Downtime = 3
	Downtime_DURATION_4M   Downtime = 4
	Downtime_DURATION_5M   Downtime = 5
	Downtime_DURATION_10M  Downtime = 6
	Downtime_DURATION_20M  Downtime = 7
	Downtime_DURATION_30M  Downtime = 8
	Downtime_DURATION_40M  Downtime = 9
	Downtime_DURATION_50M  Downtime = 10
	Downtime_DURATION_1H   Downtime = 11
	Downtime_DURATION_1_5H Downtime = 12
	Downtime_DURATION_2H   Downtime = 13
	Downtime_DURATION_2_5H Downtime = 14
	Downtime_DURATION_3H   Downtime = 15
	Downtime_DURATION_4H   Downtime = 16
	Downtime_DURATION_5H   Downtime = 17
	Downtime_DURATION_6H   Downtime = 18
	Downtime_DURATION_9H   Downtime = 19
	Downtime_DURATION_12H  Downtime = 20
	Downtime_DURATION_18H  Downtime = 21
	Downtime_DURATION_24H  Downtime = 22
	Downtime_DURATION_36H  Downtime = 23
	Downtime_DURATION_48H  Downtime = 24
)

func DowntimeByDuration

func DowntimeByDuration(duration time.Duration) (Downtime, error)

func (Downtime) EnumDescriptor

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

func (Downtime) String

func (x Downtime) String() string

type GenesisDowntimeEntry

type GenesisDowntimeEntry struct {
	Duration     Downtime  `` /* 133-byte string literal not displayed */
	LastDowntime time.Time `protobuf:"bytes,2,opt,name=last_downtime,json=lastDowntime,proto3,stdtime" json:"last_downtime" yaml:"last_downtime"`
}

func NewGenesisDowntimeEntry

func NewGenesisDowntimeEntry(dur Downtime, time time.Time) GenesisDowntimeEntry

func (*GenesisDowntimeEntry) Descriptor

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

func (*GenesisDowntimeEntry) GetDuration

func (m *GenesisDowntimeEntry) GetDuration() Downtime

func (*GenesisDowntimeEntry) GetLastDowntime

func (m *GenesisDowntimeEntry) GetLastDowntime() time.Time

func (*GenesisDowntimeEntry) Marshal

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

func (*GenesisDowntimeEntry) MarshalTo

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

func (*GenesisDowntimeEntry) MarshalToSizedBuffer

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

func (*GenesisDowntimeEntry) ProtoMessage

func (*GenesisDowntimeEntry) ProtoMessage()

func (*GenesisDowntimeEntry) Reset

func (m *GenesisDowntimeEntry) Reset()

func (*GenesisDowntimeEntry) Size

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

func (*GenesisDowntimeEntry) String

func (m *GenesisDowntimeEntry) String() string

func (*GenesisDowntimeEntry) Unmarshal

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

func (*GenesisDowntimeEntry) XXX_DiscardUnknown

func (m *GenesisDowntimeEntry) XXX_DiscardUnknown()

func (*GenesisDowntimeEntry) XXX_Marshal

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

func (*GenesisDowntimeEntry) XXX_Merge

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

func (*GenesisDowntimeEntry) XXX_Size

func (m *GenesisDowntimeEntry) XXX_Size() int

func (*GenesisDowntimeEntry) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
	Downtimes     []GenesisDowntimeEntry `protobuf:"bytes,1,rep,name=downtimes,proto3" json:"downtimes"`
	LastBlockTime time.Time              `protobuf:"bytes,2,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time" yaml:"last_block_time"`
}

GenesisState defines the twap module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

func (*GenesisState) Descriptor

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

func (*GenesisState) GetDowntimes

func (m *GenesisState) GetDowntimes() []GenesisDowntimeEntry

func (*GenesisState) GetLastBlockTime

func (m *GenesisState) GetLastBlockTime() time.Time

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

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

func (*GenesisState) MarshalToSizedBuffer

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

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

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

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

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

func (*GenesisState) Validate

func (g *GenesisState) Validate() error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

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

func (*GenesisState) XXX_Merge

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

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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