Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeBucketTypeListToEth(outputs abi.Arguments, bucketTypes *iotextypes.ContractStakingBucketTypeList) (string, error)
- func EncodeVoteBucketListToEth(outputs abi.Arguments, buckets *iotextypes.VoteBucketList) (string, error)
- type BucketEth
- type BucketTypeEth
- type BucketsByCandidateStateContext
- type BucketsByIndexesStateContext
- type BucketsByVoterStateContext
- type BucketsCountStateContext
- type BucketsStateContext
- type CandidateByAddressStateContext
- type CandidateByNameStateContext
- type CandidateEth
- type CandidatesStateContext
- type OptionCandidate
- type TotalStakingAmountStateContext
Constants ¶
const (
ErrInvalidMsg = "address length = 40, expecting 41: invalid address"
)
Variables ¶
Functions ¶
func EncodeBucketTypeListToEth ¶
func EncodeBucketTypeListToEth(outputs abi.Arguments, bucketTypes *iotextypes.ContractStakingBucketTypeList) (string, error)
func EncodeVoteBucketListToEth ¶
func EncodeVoteBucketListToEth(outputs abi.Arguments, buckets *iotextypes.VoteBucketList) (string, error)
Types ¶
type BucketEth ¶
type BucketEth struct { Index uint64 CandidateAddress common.Address StakedAmount *big.Int StakedDuration uint32 CreateTime int64 StakeStartTime int64 UnstakeStartTime int64 AutoStake bool Owner common.Address ContractAddress common.Address StakedDurationBlockNumber uint64 CreateBlockHeight uint64 StakeStartBlockHeight uint64 UnstakeStartBlockHeight uint64 EndorsementExpireBlockHeight uint64 }
BucketEth struct for eth
type BucketTypeEth ¶
BucketTypeEth struct for eth
type BucketsByCandidateStateContext ¶
type BucketsByCandidateStateContext struct {
*protocol.BaseStateContext
}
BucketsByCandidateStateContext context for BucketsByCandidate
func NewBucketsByCandidateStateContext ¶
func NewBucketsByCandidateStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name) (*BucketsByCandidateStateContext, error)
func (*BucketsByCandidateStateContext) EncodeToEth ¶
func (r *BucketsByCandidateStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type BucketsByIndexesStateContext ¶
type BucketsByIndexesStateContext struct {
*protocol.BaseStateContext
}
BucketsByIndexesStateContext context for BucketsByIndexes
func NewBucketsByIndexesStateContext ¶
func NewBucketsByIndexesStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name) (*BucketsByIndexesStateContext, error)
func (*BucketsByIndexesStateContext) EncodeToEth ¶
func (r *BucketsByIndexesStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type BucketsByVoterStateContext ¶
type BucketsByVoterStateContext struct {
*protocol.BaseStateContext
}
BucketsByVoterStateContext context for BucketsByVoter
func NewBucketsByVoterStateContext ¶
func NewBucketsByVoterStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name) (*BucketsByVoterStateContext, error)
func (*BucketsByVoterStateContext) EncodeToEth ¶
func (r *BucketsByVoterStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type BucketsCountStateContext ¶
type BucketsCountStateContext struct {
*protocol.BaseStateContext
}
BucketsCountStateContext context for BucketsCount
func NewBucketsCountStateContext ¶
func NewBucketsCountStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name) (*BucketsCountStateContext, error)
func (*BucketsCountStateContext) EncodeToEth ¶
func (r *BucketsCountStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type BucketsStateContext ¶
type BucketsStateContext struct {
*protocol.BaseStateContext
}
BucketsStateContext context for Buckets
func NewBucketsStateContext ¶
func NewBucketsStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name) (*BucketsStateContext, error)
func (*BucketsStateContext) EncodeToEth ¶
func (r *BucketsStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type CandidateByAddressStateContext ¶
type CandidateByAddressStateContext struct { *protocol.BaseStateContext // contains filtered or unexported fields }
CandidateByAddressStateContext context for candidateByAddress
func NewCandidateByAddressStateContext ¶
func NewCandidateByAddressStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name, opts ...OptionCandidate) (*CandidateByAddressStateContext, error)
func (*CandidateByAddressStateContext) EncodeToEth ¶
func (r *CandidateByAddressStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type CandidateByNameStateContext ¶
type CandidateByNameStateContext struct { *protocol.BaseStateContext // contains filtered or unexported fields }
CandidateByNameStateContext context for CandidateByName
func NewCandidateByNameStateContext ¶
func NewCandidateByNameStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name, opts ...OptionCandidate) (*CandidateByNameStateContext, error)
func (*CandidateByNameStateContext) EncodeToEth ¶
func (r *CandidateByNameStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type CandidateEth ¶
type CandidateEth struct { Id common.Address OwnerAddress common.Address OperatorAddress common.Address RewardAddress common.Address Name string TotalWeightedVotes *big.Int SelfStakeBucketIdx uint64 SelfStakingTokens *big.Int }
CandidateEth struct for eth
func EncodeCandidateToEth ¶
func EncodeCandidateToEth(candidate *iotextypes.CandidateV2) (*CandidateEth, error)
type CandidatesStateContext ¶
type CandidatesStateContext struct { *protocol.BaseStateContext // contains filtered or unexported fields }
CandidatesStateContext context for Candidates
func NewCandidatesStateContext ¶
func NewCandidatesStateContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name, opts ...OptionCandidate) (*CandidatesStateContext, error)
func (*CandidatesStateContext) EncodeToEth ¶
func (r *CandidatesStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth
type OptionCandidate ¶
type OptionCandidate func(*candidateConfig)
OptionCandidate option for candidate
func WithNoSelfStakeBucketIndexAsMaxUint32 ¶
func WithNoSelfStakeBucketIndexAsMaxUint32() OptionCandidate
WithNoSelfStakeBucketIndexAsMaxUint32 set noSelfStakeBucketIndex as MaxUint32
type TotalStakingAmountStateContext ¶
type TotalStakingAmountStateContext struct {
*protocol.BaseStateContext
}
TotalStakingAmountStateContext context for TotalStakingAmount
func NewTotalStakingAmountContext ¶
func NewTotalStakingAmountContext(data []byte, methodABI *abi.Method, apiMethod iotexapi.ReadStakingDataMethod_Name) (*TotalStakingAmountStateContext, error)
func (*TotalStakingAmountStateContext) EncodeToEth ¶
func (r *TotalStakingAmountStateContext) EncodeToEth(resp *iotexapi.ReadStateResponse) (string, error)
EncodeToEth encode proto to eth