e2e

package module
v0.0.0-...-e316d5a Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecProposal

func ExecProposal(ctx context.Context, keyName string, prop Proposal, tn *cosmos.ChainNode) (string, error)

func GetTxHashFromExec

func GetTxHashFromExec(stdout []byte) (string, error)

func GetValAddresses

func GetValAddresses(ctx context.Context, layer *cosmos.CosmosChain) (validators []*cosmos.ChainNode, valAccAddresses, valAddresses []string, err error)

func LayerChainSpec

func LayerChainSpec(nv, nf int, chainId string) *interchaintest.ChainSpec

func LayerEncoding

func LayerEncoding() *testutil.TestEncodingConfig

func LayerSpinup

func LayerSpinup(t *testing.T) *cosmos.CosmosChain

func TurnOnMinting

func TurnOnMinting(ctx context.Context, layer *cosmos.CosmosChain, validatorI *cosmos.ChainNode) error

func WriteSecretsFile

func WriteSecretsFile(ctx context.Context, rpc, bridge string, tn *cosmos.ChainNode) error

for adding the secrets file required for bridging

Types

type AggregateReport

type AggregateReport struct {
	Aggregate struct {
		QueryID           string `json:"query_id"`
		AggregateValue    string `json:"aggregate_value"`
		AggregateReporter string `json:"aggregate_reporter"`
		ReporterPower     string `json:"reporter_power"`
		Reporters         []struct {
			Reporter    string `json:"reporter"`
			Power       string `json:"power"`
			BlockNumber string `json:"block_number"`
		} `json:"reporters"`
		Index       string `json:"index"`
		Height      string `json:"height"`
		MicroHeight string `json:"micro_height"`
		MetaID      string `json:"meta_id"`
	} `json:"aggregate"`
	Timestamp string `json:"timestamp"`
}

type Commission

type Commission struct {
	// commission_rates defines the initial commission rates to be used for creating a validator.
	CommissionRates `protobuf:"bytes,1,opt,name=commission_rates,json=commissionRates,proto3,embedded=commission_rates" json:"commission_rates"`
	// update_time is the last time the commission rate was changed.
	UpdateTime time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time"`
}

type CommissionRates

type CommissionRates struct {
	// rate is the commission rate charged to delegators, as a fraction.
	Rate math.LegacyDec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"`
	// max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
	MaxRate math.LegacyDec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_rate"`
	// max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
	MaxChangeRate math.LegacyDec `` /* 131-byte string literal not displayed */
}

type CurrentTipsResponse

type CurrentTipsResponse struct {
	Tips math.Int `json:"tips"`
}

func QueryTips

func QueryTips(queryData string, ctx context.Context, validatorI *cosmos.ChainNode) (CurrentTipsResponse, error)

type DataSpec

type DataSpec struct {
	DocumentHash      string                        `json:"document_hash,omitempty"`
	ResponseValueType string                        `json:"response_value_type,omitempty"`
	AbiComponents     []*registrytypes.ABIComponent `json:"abi_components,omitempty"`
	AggregationMethod string                        `json:"aggregation_method,omitempty"`
	Registrar         string                        `json:"registrar,omitempty"`
	ReportBlockWindow int                           `json:"report_block_window,omitempty"`
}

func CreateDataSpec

func CreateDataSpec(reportBlockWindow int, registrar string) (DataSpec, error)

type DataSpecResponse

type DataSpecResponse struct {
	DocumentHash      string                        `json:"document_hash,omitempty"`
	ResponseValueType string                        `json:"response_value_type,omitempty"`
	AbiComponents     []*registrytypes.ABIComponent `json:"abi_components,omitempty"`
	AggregationMethod string                        `json:"aggregation_method,omitempty"`
	Registrar         string                        `json:"registrar,omitempty"`
	ReportBlockWindow string                        `json:"report_block_window,omitempty"`
}

type Description

type Description struct {
	// moniker defines a human-readable name for the validator.
	Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
	// identity defines an optional identity signature (ex. UPort or Keybase).
	Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	// website defines an optional website link.
	Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"`
	// security_contact defines an optional email for security contact.
	SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"`
	// details define other optional details.
	Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"`
}

