v038

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName            = "evidence"
	DefaultParamspace     = ModuleName
	DefaultMaxEvidenceAge = 60 * 2 * time.Second
)

Default parameter values

View Source
const (
	RouteEquivocation = "equivocation"
	TypeEquivocation  = "equivocation"
)

Evidence type constants

Variables

View Source
var (

	// ModuleCdc references the global x/evidence module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/evidence and
	// defined at the application level.
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

This section is empty.

Types

type Equivocation

type Equivocation struct {
	Height           int64           `json:"height" yaml:"height"`
	Time             time.Time       `json:"time" yaml:"time"`
	Power            int64           `json:"power" yaml:"power"`
	ConsensusAddress sdk.ConsAddress `json:"consensus_address" yaml:"consensus_address"`
}

Equivocation implements the Evidence interface and defines evidence of double signing misbehavior.

func (Equivocation) GetHeight

func (e Equivocation) GetHeight() int64

GetHeight returns the height at time of the Equivocation infraction.

func (Equivocation) Hash

func (e Equivocation) Hash() tmbytes.HexBytes

Hash returns the hash of an Equivocation object.

func (Equivocation) Route

func (e Equivocation) Route() string

Route returns the Evidence Handler route for an Equivocation type.

func (Equivocation) String

func (e Equivocation) String() string

func (Equivocation) Type

func (e Equivocation) Type() string

Type returns the Evidence Handler type for an Equivocation type.

func (Equivocation) ValidateBasic

func (e Equivocation) ValidateBasic() error

ValidateBasic performs basic stateless validation checks on an Equivocation object.

type Evidence

type Evidence interface {
	Route() string
	Type() string
	String() string
	Hash() tmbytes.HexBytes
	ValidateBasic() error

	// Height at which the infraction occurred
	GetHeight() int64
}

Evidence defines the contract which concrete evidence types of misbehavior must implement.

type GenesisState

type GenesisState struct {
	Params   Params     `json:"params" yaml:"params"`
	Evidence []Evidence `json:"evidence" yaml:"evidence"`
}

GenesisState defines the evidence module's genesis state.

type Params

type Params struct {
	MaxEvidenceAge time.Duration `json:"max_evidence_age" yaml:"max_evidence_age"`
}

Params defines the total set of parameters for the evidence module

Jump to

Keyboard shortcuts

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