types

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 (
	ErrInvalidLengthV2Incentives        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowV2Incentives          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupV2Incentives = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ParamsKey                     = []byte("Params")
	ParamStoreKeyEnableIncentives = []byte("EnableIncentives")
	ParamStoreKeyAllocationLimit  = []byte("AllocationLimit")
	ParamStoreKeyEpochIdentifier  = []byte("EpochIdentifier")
	ParamStoreKeyRewardScaler     = []byte("RewardScaler")
)

Parameter store key

View Source
var (
	DefaultEnableIncentives          = true
	DefaultAllocationLimit           = sdk.NewDecWithPrec(5, 2)
	DefaultIncentivesEpochIdentifier = epochstypes.WeekEpochID
	DefaultRewardScalar              = sdk.NewDecWithPrec(12, 1)
)

Functions

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the parameter key table.

Types

type CancelV2IncentiveProposal

type CancelV2IncentiveProposal struct {
	// title of the proposal
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// description of the proposal
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contract address of the incentivized smart contract
	Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"`
}

CancelV2IncentiveProposal is a gov Content type to cancel an V2Incentive

func (*CancelV2IncentiveProposal) Descriptor

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

func (*CancelV2IncentiveProposal) GetContract

func (m *CancelV2IncentiveProposal) GetContract() string

func (*CancelV2IncentiveProposal) GetDescription

func (m *CancelV2IncentiveProposal) GetDescription() string

func (*CancelV2IncentiveProposal) GetTitle

func (m *CancelV2IncentiveProposal) GetTitle() string

func (*CancelV2IncentiveProposal) Marshal

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

func (*CancelV2IncentiveProposal) MarshalTo

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

func (*CancelV2IncentiveProposal) MarshalToSizedBuffer

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

func (*CancelV2IncentiveProposal) ProtoMessage

func (*CancelV2IncentiveProposal) ProtoMessage()

func (*CancelV2IncentiveProposal) Reset

func (m *CancelV2IncentiveProposal) Reset()

func (*CancelV2IncentiveProposal) Size

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

func (*CancelV2IncentiveProposal) String

func (m *CancelV2IncentiveProposal) String() string

func (*CancelV2IncentiveProposal) Unmarshal

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

func (*CancelV2IncentiveProposal) XXX_DiscardUnknown

func (m *CancelV2IncentiveProposal) XXX_DiscardUnknown()

func (*CancelV2IncentiveProposal) XXX_Marshal

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

func (*CancelV2IncentiveProposal) XXX_Merge

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

func (*CancelV2IncentiveProposal) XXX_Size

func (m *CancelV2IncentiveProposal) XXX_Size() int

func (*CancelV2IncentiveProposal) XXX_Unmarshal

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

type RegisterV2IncentiveProposal

type RegisterV2IncentiveProposal struct {
	// title of the proposal
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// description of the proposal
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contract address to be registered
	Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"`
	// allocations defines the denoms and percentage of rewards to be allocated
	Allocations github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,4,rep,name=allocations,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"allocations"`
	// epochs is the number of remaining epochs for the V2Incentive
	Epochs uint32 `protobuf:"varint,5,opt,name=epochs,proto3" json:"epochs,omitempty"`
}

RegisterV2IncentiveProposal is a gov Content type to register an V2Incentive

func (*RegisterV2IncentiveProposal) Descriptor

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

func (*RegisterV2IncentiveProposal) GetAllocations

func (*RegisterV2IncentiveProposal) GetContract

func (m *RegisterV2IncentiveProposal) GetContract() string

func (*RegisterV2IncentiveProposal) GetDescription

func (m *RegisterV2IncentiveProposal) GetDescription() string

func (*RegisterV2IncentiveProposal) GetEpochs

func (m *RegisterV2IncentiveProposal) GetEpochs() uint32

func (*RegisterV2IncentiveProposal) GetTitle

func (m *RegisterV2IncentiveProposal) GetTitle() string

func (*RegisterV2IncentiveProposal) Marshal

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

func (*RegisterV2IncentiveProposal) MarshalTo

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

func (*RegisterV2IncentiveProposal) MarshalToSizedBuffer

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

func (*RegisterV2IncentiveProposal) ProtoMessage

func (*RegisterV2IncentiveProposal) ProtoMessage()

func (*RegisterV2IncentiveProposal) Reset

func (m *RegisterV2IncentiveProposal) Reset()

func (*RegisterV2IncentiveProposal) Size

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

func (*RegisterV2IncentiveProposal) String

func (m *RegisterV2IncentiveProposal) String() string

func (*RegisterV2IncentiveProposal) Unmarshal

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

func (*RegisterV2IncentiveProposal) XXX_DiscardUnknown

func (m *RegisterV2IncentiveProposal) XXX_DiscardUnknown()

func (*RegisterV2IncentiveProposal) XXX_Marshal

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

func (*RegisterV2IncentiveProposal) XXX_Merge

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

func (*RegisterV2IncentiveProposal) XXX_Size

func (m *RegisterV2IncentiveProposal) XXX_Size() int

func (*RegisterV2IncentiveProposal) XXX_Unmarshal

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

type V2GasMeter

type V2GasMeter struct {
	// contract is the hex address of the incentivized smart contract
	Contract string `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
	// participant address that interacts with the V2Incentive
	Participant string `protobuf:"bytes,2,opt,name=participant,proto3" json:"participant,omitempty"`
	// cumulative_gas spent during the epoch
	CumulativeGas uint64 `protobuf:"varint,3,opt,name=cumulative_gas,json=cumulativeGas,proto3" json:"cumulative_gas,omitempty"`
}