type Disputes

type Disputes struct {
	Disputes []struct {
		DisputeID string   `json:"disputeId"`
		Metadata  Metadata `json:"metadata"`
	} `json:"disputes"`
}

for unmarshalling the disputes response

type Evidence

type Evidence struct {
	Reporter        string `json:"reporter"`
	Power           string `json:"power"`
	QueryType       string `json:"query_type"`
	QueryID         string `json:"query_id"`
	AggregateMethod string `json:"aggregate_method"`
	Value           string `json:"value"`
	Timestamp       string `json:"timestamp"`
	BlockNumber     string `json:"block_number"`
}

type GenerateQueryDataResponse

type GenerateQueryDataResponse struct {
	QueryData []byte `json:"query_data"`
}

type GetDataSpecResponse

type GetDataSpecResponse struct {
	Registrar string           `json:"registrar"`
	QueryType string           `json:"query_type"`
	Spec      DataSpecResponse `json:"spec"`
}

type GroupTally

type GroupTally struct {
	VoteCount       *VoteCounts `protobuf:"bytes,1,opt,name=voteCount,proto3" json:"voteCount,omitempty"`
	TotalPowerVoted string      `protobuf:"varint,2,opt,name=totalPowerVoted,proto3" json:"totalPowerVoted,omitempty"`
	TotalGroupPower string      `protobuf:"varint,3,opt,name=totalGroupPower,proto3" json:"totalGroupPower,omitempty"`
}

type Metadata

type Metadata struct {
	HashID            string   `json:"hash_id"`
	DisputeID         string   `json:"dispute_id"`
	DisputeCategory   int      `json:"dispute_category"`
	DisputeFee        string   `json:"dispute_fee"`
	DisputeStatus     int      `json:"dispute_status"`
	DisputeStartTime  string   `json:"dispute_start_time"`
	DisputeEndTime    string   `json:"dispute_end_time"`
	DisputeStartBlock string   `json:"dispute_start_block"`
	DisputeRound      string   `json:"dispute_round"`
	SlashAmount       string   `json:"slash_amount"`
	BurnAmount        string   `json:"burn_amount"`
	InitialEvidence   Evidence `json:"initial_evidence"`
	FeeTotal          string   `json:"fee_total"`
	PrevDisputeIDs    []string `json:"prev_dispute_ids"`
	BlockNumber       string   `json:"block_number"`
	VoterReward       string   `json:"voter_reward"`
}

type MicroReport

type MicroReport struct {
	Reporter        string `json:"reporter"`
	Power           string `json:"power"`
	QueryType       string `json:"query_type"`
	QueryID         string `json:"query_id"`
	AggregateMethod string `json:"aggregate_method"`
	Value           string `json:"value"`
	Timestamp       string `json:"timestamp"`
	BlockNumber     string `json:"block_number"`
	MetaId          string `json:"meta_id"`
}

type OpenDisputes

