core

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 38 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const C = "consumer"
View Source
const P = "provider"

Variables

This section is empty.

Functions

func GetZeroState

func GetZeroState(suite *suite.Suite, initState InitState) (
	*ibctesting.Path, []sdk.ValAddress, int64, int64)

The state of the data returned is equivalent to the state of two chains after a full handshake, but the precise order of steps used to reach the state does not necessarily mimic the order of steps that happen in a live scenario.

Types

type Action

type Action struct {
	Amt              int    `json:"amt,omitempty"`
	Chain            string `json:"chain,omitempty"`
	InfractionHeight int    `json:"infractionHeight,omitempty"`
	IsDowntime       bool   `json:"isDowntime"`
	Kind             string `json:"kind"`
	NumPackets       int    `json:"numPackets,omitempty"`
	Val              int    `json:"val,omitempty"`
}

type ActionAndConsequence

type ActionAndConsequence struct {
	Action      Action      `json:"action"`
	Consequence Consequence `json:"consequence"`
	Ix          int         `json:"ix"`
}

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

type Consequence

type Consequence struct {
	Delegation          []int    `json:"delegation,omitempty"`
	DelegatorTokens     int      `json:"delegatorTokens,omitempty"`
	Jailed              []*int   `json:"jailed,omitempty"`
	OutstandingDowntime []bool   `json:"outstandingDowntime,omitempty"`
	ConsumerPower       []*int   `json:"consumerPower,omitempty"`
	Status              []string `json:"status,omitempty"`
	Tokens              []int    `json:"tokens,omitempty"`
	H                   int      `json:"h,omitempty"`
	T                   int      `json:"t,omitempty"`
}

type InitState

type InitState struct {
	PKSeeds                []string
	NumValidators          int
	MaxValidators          int
	InitialDelegatorTokens int
	SlashDoublesign        sdk.Dec
	SlashDowntime          sdk.Dec
	UnbondingP             time.Duration
	UnbondingC             time.Duration
	Trusting               time.Duration
	MaxClockDrift          time.Duration
	BlockSeconds           time.Duration
	ConsensusParams        *abci.ConsensusParams
	ValStates              ValStates
	MaxEntries             int
}

type TraceData

type TraceData struct {
	Actions   []ActionAndConsequence `json:"actions"`
	Constants struct {
		BlockSeconds            int     `json:"BLOCK_SECONDS"`
		C                       string  `json:"C"`
		DelegateAmtMax          int     `json:"DELEGATE_AMT_MAX"`
		DelegateAmtMin          int     `json:"DELEGATE_AMT_MIN"`
		InitialDelegatorTokens  int     `json:"INITIAL_DELEGATOR_TOKENS"`
		IsdowntimeProbability   float64 `json:"ISDOWNTIME_PROBABILITY"`
		JailSeconds             int     `json:"JAIL_SECONDS"`
		MaxNumPacketsForDeliver int     `json:"MAX_NUM_PACKETS_FOR_DELIVER"`
		MaxValidators           int     `json:"MAX_VALIDATORS"`
		NumValidators           int     `json:"NUM_VALIDATORS"`
		P                       string  `json:"P"`
		SlashDoublesign         int     `json:"SLASH_DOUBLESIGN"`
		SlashDowntime           int     `json:"SLASH_DOWNTIME"`
		TrustingSeconds         int     `json:"TRUSTING_SECONDS"`
		UnbondingSecondsC       int     `json:"UNBONDING_SECONDS_C"`
		UnbondingSecondsP       int     `json:"UNBONDING_SECONDS_P"`
		UndelegateAmtMax        int     `json:"UNDELEGATE_AMT_MAX"`
		UndelegateAmtMin        int     `json:"UNDELEGATE_AMT_MIN"`
	} `json:"constants"`
	Events []string `json:"events"`
	Meta   struct {
		Commit string `json:"commit"`
		Diff   string `json:"diff"`
	} `json:"meta"`
}

func LoadTraces

func LoadTraces(fn string) []TraceData

type Traces

type Traces struct {
	// index of trace in json
	CurrentTraceIx int
	// index of current action
	CurrentActionIx int
	// traces
	Data []TraceData
}

Traces stores a list of traces and gives a diagnostic for debugging failed tests.

func (*Traces) Action

func (t *Traces) Action() Action

func (*Traces) Actions

func (t *Traces) Actions() []ActionAndConsequence

func (*Traces) Consequence

func (t *Traces) Consequence() Consequence

func (*Traces) ConsumerPower

func (t *Traces) ConsumerPower(i int) *int

func (*Traces) Delegation

func (t *Traces) Delegation(i int) int

func (*Traces) DelegatorTokens

func (t *Traces) DelegatorTokens() int

func (*Traces) Diagnostic

func (t *Traces) Diagnostic() string

diagnostic returns a string for diagnosing errors

func (*Traces) Height

func (t *Traces) Height() int

func (*Traces) Jailed

func (t *Traces) Jailed(i int) *int

func (*Traces) OutstandingDowntime

func (t *Traces) OutstandingDowntime(i int) bool

func (*Traces) Status

func (t *Traces) Status(i int) stakingtypes.BondStatus

func (*Traces) Time

func (t *Traces) Time() int

func (*Traces) Tokens

func (t *Traces) Tokens(i int) int

func (*Traces) Trace

func (t *Traces) Trace() TraceData

type ValStates

type ValStates struct {
	Delegation           []int
	Tokens               []int
	ValidatorExtraTokens []int
	Status               []stakingtypes.BondStatus
}

ValStates represents the total delegation and bond status of a validator

Jump to

Keyboard shortcuts

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