types

package
v1.1.7-provider Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 36 Imported by: 69

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the CCV consumer module name
	ModuleName = "ccvconsumer"

	// StoreKey is the store key string for IBC consumer
	StoreKey = ModuleName

	// RouterKey is the message route for IBC consumer
	RouterKey = ModuleName

	// QuerierRoute is the querier route for IBC consumer
	QuerierRoute = ModuleName

	// ConsumerRedistributeName the root string for the consumer-redistribution account address
	ConsumerRedistributeName = "cons_redistribute"

	// ConsumerToSendToProviderName is a "buffer" address for outgoing fees to be transferred to the provider chain
	ConsumerToSendToProviderName = "cons_to_send_to_provider"
)
View Source
const (
	// PortByteKey defines the byte key to store the port ID in store
	PortByteKey byte = iota

	// LastDistributionTransmissionByteKey defines the byte key to store the last distribution transmission
	LastDistributionTransmissionByteKey

	// UnbondingTimeKeyString is the byte key for storing the unbonding period
	UnbondingTimeByteKey

	// ProviderClientKeyString is the byte key for storing the clientID of the provider client
	ProviderClientByteKey

	// ProviderChannelKeyString is the byte key for storing the channelID of the CCV channel
	ProviderChannelByteKey

	// PendingChangesKeyString is the byte key that will store any pending validator set changes
	// received over CCV channel but not yet flushed over ABCI
	PendingChangesByteKey

	// HistoricalInfoKey is the byte prefix that will store the historical info for a given height
	HistoricalInfoBytePrefix

	// PacketMaturityTimePrefix is the byte prefix that will store maturity time for each received VSC packet
	PacketMaturityTimeBytePrefix

	// HeightValsetUpdateIDPrefix is the byte prefix that will store the mapping from block height to valset update ID
	HeightValsetUpdateIDBytePrefix

	// OutstandingDowntimePrefix is the byte prefix that will store the validators outstanding downtime by consensus address
	OutstandingDowntimeBytePrefix

	// PendingDataPacketsBytePrefix is the byte prefix for storing
	// a list of data packets that cannot be sent yet to the provider
	// chain either because the CCV channel is not established or
	// because the client is expired
	PendingDataPacketsBytePrefix

	// CrossChainValidatorPrefix is the byte prefix that will store cross-chain validators by consensus address
	CrossChainValidatorBytePrefix
)

Iota generated keys/key prefixes (as a byte), supports 256 possible values

View Source
const (
	// about 2 hr at 7.6 seconds per blocks
	DefaultBlocksPerDistributionTransmission = 1000

	// Default transfer timeout period is 1 hour, less than the default blocks
	// per dist transmission * average block time.
	// Since IBC token transfers do not have to be in order, it could be easier
	// to reason about the distribution protocol if the previous reward times out
	// before sending the next one. Note that on timeout, the transferred funds are
	// added back to the pool, so the next transfer will include them as well.
	DefaultTransferTimeoutPeriod = time.Hour

	// The default fraction of tokens allocated to the consumer redistribution address
	// during distribution events. The fraction is a string representing a
	// decimal number. For example "0.75" would represent 75%.
	DefaultConsumerRedistributeFrac = "0.75"

	// Default number of historical info entries to persist in store.
	// We use the same default as the staking module, but use a signed integer
	// so that negative values can be caught during parameter validation in a readable way,
	// (and for consistency with other protobuf schemas defined for ccv).
	DefaultHistoricalEntries = int64(stakingtypes.DefaultHistoricalEntries)

	// In general, the default unbonding period on the consumer is one day less
	// than the default unbonding period on the provider, where the provider uses
	// the staking module default.
	DefaultConsumerUnbondingPeriod = stakingtypes.DefaultUnbondingTime - 24*time.Hour
)

Variables