type OpenDisputes struct {
	Ids []string `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
}

type OracleReporter

type OracleReporter struct {
	CommissionRate string `json:"commission_rate"`
	MinTokens      string `json:"min_tokens_required"`
}

type Proposal

type Proposal struct {
	Messages  []map[string]interface{} `json:"messages"`
	Metadata  string                   `json:"metadata"`
	Deposit   string                   `json:"deposit"`
	Title     string                   `json:"title"`
	Summary   string                   `json:"summary"`
	Expedited bool                     `json:"expedited"`
}

type QueryDelegatorDelegationsResponse

type QueryDelegatorDelegationsResponse struct {
	DelegationResponses []stakingtypes.DelegationResponse `json:"delegation_responses"`
	Pagination          struct {
		Total string `json:"total"` // Change from uint64 to string
	} `json:"pagination"`
}

type QueryDisputesTallyResponse

type QueryDisputesTallyResponse struct {
	Users     *GroupTally `protobuf:"bytes,1,opt,name=users,proto3" json:"users,omitempty"`
	Reporters *GroupTally `protobuf:"bytes,2,opt,name=reporters,proto3" json:"reporters,omitempty"`
	Team      *VoteCounts `protobuf:"bytes,3,opt,name=team,proto3" json:"team,omitempty"`
}

type QueryMeta

type QueryMeta struct {
	// unique id of the query that changes after query's lifecycle ends
	Id string `json:"id,omitempty"`
	// amount of tokens that was tipped
	Amount string `json:"amount"`
	// expiration time of the query
	Expiration string `json:"expiration,omitempty"`
	// timeframe of the query according to the data spec
	RegistrySpecBlockWindow string `json:"registry_spec_block_window,omitempty"`
	// indicates whether query has revealed reports
	HasRevealedReports bool `json:"has_revealed_reports,omitempty"`
	// query_data: decodable bytes to field of the data spec
	QueryData string `json:"query_data,omitempty"`
	// string identifier of the data spec
	QueryType string `json:"query_type,omitempty"`
	// bool cycle list query
	CycleList bool `json:"cycle_list,omitempty"`
}

type QueryOpenDisputesResponse

type QueryOpenDisputesResponse struct {
	OpenDisputes *OpenDisputes `protobuf:"bytes,1,opt,name=openDisputes,proto3" json:"openDisputes,omitempty"`
}

type QueryReportersResponse

type QueryReportersResponse struct {
	// all the reporters.
	Reporters []*Reporter `protobuf:"bytes,1,rep,name=reporters,proto3" json:"reporters,omitempty"`
	// pagination defines the pagination in the response.
	Pagination struct {
		Total string `json:"total"`
	} `json:"pagination"`
}

type QuerySelectorReporterResponse

type QuerySelectorReporterResponse struct {
	Reporter string `json:"reporter"`
}

type QueryValidatorsResponse

type QueryValidatorsResponse struct {
	Validators []Validator `json:"validators"`
}

type Reporter

type Reporter struct {
	Address  string          `json:"address"`
	Metadata *OracleReporter `json:"metadata"`
	Power    string          `json:"power"`
}

type ReportersResponse

type ReportersResponse struct {
	Reporters []*Reporter `json:"reporters"`
}

type ReportsResponse

type ReportsResponse struct {
	MicroReports []MicroReport `json:"microReports"`
}

type TippedQueriesResponse

type TippedQueriesResponse struct {
	Queries []QueryMeta `json:"queries"`
}

type Validator

type Validator struct {
	// operator_address defines the address of the validator's operator; bech encoded in JSON.
	OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"`
	// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
	ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"`
	// jailed defined whether the validator has been jailed from bonded status or not.
	Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"`
	// status is the validator status (bonded/unbonding/unbonded).
	Status int `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"`
	// tokens define the delegated tokens (incl. self-delegation).
	Tokens string `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=cosmossdk.io/math.Int" json:"tokens"`
	// delegator_shares defines total shares issued to a validator's delegators.
	DelegatorShares string `` /* 135-byte string literal not displayed */
	// description defines the description terms for the validator.
	Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"`
	// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
	UnbondingHeight string `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"`
	// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
	UnbondingTime string `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time"`
	// commission defines the commission parameters.
	Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"`
	// min_self_delegation is the validator's self declared minimum self delegation.
	// Since: cosmos-sdk 0.46
	MinSelfDelegation string `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3" json:"min_self_delegation"`
	// strictly positive if this validator's unbonding has been stopped by external modules
	UnbondingOnHoldRefCount string `` /* 138-byte string literal not displayed */
	// list of unbonding ids, each uniquely identifing an unbonding of this validator
	UnbondingIds []string `protobuf:"varint,13,rep,packed,name=unbonding_ids,json=unbondingIds,proto3" json:"unbonding_ids,omitempty"`
}

type VoteCounts

type VoteCounts struct {
	Support string `protobuf:"varint,1,opt,name=support,proto3" json:"support,omitempty"`
	Against string `protobuf:"varint,2,opt,name=against,proto3" json:"against,omitempty"`
	Invalid string `protobuf:"varint,3,opt,name=invalid,proto3" json:"invalid,omitempty"`
}

Jump to

Keyboard shortcuts

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