types

package
v0.0.0-...-305c64e Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "ps"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName

	// QuerierRoute to be used for querier msgs
	QuerierRoute = ModuleName
)
View Source
const (
	AttributeValueCategory = ModuleName
)

ps module event types

View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

View Source
const (
	MeterAccountPrefix = "meterAccount-"
)
View Source
const (
	ParametersPrefix = "parameters-"
)
View Source
const (
	QueryGetMeterId = "get-meterId"
)
View Source
const (
	QueryListMeterAccount = "list-meterAccount"
)
View Source
const (
	QueryListParameters = "list-parameters"
)
View Source
const (
	TokenName = "ectoken"
)

Variables

View Source
var (
	ErrInvalid = sdkerrors.Register(ModuleName, 1, "custom error message")
)
View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for ps module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on codec

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the ps genesis parameters

Types

type Admin

type Admin struct {
	Id      string         `json:"id"`
	Account sdk.AccAddress `json:"account"`
}

Admin section

func NewAdmin

func NewAdmin() Admin

func (Admin) String

func (w Admin) String() string

implement fmt.Stringer

type Error

type Error struct {
	Code        string
	Description string
}

type GenesisState

type GenesisState struct {
}

GenesisState - all ps state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState - default GenesisState used by Cosmos Hub

func NewGenesisState

func NewGenesisState() GenesisState

NewGenesisState creates a new GenesisState object

type Measure

type Measure struct {
	Signal    string         `json:"signal"`
	Timestamp string         `json:"timestamp"`
	MeterId   string         `json:"meterId"`
	Value     string         `json:"value"`
	Account   sdk.AccAddress `json:"account"`
	Cost      sdk.Coins      `json:"cost"`
}

Measure section

func NewMeasure

func NewMeasure() Measure

func (Measure) String

func (w Measure) String() string

implement fmt.Stringer

type MeterAccount

type MeterAccount struct {
	Meter   string         `json:"meter" yaml:"meter"`
	Account sdk.AccAddress `json:"account" yaml:"account"`
	Admin   sdk.AccAddress `json:"admin" yaml:"admin"`
}

MeterAccount section

type MsgCreateMeterAccount

type MsgCreateMeterAccount struct {
	Meter   string         `json:"meter" yaml:"meter"`
	Account sdk.AccAddress `json:"account" yaml:"account"`
	Admin   sdk.AccAddress `json:"admin" yaml:"admin"`
}

func NewMsgCreateMeterAccount

func NewMsgCreateMeterAccount(meter string, account sdk.AccAddress, admin sdk.AccAddress) MsgCreateMeterAccount

func (MsgCreateMeterAccount) GetSignBytes

func (msg MsgCreateMeterAccount) GetSignBytes() []byte

func (MsgCreateMeterAccount) GetSigners

func (msg MsgCreateMeterAccount) GetSigners() []sdk.AccAddress

func (MsgCreateMeterAccount) Route

func (msg MsgCreateMeterAccount) Route() string

func (MsgCreateMeterAccount) Type

func (msg MsgCreateMeterAccount) Type() string

func (MsgCreateMeterAccount) ValidateBasic

func (msg MsgCreateMeterAccount) ValidateBasic() error

type MsgSetAdmin

type MsgSetAdmin struct {
	Id      string         `json:"Id"`
	Account sdk.AccAddress `json:"account"`
}

func NewMsgSetAdmin

func NewMsgSetAdmin(id string, account sdk.AccAddress) MsgSetAdmin

NewMsgNewMeasure is a constructor function for MsgNewMeasure

func (MsgSetAdmin) GetSignBytes

func (msg MsgSetAdmin) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetAdmin) GetSigners

func (msg MsgSetAdmin) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgSetAdmin) Route

func (msg MsgSetAdmin) Route() string

Route should return the name of the module

func (MsgSetAdmin) Type

func (msg MsgSetAdmin) Type() string

Type should return the action

func (MsgSetAdmin) ValidateBasic

func (msg MsgSetAdmin) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgSetMeasure

type MsgSetMeasure struct {
	Signal    string         `json:"signal"`
	Timestamp string         `json:"timestamp"`
	MeterId   string         `json:"meterId"`
	Value     string         `json:"value"`
	Account   sdk.AccAddress `json:"account"`
}

func NewMsgSetMeasure

func NewMsgSetMeasure(signal string, timestamp string, meterId string, value string, account sdk.AccAddress) MsgSetMeasure

NewMsgNewMeasure is a constructor function for MsgNewMeasure

func (MsgSetMeasure) GetSignBytes

func (msg MsgSetMeasure) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetMeasure) GetSigners

func (msg MsgSetMeasure) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgSetMeasure) Route

func (msg MsgSetMeasure) Route() string

Route should return the name of the module

func (MsgSetMeasure) Type

func (msg MsgSetMeasure) Type() string

Type should return the action

func (MsgSetMeasure) ValidateBasic

func (msg MsgSetMeasure) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgSetParameters

type MsgSetParameters struct {
	ID             string
	Creator        sdk.AccAddress `json:"creator" yaml:"creator"`
	ProdConvFactor string         `json:"prodConvFactor" yaml:"prodConvFactor"`
	ConsConvFactor string         `json:"consConvFactor" yaml:"consConvFactor"`
	MaxConsumption string         `json:"maxConsumption" yaml:"maxConsumption"`
	Penalty        string         `json:"penalty" yaml:"penalty"`
}

func NewMsgSetParameters

func NewMsgSetParameters(creator sdk.AccAddress, prodConvFactor string, consConvFactor string, maxConsumption string, penalty string) MsgSetParameters

func (MsgSetParameters) GetSignBytes

func (msg MsgSetParameters) GetSignBytes() []byte

func (MsgSetParameters) GetSigners

func (msg MsgSetParameters) GetSigners() []sdk.AccAddress

func (MsgSetParameters) Route

func (msg MsgSetParameters) Route() string

func (MsgSetParameters) Type

func (msg MsgSetParameters) Type() string

func (MsgSetParameters) ValidateBasic

func (msg MsgSetParameters) ValidateBasic() error

type MsgTokensMinting

type MsgTokensMinting struct {
	Amount    sdk.Coins      `json:"amount" yaml:"amount"`
	Recipient sdk.AccAddress `json:"recipient" yaml:"recipient"`
	Minter    sdk.AccAddress `json:"minter" yaml:"minter"`
}

func NewMsgTokensMinting

func NewMsgTokensMinting(amount sdk.Coins, recipient sdk.AccAddress, minter sdk.AccAddress) MsgTokensMinting

NewMsgNewMeasure is a constructor function for MsgNewMeasure

func (MsgTokensMinting) GetSignBytes

func (msg MsgTokensMinting) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgTokensMinting) GetSigners

func (msg MsgTokensMinting) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgTokensMinting) Route

func (msg MsgTokensMinting) Route() string

Route should return the name of the module

func (MsgTokensMinting) Type

func (msg MsgTokensMinting) Type() string

Type should return the action

func (MsgTokensMinting) ValidateBasic

func (msg MsgTokensMinting) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type ParamSubspace

type ParamSubspace interface {
	WithKeyTable(table params.KeyTable) params.Subspace
	Get(ctx sdk.Context, key []byte, ptr interface{})
	GetParamSet(ctx sdk.Context, ps params.ParamSet)
	SetParamSet(ctx sdk.Context, ps params.ParamSet)
}

ParamSubspace defines the expected Subspace interfacace

type Parameters

type Parameters struct {
	Creator        sdk.AccAddress `json:"creator" yaml:"creator"`
	ProdConvFactor string         `json:"prodConvFactor" yaml:"prodConvFactor"`
	ConsConvFactor string         `json:"consConvFactor" yaml:"consConvFactor"`
	MaxConsumption string         `json:"maxConsumption" yaml:"maxConsumption"`
	Penalty        string         `json:"penalty" yaml:"penalty"`
}

Parameters section

func NewParameters

func NewParameters() Parameters

func (Parameters) String

func (w Parameters) String() string

implement fmt.Stringer

type Params

type Params struct {
}

Params - used for initializing default parameter for ps at genesis

func DefaultParams

func DefaultParams() Params

DefaultParams defines the parameters for this module

func NewParams

func NewParams() Params

NewParams creates a new Params object

func (*Params) ParamSetPairs

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

ParamSetPairs - Implements params.ParamSet

func (Params) String

func (p Params) String() string

String implements the stringer interface for Params

type QueryResAdmin

type QueryResAdmin []string

QueryResAdmin Queries

func (QueryResAdmin) String

func (n QueryResAdmin) String() string

implement fmt.Stringer

type QueryResAllowed

type QueryResAllowed []string

QueryResAllowed Queries

func (QueryResAllowed) String

func (n QueryResAllowed) String() string

implement fmt.Stringer

type QueryResGetMeterId

type QueryResGetMeterId []string

QueryResGetMeterId Queries

func (QueryResGetMeterId) String

func (n QueryResGetMeterId) String() string

implement fmt.Stringer

type QueryResMeasures

type QueryResMeasures []string

QueryResMeasures Queries

func (QueryResMeasures) String

func (n QueryResMeasures) String() string

implement fmt.Stringer

type QueryResParameters

type QueryResParameters []string

QueryResParameters Queries

func (QueryResParameters) String

func (n QueryResParameters) String() string

implement fmt.Stringer

type TokensMinting

type TokensMinting struct {
	Amount    sdk.Coins      `json:"amount" yaml:"amount"`
	Recipient sdk.AccAddress `json:"recipient" yaml:"recipient"`
	Minter    sdk.AccAddress `json:"minter" yaml:"minter"`
}

TokensMinting section

func NewTokensMinting

func NewTokensMinting() TokensMinting

func (TokensMinting) String

func (w TokensMinting) String() string

implement fmt.Stringer

Jump to

Keyboard shortcuts

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