View Source
var (
	ErrInvalidLengthConsumer        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConsumer          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConsumer = fmt.Errorf("proto: unexpected end of group")
)
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 (
	KeyEnabled                           = []byte("Enabled")
	KeyBlocksPerDistributionTransmission = []byte("BlocksPerDistributionTransmission")
	KeyDistributionTransmissionChannel   = []byte("DistributionTransmissionChannel")
	KeyProviderFeePoolAddrStr            = []byte("ProviderFeePoolAddrStr")
	KeyTransferTimeoutPeriod             = []byte("TransferTimeoutPeriod")
	KeyConsumerRedistributionFrac        = []byte("ConsumerRedistributionFraction")
	KeyHistoricalEntries                 = []byte("HistoricalEntries")
	KeyConsumerUnbondingPeriod           = []byte("UnbondingPeriod")
)

Reflection based keys for params subspace

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrNoProposerChannelId = sdkerrors.Register(ModuleName, 1, "no established CCV channel")
)

Consumer sentinel errors

Functions

func CrossChainValidatorKey

func CrossChainValidatorKey(addr []byte) []byte

CrossChainValidatorKey returns the key to a cross chain validator by consensus address

func HeightValsetUpdateIDKey

func HeightValsetUpdateIDKey(height uint64) []byte

HeightValsetUpdateIDKey returns the key to a valset update ID for a given block height

func HistoricalInfoKey

func HistoricalInfoKey(height int64) []byte

HistoricalInfoKey returns the key to historical info to a given block height

func LastDistributionTransmissionKey

func LastDistributionTransmissionKey() []byte

LastDistributionTransmissionKey returns the key to the last distribution transmission in the store

func OutstandingDowntimeKey

func OutstandingDowntimeKey(address sdk.ConsAddress) []byte

OutstandingDowntimeKey returns the key to a validators' outstanding downtime by consensus address

func PacketMaturityTimeKey

func PacketMaturityTimeKey(vscID uint64, maturityTime time.Time) []byte

PacketMaturityTimeKey returns the key for storing the maturity time for a given received VSC packet id

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable type declaration for parameters

func PendingChangesKey

func PendingChangesKey() []byte

PendingChangesKey returns the key for storing pending validator set changes

func PortKey

func PortKey() []byte

PortKey returns the key to the port ID in the store

func ProviderChannelKey

func ProviderChannelKey() []byte

ProviderChannelKey returns the key for storing channelID of the provider chain

func ProviderClientIDKey added in v0.1.4

func ProviderClientIDKey() []byte

ProviderClientIDKey returns the key for storing clientID of the provider

func RegisterQueryHandler added in v0.2.0

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient added in v0.2.0

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint added in v0.2.0

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer added in v0.2.0

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer added in v0.2.0

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func UnbondingTimeKey

func UnbondingTimeKey() []byte

UnbondingTimeKey returns the key for storing the unbonding period

Types

type CrossChainValidator

type CrossChainValidator struct {
	Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Power   int64  `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"`
	// pubkey is the consensus public key of the validator, as a Protobuf Any.
	Pubkey *types.Any `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty" yaml:"consensus_pubkey"`
}

CrossChainValidator defines the validators for CCV consumer module

func NewCCValidator

func NewCCValidator(address []byte, power int64, pubKey cryptotypes.PubKey) (CrossChainValidator, error)

func (CrossChainValidator) ConsPubKey

func (ccv CrossChainValidator) ConsPubKey() (cryptotypes.PubKey, error)

ConsPubKey returns the validator PubKey as a cryptotypes.PubKey.

func (*CrossChainValidator) Descriptor

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

func (*CrossChainValidator) GetAddress

func (m *CrossChainValidator) GetAddress() []byte

func (*CrossChainValidator) GetPower

func (m *CrossChainValidator) GetPower() int64

func (*CrossChainValidator) GetPubkey

func (m *CrossChainValidator) GetPubkey() *types.Any

func (*CrossChainValidator) Marshal

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

func (*CrossChainValidator) MarshalTo

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