V2V2GasMeter tracks the cumulative gas spent per participant in one epoch

func (*V2GasMeter) Descriptor

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

func (*V2GasMeter) GetContract

func (m *V2GasMeter) GetContract() string

func (*V2GasMeter) GetCumulativeGas

func (m *V2GasMeter) GetCumulativeGas() uint64

func (*V2GasMeter) GetParticipant

func (m *V2GasMeter) GetParticipant() string

func (*V2GasMeter) Marshal

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

func (*V2GasMeter) MarshalTo

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

func (*V2GasMeter) MarshalToSizedBuffer

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

func (*V2GasMeter) ProtoMessage

func (*V2GasMeter) ProtoMessage()

func (*V2GasMeter) Reset

func (m *V2GasMeter) Reset()

func (*V2GasMeter) Size

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

func (*V2GasMeter) String

func (m *V2GasMeter) String() string

func (*V2GasMeter) Unmarshal

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

func (*V2GasMeter) XXX_DiscardUnknown

func (m *V2GasMeter) XXX_DiscardUnknown()

func (*V2GasMeter) XXX_Marshal

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

func (*V2GasMeter) XXX_Merge

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

func (*V2GasMeter) XXX_Size

func (m *V2GasMeter) XXX_Size() int

func (*V2GasMeter) XXX_Unmarshal

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

type V2GenesisState

type V2GenesisState struct {
	// V2Params are the V2Incentives module parameters
	V2Params V2Params `protobuf:"bytes,1,opt,name=V2Params,proto3" json:"V2Params"`
	// V2Incentives is a slice of active V2Incentives
	V2Incentives []V2Incentive `protobuf:"bytes,2,rep,name=V2Incentives,proto3" json:"V2Incentives"`
	// gas_meters is a slice of active V2GasMeters
	V2GasMeters []V2GasMeter `protobuf:"bytes,3,rep,name=gas_meters,json=V2GasMeters,proto3" json:"gas_meters"`
}

V2GenesisState defines the module's genesis state.

func (*V2GenesisState) Descriptor

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

func (*V2GenesisState) GetV2GasMeters

func (m *V2GenesisState) GetV2GasMeters() []V2GasMeter

func (*V2GenesisState) GetV2Incentives

func (m *V2GenesisState) GetV2Incentives() []V2Incentive

func (*V2GenesisState) GetV2Params

func (m *V2GenesisState) GetV2Params() V2Params

func (*V2GenesisState) Marshal

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

func (*V2GenesisState) MarshalTo

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

func (*V2GenesisState) MarshalToSizedBuffer

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

func (*V2GenesisState) ProtoMessage

func (*V2GenesisState) ProtoMessage()

func (*V2GenesisState) Reset

func (m *V2GenesisState) Reset()

func (*V2GenesisState) Size

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

func (*V2GenesisState) String

func (m *V2GenesisState) String() string

func (*V2GenesisState) Unmarshal

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

func (*V2GenesisState) XXX_DiscardUnknown

func (m *V2GenesisState) XXX_DiscardUnknown()

func (*V2GenesisState) XXX_Marshal

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

func (*V2GenesisState) XXX_Merge

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

func (*V2GenesisState) XXX_Size

func (m *V2GenesisState) XXX_Size() int

func (*V2GenesisState) XXX_Unmarshal

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

