ethabi

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildReadStateRequest

func BuildReadStateRequest(data []byte) (protocol.StateContext, error)

Types

type Candidate

type Candidate struct {
	ID              common.Address `abi:"id"`
	Name            string         `abi:"name"`
	OperatorAddress common.Address `abi:"operatorAddress"`
	RewardAddress   common.Address `abi:"rewardAddress"`
	BlsPubKey       []byte         `abi:"blsPubKey"`
	Votes           *big.Int       `abi:"votes"`
}

Candidate represents a candidate in the Ethereum ABI format

func ConvertCandidateListFromState

func ConvertCandidateListFromState(stateCandidates state.CandidateList) ([]Candidate, error)

ConvertCandidateListFromState converts a state.CandidateList to []Candidate

func NewCandidateFromState

func NewCandidateFromState(stateCandidate *state.Candidate) (*Candidate, error)

NewCandidateFromState converts a state.Candidate to ethabi.Candidate

type CandidateListStateContext

type CandidateListStateContext struct {
	*protocol.BaseStateContext
}

func (*CandidateListStateContext) EncodeToEth

EncodeToEth encode proto to eth

type ProbationInfo

type ProbationInfo struct {
	Candidate       common.Address
	OperatorAddress common.Address
	Count           uint32
}

ProbationInfo represents a probation info in the Ethereum ABI format

func NewProbationInfoFromState

func NewProbationInfoFromState(addrStr string, count uint32) (*ProbationInfo, error)

NewProbationInfoFromState converts a single probation entry to ethabi.ProbationInfo

type ProbationList

type ProbationList struct {
	ProbationInfo []ProbationInfo
	IntensityRate uint32
}

ProbationList represents a probation list in the Ethereum ABI format

func ConvertProbationListFromState

func ConvertProbationListFromState(stateProbationList *vote.ProbationList) (*ProbationList, error)

ConvertProbationListFromState converts a vote.ProbationList to ethabi.ProbationList

type ProbationListStateContext

type ProbationListStateContext struct {
	*protocol.BaseStateContext
}

func (*ProbationListStateContext) EncodeToEth

EncodeToEth encode proto to eth

Jump to

Keyboard shortcuts

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