func (*CrossChainValidator) MarshalToSizedBuffer

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

func (*CrossChainValidator) ProtoMessage

func (*CrossChainValidator) ProtoMessage()

func (*CrossChainValidator) Reset

func (m *CrossChainValidator) Reset()

func (*CrossChainValidator) Size

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

func (*CrossChainValidator) String

func (m *CrossChainValidator) String() string

func (*CrossChainValidator) Unmarshal

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

func (CrossChainValidator) UnpackInterfaces

func (ccv CrossChainValidator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*CrossChainValidator) XXX_DiscardUnknown

func (m *CrossChainValidator) XXX_DiscardUnknown()

func (*CrossChainValidator) XXX_Marshal

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

func (*CrossChainValidator) XXX_Merge

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

func (*CrossChainValidator) XXX_Size

func (m *CrossChainValidator) XXX_Size() int

func (*CrossChainValidator) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
	Params            Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	ProviderClientId  string `protobuf:"bytes,2,opt,name=provider_client_id,json=providerClientId,proto3" json:"provider_client_id,omitempty"`
	ProviderChannelId string `protobuf:"bytes,3,opt,name=provider_channel_id,json=providerChannelId,proto3" json:"provider_channel_id,omitempty"`
	NewChain          bool   `protobuf:"varint,4,opt,name=new_chain,json=newChain,proto3" json:"new_chain,omitempty"`
	// ProviderClientState filled in on new chain, nil on restart.
	ProviderClientState *types.ClientState `protobuf:"bytes,5,opt,name=provider_client_state,json=providerClientState,proto3" json:"provider_client_state,omitempty"`
	// ProviderConsensusState filled in on new chain, nil on restart.
	ProviderConsensusState *types.ConsensusState `` /* 129-byte string literal not displayed */
	// MaturingPackets nil on new chain, filled in on restart.
	MaturingPackets []MaturingVSCPacket `protobuf:"bytes,7,rep,name=maturing_packets,json=maturingPackets,proto3" json:"maturing_packets"`
	// InitialValset filled in on new chain and on restart.
	InitialValSet []types1.ValidatorUpdate `protobuf:"bytes,8,rep,name=initial_val_set,json=initialValSet,proto3" json:"initial_val_set"`
	// HeightToValsetUpdateId nil on new chain, filled in on restart.
	HeightToValsetUpdateId []HeightToValsetUpdateID `protobuf:"bytes,9,rep,name=height_to_valset_update_id,json=heightToValsetUpdateId,proto3" json:"height_to_valset_update_id"`
	// OutstandingDowntimes nil on new chain, filled  in on restart.
	OutstandingDowntimeSlashing []OutstandingDowntime `` /* 135-byte string literal not displayed */
	// PendingConsumerPackets nil on new chain, filled in on restart.
	PendingConsumerPackets types2.ConsumerPacketDataList `protobuf:"bytes,11,opt,name=pending_consumer_packets,json=pendingConsumerPackets,proto3" json:"pending_consumer_packets"`
	// LastTransmissionBlockHeight nil on new chain, filled in on restart.
	LastTransmissionBlockHeight LastTransmissionBlockHeight `` /* 137-byte string literal not displayed */
}

GenesisState defines the CCV consumer chain genesis state

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns a default disabled consumer chain genesis state. This allows the module to be hooked up to app without getting use unless explicitly specified in genesis.

func NewInitialGenesisState

func NewInitialGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState,
	initValSet []abci.ValidatorUpdate, params Params) *GenesisState

NewInitialGenesisState returns a consumer GenesisState for a completely new consumer chain.

func NewRestartGenesisState

func NewRestartGenesisState(
	clientID, channelID string,
	maturingPackets []MaturingVSCPacket,
	initValSet []abci.ValidatorUpdate,
	heightToValsetUpdateIDs []HeightToValsetUpdateID,
	pendingConsumerPackets ccv.ConsumerPacketDataList,
	outstandingDowntimes []OutstandingDowntime,
	lastTransBlockHeight LastTransmissionBlockHeight,
	params Params,
) *GenesisState

