e2e

package module
v0.0.0-...-5d1d366 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 17 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 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 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 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 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