type V2Incentive

type V2Incentive struct {
	// contract address of the smart contract to be incentivized
	Contract string `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
	// allocations is a slice of denoms and percentages of rewards to be allocated
	Allocations github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=allocations,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"allocations"`
	// epochs defines the number of remaining epochs for the V2Incentive
	Epochs uint32 `protobuf:"varint,3,opt,name=epochs,proto3" json:"epochs,omitempty"`
	// start_time of the V2Incentive distribution
	StartTime time.Time `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"`
	// total_gas is the cumulative gas spent by all gas meters of the V2Incentive during the epoch
	TotalGas uint64 `protobuf:"varint,5,opt,name=total_gas,json=totalGas,proto3" json:"total_gas,omitempty"`
}

V2Incentive defines an instance that organizes distribution conditions for a given smart contract

func (*V2Incentive) Descriptor

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

func (*V2Incentive) GetAllocations

func (*V2Incentive) GetContract

func (m *V2Incentive) GetContract() string

func (*V2Incentive) GetEpochs

func (m *V2Incentive) GetEpochs() uint32

func (*V2Incentive) GetStartTime

func (m *V2Incentive) GetStartTime() time.Time

func (*V2Incentive) GetTotalGas

func (m *V2Incentive) GetTotalGas() uint64

func (*V2Incentive) Marshal

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

func (*V2Incentive) MarshalTo

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

func (*V2Incentive) MarshalToSizedBuffer

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

func (*V2Incentive) ProtoMessage

func (*V2Incentive) ProtoMessage()

func (*V2Incentive) Reset

func (m *V2Incentive) Reset()

func (*V2Incentive) Size

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

func (*V2Incentive) String

func (m *V2Incentive) String() string

func (*V2Incentive) Unmarshal

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

func (*V2Incentive) XXX_DiscardUnknown

func (m *V2Incentive) XXX_DiscardUnknown()

func (*V2Incentive) XXX_Marshal

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

func (*V2Incentive) XXX_Merge

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

func (*V2Incentive) XXX_Size

func (m *V2Incentive) XXX_Size() int

func (*V2Incentive) XXX_Unmarshal

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

type V2Params

type V2Params struct {
	// enable_V2Incentives is the parameter to enable V2Incentives
	EnableIncentives bool `protobuf:"varint,1,opt,name=enable_V2Incentives,json=EnableIncentives,proto3" json:"enable_V2Incentives,omitempty"`
	// allocation_limit is the maximum percentage an V2Incentive can allocate per denomination
	AllocationLimit github_com_cosmos_cosmos_sdk_types.Dec `` /* 146-byte string literal not displayed */
	// V2Incentives_epoch_identifier for the epochs module hooks
	IncentivesEpochIdentifier string `` /* 142-byte string literal not displayed */
	// reward_scaler is the scaling factor for capping rewards
	RewardScaler github_com_cosmos_cosmos_sdk_types.Dec `` /* 137-byte string literal not displayed */
}

V2Params defines the V2Incentives module V2Params

func DefaultParams

func DefaultParams() V2Params

func NewParams

func NewParams(
	enableIncentives bool,
	allocationLimit sdk.Dec,
	epochIdentifier string,
	rewardScaler sdk.Dec,
) V2Params

NewParams creates a new Params object

func (*V2Params) Descriptor

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

func (*V2Params) GetEnableIncentives

func (m *V2Params) GetEnableIncentives() bool

func (*V2Params) GetIncentivesEpochIdentifier

func (m *V2Params) GetIncentivesEpochIdentifier() string

func (*V2Params) Marshal

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

func (*V2Params) MarshalTo

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

func (*V2Params) MarshalToSizedBuffer

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

func (*V2Params) ParamSetPairs

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

ParamSetPairs returns the parameter set pairs.

func (*V2Params) ProtoMessage

func (*V2Params) ProtoMessage()

func (*V2Params) Reset

func (m *V2Params) Reset()

func (*V2Params) Size

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

func (*V2Params) String

func (m *V2Params) String() string

func (*V2Params) Unmarshal

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

func (V2Params) Validate

func (p V2Params) Validate() error

func (*V2Params) XXX_DiscardUnknown

func (m *V2Params) XXX_DiscardUnknown()

func (*V2Params) XXX_Marshal

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

func (*V2Params) XXX_Merge

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

func (*V2Params) XXX_Size

func (m *V2Params) XXX_Size() int

func (*V2Params) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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