NewRestartGenesisState returns a consumer GenesisState that has already been established.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetHeightToValsetUpdateId added in v0.2.0

func (m *GenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID

func (*GenesisState) GetInitialValSet

func (m *GenesisState) GetInitialValSet() []types1.ValidatorUpdate

func (*GenesisState) GetLastTransmissionBlockHeight added in v1.0.0

func (m *GenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight

func (*GenesisState) GetMaturingPackets

func (m *GenesisState) GetMaturingPackets() []MaturingVSCPacket

func (*GenesisState) GetNewChain

func (m *GenesisState) GetNewChain() bool

func (*GenesisState) GetOutstandingDowntimeSlashing added in v0.2.0

func (m *GenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPendingConsumerPackets added in v1.0.0

func (m *GenesisState) GetPendingConsumerPackets() types2.ConsumerPacketDataList

func (*GenesisState) GetProviderChannelId

func (m *GenesisState) GetProviderChannelId() string

func (*GenesisState) GetProviderClientId

func (m *GenesisState) GetProviderClientId() string

func (*GenesisState) GetProviderClientState

func (m *GenesisState) GetProviderClientState() *types.ClientState

func (*GenesisState) GetProviderConsensusState

func (m *GenesisState) GetProviderConsensusState() *types.ConsensusState

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 (gs 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

type HeightToValsetUpdateID added in v0.2.0

type HeightToValsetUpdateID struct {
	Height         uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	ValsetUpdateId uint64 `protobuf:"varint,2,opt,name=valset_update_id,json=valsetUpdateId,proto3" json:"valset_update_id,omitempty"`
}

HeightValsetUpdateID defines the genesis information for the mapping of each block height to a valset update id

func (*HeightToValsetUpdateID) Descriptor added in v0.2.0

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

func (*HeightToValsetUpdateID) GetHeight added in v0.2.0

func (m *HeightToValsetUpdateID) GetHeight() uint64

func (*HeightToValsetUpdateID) GetValsetUpdateId added in v0.2.0

func (m *HeightToValsetUpdateID) GetValsetUpdateId() uint64

func (*HeightToValsetUpdateID) Marshal added in v0.2.0

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

func (*HeightToValsetUpdateID) MarshalTo added in v0.2.0

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

func (*HeightToValsetUpdateID) MarshalToSizedBuffer added in v0.2.0

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

func (*HeightToValsetUpdateID) ProtoMessage added in v0.2.0

func (*HeightToValsetUpdateID) ProtoMessage()

func (*HeightToValsetUpdateID) Reset added in v0.2.0

func (m *HeightToValsetUpdateID) Reset()

func (*HeightToValsetUpdateID) Size added in v0.2.0

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

func (*HeightToValsetUpdateID) String added in v0.2.0

func (m *HeightToValsetUpdateID) String() string

func (*HeightToValsetUpdateID) Unmarshal added in v0.2.0

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

func (*HeightToValsetUpdateID) XXX_DiscardUnknown added in v0.2.0

func (m *HeightToValsetUpdateID) XXX_DiscardUnknown()

func (*HeightToValsetUpdateID) XXX_Marshal added in v0.2.0

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

func (*HeightToValsetUpdateID) XXX_Merge added in v0.2.0

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

func (*HeightToValsetUpdateID) XXX_Size added in v0.2.0

func (m *HeightToValsetUpdateID) XXX_Size() int

func (*HeightToValsetUpdateID) XXX_Unmarshal added in v0.2.0

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

type LastTransmissionBlockHeight

type LastTransmissionBlockHeight struct {
	Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
}

LastTransmissionBlockHeight is the last time validator holding pools were transmitted to the provider chain

func (*LastTransmissionBlockHeight) Descriptor

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

func (*LastTransmissionBlockHeight) GetHeight

func (m *LastTransmissionBlockHeight) GetHeight() int64

func (*LastTransmissionBlockHeight) Marshal

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

func (*LastTransmissionBlockHeight) MarshalTo

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

func (*LastTransmissionBlockHeight) MarshalToSizedBuffer

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

func (*LastTransmissionBlockHeight) ProtoMessage

func (*LastTransmissionBlockHeight) ProtoMessage()

func (*LastTransmissionBlockHeight) Reset

func (m *LastTransmissionBlockHeight) Reset()

func (*LastTransmissionBlockHeight) Size

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

func (*LastTransmissionBlockHeight) String

func (m *LastTransmissionBlockHeight) String() string

func (*LastTransmissionBlockHeight) Unmarshal

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

func (*LastTransmissionBlockHeight) XXX_DiscardUnknown

func (m *LastTransmissionBlockHeight) XXX_DiscardUnknown()

func (*LastTransmissionBlockHeight) XXX_Marshal

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

func (*LastTransmissionBlockHeight) XXX_Merge

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

func (*LastTransmissionBlockHeight) XXX_Size

func (m *LastTransmissionBlockHeight) XXX_Size() int

func (*LastTransmissionBlockHeight) XXX_Unmarshal

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

type MaturingVSCPacket

type MaturingVSCPacket struct {
	VscId        uint64    `protobuf:"varint,1,opt,name=vscId,proto3" json:"vscId,omitempty"`
	MaturityTime time.Time `protobuf:"bytes,2,opt,name=maturity_time,json=maturityTime,proto3,stdtime" json:"maturity_time"`
}

MaturingVSCPacket contains the maturing time of a received VSCPacket

func (*MaturingVSCPacket) Descriptor

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

func (*MaturingVSCPacket) GetMaturityTime

func (m *MaturingVSCPacket) GetMaturityTime() time.Time

func (*MaturingVSCPacket) GetVscId

func (m *MaturingVSCPacket) GetVscId() uint64

func (*MaturingVSCPacket) Marshal

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

func (*MaturingVSCPacket) MarshalTo

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

func (*MaturingVSCPacket) MarshalToSizedBuffer

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

func (*MaturingVSCPacket) ProtoMessage

func (*MaturingVSCPacket) ProtoMessage()

func (*MaturingVSCPacket) Reset

func (m *MaturingVSCPacket) Reset()

func (*MaturingVSCPacket) Size

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

func (*MaturingVSCPacket) String

func (m *MaturingVSCPacket) String() string

func (*MaturingVSCPacket) Unmarshal

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

func (MaturingVSCPacket) Validate

func (mat MaturingVSCPacket) Validate() error

func (*MaturingVSCPacket) XXX_DiscardUnknown

func (m *MaturingVSCPacket) XXX_DiscardUnknown()

func (*MaturingVSCPacket) XXX_Marshal

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

func (*MaturingVSCPacket) XXX_Merge

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

func (*MaturingVSCPacket) XXX_Size

func (m *MaturingVSCPacket) XXX_Size() int

func (*MaturingVSCPacket) XXX_Unmarshal

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

type NextFeeDistributionEstimate added in v0.2.0

type NextFeeDistributionEstimate struct {
	// current block height at the time of querying
	CurrentHeight int64 `protobuf:"varint,1,opt,name=currentHeight,proto3" json:"currentHeight,omitempty"`
	// block height at which last distribution took place
	LastHeight int64 `protobuf:"varint,2,opt,name=lastHeight,proto3" json:"lastHeight,omitempty"`
	// block height at which next distribution will take place
	NextHeight int64 `protobuf:"varint,3,opt,name=nextHeight,proto3" json:"nextHeight,omitempty"`
	// ratio between consumer and provider fee distribution
	DistributionFraction string `protobuf:"bytes,4,opt,name=distribution_fraction,json=distributionFraction,proto3" json:"distribution_fraction,omitempty"`
	// total accruead fees at the time of querying
	Total string `protobuf:"bytes,5,opt,name=total,proto3" json:"total,omitempty"`
	// amount distibuted to provider chain
	ToProvider string `protobuf:"bytes,6,opt,name=toProvider,proto3" json:"toProvider,omitempty"`
	// amount distributed (kept) by consumer chain
	ToConsumer string `protobuf:"bytes,7,opt,name=toConsumer,proto3" json:"toConsumer,omitempty"`
}

NextFeeDistributionEstimate holds information about next fee distribution

func (*NextFeeDistributionEstimate) Descriptor added in v0.2.0

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

func (*NextFeeDistributionEstimate) GetCurrentHeight added in v0.2.0

func (m *NextFeeDistributionEstimate) GetCurrentHeight() int64

func (*NextFeeDistributionEstimate) GetDistributionFraction added in v0.2.0

func (m *NextFeeDistributionEstimate) GetDistributionFraction() string

func (*NextFeeDistributionEstimate) GetLastHeight added in v0.2.0

func (m *NextFeeDistributionEstimate) GetLastHeight() int64

func (*NextFeeDistributionEstimate) GetNextHeight added in v0.2.0

func (m *NextFeeDistributionEstimate) GetNextHeight() int64

func (*NextFeeDistributionEstimate) GetToConsumer added in v0.2.0

func (m *NextFeeDistributionEstimate) GetToConsumer() string

func (*NextFeeDistributionEstimate) GetToProvider added in v0.2.0

func (m *NextFeeDistributionEstimate) GetToProvider() string

func (*NextFeeDistributionEstimate) GetTotal added in v0.2.0

func (m *NextFeeDistributionEstimate) GetTotal() string

func (*NextFeeDistributionEstimate) Marshal added in v0.2.0

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

func (*NextFeeDistributionEstimate) MarshalTo added in v0.2.0

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

func (*NextFeeDistributionEstimate) MarshalToSizedBuffer added in v0.2.0

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

func (*NextFeeDistributionEstimate) ProtoMessage added in v0.2.0

func (*NextFeeDistributionEstimate) ProtoMessage()

func (*NextFeeDistributionEstimate) Reset added in v0.2.0

func (m *NextFeeDistributionEstimate) Reset()

func (*NextFeeDistributionEstimate) Size added in v0.2.0

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

func (*NextFeeDistributionEstimate) String added in v0.2.0

func (m *NextFeeDistributionEstimate) String() string

func (*NextFeeDistributionEstimate) Unmarshal added in v0.2.0

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

func (*NextFeeDistributionEstimate) XXX_DiscardUnknown added in v0.2.0

func (m *NextFeeDistributionEstimate) XXX_DiscardUnknown()

func (*NextFeeDistributionEstimate) XXX_Marshal added in v0.2.0

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

func (*NextFeeDistributionEstimate) XXX_Merge added in v0.2.0

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

func (*NextFeeDistributionEstimate) XXX_Size added in v0.2.0

func (m *NextFeeDistributionEstimate) XXX_Size() int

func (*NextFeeDistributionEstimate) XXX_Unmarshal added in v0.2.0

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

type OutstandingDowntime added in v0.2.0

type OutstandingDowntime struct {
	ValidatorConsensusAddress string `` /* 138-byte string literal not displayed */
}

OutstandingDowntime defines the genesis information for each validator flagged with an outstanding downtime slashing.

func (*OutstandingDowntime) Descriptor added in v0.2.0

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

func (*OutstandingDowntime) GetValidatorConsensusAddress added in v0.2.0

func (m *OutstandingDowntime) GetValidatorConsensusAddress() string

func (*OutstandingDowntime) Marshal added in v0.2.0

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

func (*OutstandingDowntime) MarshalTo added in v0.2.0

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

func (*OutstandingDowntime) MarshalToSizedBuffer added in v0.2.0

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

func (*OutstandingDowntime) ProtoMessage added in v0.2.0

func (*OutstandingDowntime) ProtoMessage()

func (*OutstandingDowntime) Reset added in v0.2.0

func (m *OutstandingDowntime) Reset()

func (*OutstandingDowntime) Size added in v0.2.0

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

func (*OutstandingDowntime) String added in v0.2.0

func (m *OutstandingDowntime) String() string

func (*OutstandingDowntime) Unmarshal added in v0.2.0

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

func (*OutstandingDowntime) XXX_DiscardUnknown added in v0.2.0

func (m *OutstandingDowntime) XXX_DiscardUnknown()

func (*OutstandingDowntime) XXX_Marshal added in v0.2.0

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

func (*OutstandingDowntime) XXX_Merge added in v0.2.0

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

func (*OutstandingDowntime) XXX_Size added in v0.2.0

func (m *OutstandingDowntime) XXX_Size() int

func (*OutstandingDowntime) XXX_Unmarshal added in v0.2.0

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

type Params

type Params struct {
	// TODO: Remove enabled flag and find a better way to setup e2e tests
	// See: https://github.com/cosmos/interchain-security/issues/339
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	///////////////////////
	// Distribution Params
	// Number of blocks between ibc-token-transfers from the consumer chain to
	// the provider chain. Note that at this transmission event a fraction of
	// the accumulated tokens are divided and sent consumer redistribution
	// address.
	BlocksPerDistributionTransmission int64 `` /* 165-byte string literal not displayed */
	// Channel, and provider-chain receiving address to send distribution token
	// transfers over. These parameters is auto-set during the consumer <->
	// provider handshake procedure.
	DistributionTransmissionChannel string `` /* 156-byte string literal not displayed */
	ProviderFeePoolAddrStr          string `` /* 133-byte string literal not displayed */
	// Sent CCV related IBC packets will timeout after this duration
	CcvTimeoutPeriod time.Duration `protobuf:"bytes,5,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"`
	// Sent transfer related IBC packets will timeout after this duration
	TransferTimeoutPeriod time.Duration `` /* 128-byte string literal not displayed */
	// The fraction of tokens allocated to the consumer redistribution address
	// during distribution events. The fraction is a string representing a
	// decimal number. For example "0.75" would represent 75%.
	ConsumerRedistributionFraction string `` /* 153-byte string literal not displayed */
	// The number of historical info entries to persist in store.
	// This param is a part of the cosmos sdk staking module. In the case of
	// a ccv enabled consumer chain, the ccv module acts as the staking module.
	HistoricalEntries int64 `protobuf:"varint,8,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"`
	// Unbonding period for the consumer,
	// which should be smaller than that of the provider in general.
	UnbondingPeriod time.Duration `protobuf:"bytes,9,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"`
}

Params defines the parameters for CCV consumer module

func DefaultParams

func DefaultParams() Params

DefaultParams is the default params for the consumer module

func NewParams

func NewParams(enabled bool, blocksPerDistributionTransmission int64,
	distributionTransmissionChannel, providerFeePoolAddrStr string,
	ccvTimeoutPeriod time.Duration, transferTimeoutPeriod time.Duration,
	consumerRedistributionFraction string, historicalEntries int64,
	consumerUnbondingPeriod time.Duration) Params

NewParams creates new consumer parameters with provided arguments

func (*Params) Descriptor

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

func (*Params) GetBlocksPerDistributionTransmission

func (m *Params) GetBlocksPerDistributionTransmission() int64

func (*Params) GetCcvTimeoutPeriod added in v0.2.0

func (m *Params) GetCcvTimeoutPeriod() time.Duration

func (*Params) GetConsumerRedistributionFraction added in v0.2.0

func (m *Params) GetConsumerRedistributionFraction() string

func (*Params) GetDistributionTransmissionChannel

func (m *Params) GetDistributionTransmissionChannel() string

func (*Params) GetEnabled

func (m *Params) GetEnabled() bool

func (*Params) GetHistoricalEntries added in v0.2.0

func (m *Params) GetHistoricalEntries() int64

func (*Params) GetProviderFeePoolAddrStr

func (m *Params) GetProviderFeePoolAddrStr() string

func (*Params) GetTransferTimeoutPeriod added in v0.2.0

func (m *Params) GetTransferTimeoutPeriod() time.Duration

func (*Params) GetUnbondingPeriod added in v0.2.0

func (m *Params) GetUnbondingPeriod() time.Duration

func (*Params) Marshal

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

func (*Params) MarshalTo

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

func (*Params) MarshalToSizedBuffer

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

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs implements params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() error

Validate all ccv-consumer module parameters

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

type QueryClient added in v0.2.0

type QueryClient interface {
	// ConsumerGenesis queries the genesis state needed to start a consumer chain
	// whose proposal has been accepted
	QueryNextFeeDistribution(ctx context.Context, in *QueryNextFeeDistributionEstimateRequest, opts ...grpc.CallOption) (*QueryNextFeeDistributionEstimateResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient added in v0.2.0

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryNextFeeDistributionEstimateRequest added in v0.2.0

type QueryNextFeeDistributionEstimateRequest struct {
}

func (*QueryNextFeeDistributionEstimateRequest) Descriptor added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateRequest) Marshal added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateRequest) MarshalTo added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateRequest) MarshalToSizedBuffer added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateRequest) ProtoMessage added in v0.2.0

func (*QueryNextFeeDistributionEstimateRequest) Reset added in v0.2.0

func (*QueryNextFeeDistributionEstimateRequest) Size added in v0.2.0

func (*QueryNextFeeDistributionEstimateRequest) String added in v0.2.0

func (*QueryNextFeeDistributionEstimateRequest) Unmarshal added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateRequest) XXX_DiscardUnknown added in v0.2.0

func (m *QueryNextFeeDistributionEstimateRequest) XXX_DiscardUnknown()

func (*QueryNextFeeDistributionEstimateRequest) XXX_Marshal added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateRequest) XXX_Merge added in v0.2.0

func (*QueryNextFeeDistributionEstimateRequest) XXX_Size added in v0.2.0

func (*QueryNextFeeDistributionEstimateRequest) XXX_Unmarshal added in v0.2.0

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

type QueryNextFeeDistributionEstimateResponse added in v0.2.0

type QueryNextFeeDistributionEstimateResponse struct {
	Data *NextFeeDistributionEstimate `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

func (*QueryNextFeeDistributionEstimateResponse) Descriptor added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateResponse) GetData added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) Marshal added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateResponse) MarshalTo added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateResponse) MarshalToSizedBuffer added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateResponse) ProtoMessage added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) Reset added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) Size added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) String added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) Unmarshal added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) XXX_DiscardUnknown added in v0.2.0

func (m *QueryNextFeeDistributionEstimateResponse) XXX_DiscardUnknown()

func (*QueryNextFeeDistributionEstimateResponse) XXX_Marshal added in v0.2.0

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

func (*QueryNextFeeDistributionEstimateResponse) XXX_Merge added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) XXX_Size added in v0.2.0

func (*QueryNextFeeDistributionEstimateResponse) XXX_Unmarshal added in v0.2.0

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

type QueryServer added in v0.2.0

type QueryServer interface {
	// ConsumerGenesis queries the genesis state needed to start a consumer chain
	// whose proposal has been accepted
	QueryNextFeeDistribution(context.Context, *QueryNextFeeDistributionEstimateRequest) (*QueryNextFeeDistributionEstimateResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer added in v0.2.0

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) QueryNextFeeDistribution added in v0.2.0

Jump to

Keyboard shortcuts

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