accounts

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: GPL-3.0 Imports: 19 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthPeerAccountData        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPeerAccountData          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPeerAccountData = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthUserAccountData        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowUserAccountData          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupUserAccountData = fmt.Errorf("proto: unexpected end of group")
)

Functions

func NewPeerAccount

func NewPeerAccount(address []byte) (*peerAccount, error)

NewPeerAccount creates a new instance of peerAccount

func NewUserAccount

func NewUserAccount(
	address []byte,
	trackableDataTrie state.DataTrieTracker,
	trieLeafParser common.TrieLeafParser,
) (*userAccount, error)

NewUserAccount creates a new instance of user account

Types

type PeerAccountData

type PeerAccountData struct {
	BLSPublicKey                        []byte        `protobuf:"bytes,1,opt,name=BLSPublicKey,proto3" json:"blsPublicKey"`
	RewardAddress                       []byte        `protobuf:"bytes,2,opt,name=RewardAddress,proto3" json:"rewardAddress,omitempty"`
	ShardId                             uint32        `protobuf:"varint,3,opt,name=ShardId,proto3" json:"shardId"`
	ValidatorSuccessRate                SignRate      `protobuf:"bytes,4,opt,name=ValidatorSuccessRate,proto3" json:"validatorSuccessRate"`
	LeaderSuccessRate                   SignRate      `protobuf:"bytes,5,opt,name=LeaderSuccessRate,proto3" json:"leaderSuccessRate"`
	ValidatorIgnoredSignaturesRate      uint32        `protobuf:"varint,6,opt,name=ValidatorIgnoredSignaturesRate,proto3" json:"validatorIgnoredSignaturesRate"`
	Rating                              uint32        `protobuf:"varint,7,opt,name=Rating,proto3" json:"rating"`
	TempRating                          uint32        `protobuf:"varint,8,opt,name=TempRating,proto3" json:"tempRating"`
	AccumulatedFees                     *math_big.Int `` /* 166-byte string literal not displayed */
	NumSelectedInSuccessBlocks          uint32        `protobuf:"varint,10,opt,name=NumSelectedInSuccessBlocks,proto3" json:"numSelectedInSuccessBlocks"`
	IndexInList                         uint32        `protobuf:"varint,11,opt,name=IndexInList,proto3" json:"indexInList"`
	List                                string        `protobuf:"bytes,12,opt,name=List,proto3" json:"list,omitempty"`
	ConsecutiveProposerMisses           uint32        `protobuf:"varint,13,opt,name=ConsecutiveProposerMisses,proto3" json:"consecutiveProposerMisses"`
	TotalValidatorSuccessRate           SignRate      `protobuf:"bytes,14,opt,name=TotalValidatorSuccessRate,proto3" json:"totalValidatorSuccessRate"`
	TotalLeaderSuccessRate              SignRate      `protobuf:"bytes,15,opt,name=TotalLeaderSuccessRate,proto3" json:"totalLeaderSuccessRate"`
	TotalValidatorIgnoredSignaturesRate uint32        `protobuf:"varint,16,opt,name=TotalValidatorIgnoredSignaturesRate,proto3" json:"totalValidatorIgnoredSignaturesRate"`
	Nonce                               uint64        `protobuf:"varint,17,opt,name=Nonce,proto3" json:"nonce"`
	UnStakedEpoch                       uint32        `protobuf:"varint,18,opt,name=UnStakedEpoch,proto3" json:"unStakedEpoch"`
}

PeerAccountData represents the data that defines the PeerAccount

func (*PeerAccountData) Descriptor

func (*PeerAccountData) Descriptor() ([]byte, []int)

func (*PeerAccountData) Equal

func (this *PeerAccountData) Equal(that interface{}) bool

func (*PeerAccountData) GetAccumulatedFees

func (m *PeerAccountData) GetAccumulatedFees() *math_big.Int

func (*PeerAccountData) GetBLSPublicKey

func (m *PeerAccountData) GetBLSPublicKey() []byte

func (*PeerAccountData) GetConsecutiveProposerMisses

func (m *PeerAccountData) GetConsecutiveProposerMisses() uint32

func (*PeerAccountData) GetIndexInList

func (m *PeerAccountData) GetIndexInList() uint32

func (*PeerAccountData) GetLeaderSuccessRate

func (m *PeerAccountData) GetLeaderSuccessRate() SignRate

func (*PeerAccountData) GetList

func (m *PeerAccountData) GetList() string

func (*PeerAccountData) GetNonce

func (m *PeerAccountData) GetNonce() uint64

func (*PeerAccountData) GetNumSelectedInSuccessBlocks

func (m *PeerAccountData) GetNumSelectedInSuccessBlocks() uint32

func (*PeerAccountData) GetRating

func (m *PeerAccountData) GetRating() uint32

func (*PeerAccountData) GetRewardAddress

func (m *PeerAccountData) GetRewardAddress() []byte

func (*PeerAccountData) GetShardId

func (m *PeerAccountData) GetShardId() uint32

func (*PeerAccountData) GetTempRating

func (m *PeerAccountData) GetTempRating() uint32

func (*PeerAccountData) GetTotalLeaderSuccessRate

func (m *PeerAccountData) GetTotalLeaderSuccessRate() SignRate

func (*PeerAccountData) GetTotalValidatorIgnoredSignaturesRate

func (m *PeerAccountData) GetTotalValidatorIgnoredSignaturesRate() uint32

func (*PeerAccountData) GetTotalValidatorSuccessRate

func (m *PeerAccountData) GetTotalValidatorSuccessRate() SignRate

func (*PeerAccountData) GetUnStakedEpoch

func (m *PeerAccountData) GetUnStakedEpoch() uint32

func (*PeerAccountData) GetValidatorIgnoredSignaturesRate

func (m *PeerAccountData) GetValidatorIgnoredSignaturesRate() uint32

func (*PeerAccountData) GetValidatorSuccessRate

func (m *PeerAccountData) GetValidatorSuccessRate() SignRate

func (*PeerAccountData) GoString

func (this *PeerAccountData) GoString() string

func (*PeerAccountData) Marshal

func (m *PeerAccountData) Marshal() (dAtA []byte, err error)

func (*PeerAccountData) MarshalTo

func (m *PeerAccountData) MarshalTo(dAtA []byte) (int, error)

func (*PeerAccountData) MarshalToSizedBuffer

func (m *PeerAccountData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PeerAccountData) ProtoMessage

func (*PeerAccountData) ProtoMessage()

func (*PeerAccountData) Reset

func (m *PeerAccountData) Reset()

func (*PeerAccountData) Size

func (m *PeerAccountData) Size() (n int)

func (*PeerAccountData) String

func (this *PeerAccountData) String() string

func (*PeerAccountData) Unmarshal

func (m *PeerAccountData) Unmarshal(dAtA []byte) error

func (*PeerAccountData) XXX_DiscardUnknown

func (m *PeerAccountData) XXX_DiscardUnknown()

func (*PeerAccountData) XXX_Marshal

func (m *PeerAccountData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerAccountData) XXX_Merge

func (m *PeerAccountData) XXX_Merge(src proto.Message)

func (*PeerAccountData) XXX_Size

func (m *PeerAccountData) XXX_Size() int

func (*PeerAccountData) XXX_Unmarshal

func (m *PeerAccountData) XXX_Unmarshal(b []byte) error

type SignRate

type SignRate struct {
	NumSuccess uint32 `protobuf:"varint,1,opt,name=NumSuccess,proto3" json:"NumSuccess,omitempty"`
	NumFailure uint32 `protobuf:"varint,2,opt,name=NumFailure,proto3" json:"NumFailure,omitempty"`
}

SignRate is used to keep the number of success and failed signings

func (*SignRate) Descriptor

func (*SignRate) Descriptor() ([]byte, []int)

func (*SignRate) Equal

func (this *SignRate) Equal(that interface{}) bool

func (*SignRate) GetNumFailure

func (m *SignRate) GetNumFailure() uint32

func (*SignRate) GetNumSuccess

func (m *SignRate) GetNumSuccess() uint32

func (*SignRate) GoString

func (this *SignRate) GoString() string

func (*SignRate) Marshal

func (m *SignRate) Marshal() (dAtA []byte, err error)

func (*SignRate) MarshalTo

func (m *SignRate) MarshalTo(dAtA []byte) (int, error)

func (*SignRate) MarshalToSizedBuffer

func (m *SignRate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignRate) ProtoMessage

func (*SignRate) ProtoMessage()

func (*SignRate) Reset

func (m *SignRate) Reset()

func (*SignRate) Size

func (m *SignRate) Size() (n int)

func (*SignRate) String

func (this *SignRate) String() string

func (*SignRate) Unmarshal

func (m *SignRate) Unmarshal(dAtA []byte) error

func (*SignRate) XXX_DiscardUnknown

func (m *SignRate) XXX_DiscardUnknown()

func (*SignRate) XXX_Marshal

func (m *SignRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignRate) XXX_Merge

func (m *SignRate) XXX_Merge(src proto.Message)

func (*SignRate) XXX_Size

func (m *SignRate) XXX_Size() int

func (*SignRate) XXX_Unmarshal

func (m *SignRate) XXX_Unmarshal(b []byte) error

type UserAccountData

type UserAccountData struct {
	Nonce           uint64        `protobuf:"varint,1,opt,name=Nonce,proto3" json:"nonce"`
	Balance         *math_big.Int `` /* 150-byte string literal not displayed */
	CodeHash        []byte        `protobuf:"bytes,3,opt,name=CodeHash,proto3" json:"codeHash,omitempty"`
	RootHash        []byte        `protobuf:"bytes,4,opt,name=RootHash,proto3" json:"rootHash,omitempty"`
	Address         []byte        `protobuf:"bytes,5,opt,name=Address,proto3" json:"address,omitempty"`
	DeveloperReward *math_big.Int `` /* 166-byte string literal not displayed */
	OwnerAddress    []byte        `protobuf:"bytes,7,opt,name=OwnerAddress,proto3" json:"ownerAddress,omitempty"`
	UserName        []byte        `protobuf:"bytes,8,opt,name=UserName,proto3" json:"userName,omitempty"`
	CodeMetadata    []byte        `protobuf:"bytes,9,opt,name=CodeMetadata,proto3" json:"codeMetadata,omitempty"`
}

func (*UserAccountData) Descriptor

func (*UserAccountData) Descriptor() ([]byte, []int)

func (*UserAccountData) Equal

func (this *UserAccountData) Equal(that interface{}) bool

func (*UserAccountData) GetAddress

func (m *UserAccountData) GetAddress() []byte

func (*UserAccountData) GetBalance

func (m *UserAccountData) GetBalance() *math_big.Int

func (*UserAccountData) GetCodeHash

func (m *UserAccountData) GetCodeHash() []byte

func (*UserAccountData) GetCodeMetadata

func (m *UserAccountData) GetCodeMetadata() []byte

func (*UserAccountData) GetDeveloperReward

func (m *UserAccountData) GetDeveloperReward() *math_big.Int

func (*UserAccountData) GetNonce

func (m *UserAccountData) GetNonce() uint64

func (*UserAccountData) GetOwnerAddress

func (m *UserAccountData) GetOwnerAddress() []byte

func (*UserAccountData) GetRootHash

func (m *UserAccountData) GetRootHash() []byte

func (*UserAccountData) GetUserName

func (m *UserAccountData) GetUserName() []byte

func (*UserAccountData) GoString

func (this *UserAccountData) GoString() string

func (*UserAccountData) Marshal

func (m *UserAccountData) Marshal() (dAtA []byte, err error)

func (*UserAccountData) MarshalTo

func (m *UserAccountData) MarshalTo(dAtA []byte) (int, error)

func (*UserAccountData) MarshalToSizedBuffer

func (m *UserAccountData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UserAccountData) ProtoMessage

func (*UserAccountData) ProtoMessage()

func (*UserAccountData) Reset

func (m *UserAccountData) Reset()

func (*UserAccountData) Size

func (m *UserAccountData) Size() (n int)

func (*UserAccountData) String

func (this *UserAccountData) String() string

func (*UserAccountData) Unmarshal

func (m *UserAccountData) Unmarshal(dAtA []byte) error

func (*UserAccountData) XXX_DiscardUnknown

func (m *UserAccountData) XXX_DiscardUnknown()

func (*UserAccountData) XXX_Marshal

func (m *UserAccountData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UserAccountData) XXX_Merge

func (m *UserAccountData) XXX_Merge(src proto.Message)

func (*UserAccountData) XXX_Size

func (m *UserAccountData) XXX_Size() int

func (*UserAccountData) XXX_Unmarshal

func (m *UserAccountData) XXX_Unmarshal(b []byte) error

type ValidatorApiResponse

type ValidatorApiResponse struct {
	TempRating                         float32 `protobuf:"fixed32,1,opt,name=TempRating,proto3" json:"tempRating"`
	NumLeaderSuccess                   uint32  `protobuf:"varint,2,opt,name=NumLeaderSuccess,proto3" json:"numLeaderSuccess"`
	NumLeaderFailure                   uint32  `protobuf:"varint,3,opt,name=NumLeaderFailure,proto3" json:"numLeaderFailure"`
	NumValidatorSuccess                uint32  `protobuf:"varint,4,opt,name=NumValidatorSuccess,proto3" json:"numValidatorSuccess"`
	NumValidatorFailure                uint32  `protobuf:"varint,5,opt,name=NumValidatorFailure,proto3" json:"numValidatorFailure"`
	NumValidatorIgnoredSignatures      uint32  `protobuf:"varint,6,opt,name=NumValidatorIgnoredSignatures,proto3" json:"numValidatorIgnoredSignatures"`
	Rating                             float32 `protobuf:"fixed32,7,opt,name=Rating,proto3" json:"rating"`
	RatingModifier                     float32 `protobuf:"fixed32,8,opt,name=RatingModifier,proto3" json:"ratingModifier"`
	TotalNumLeaderSuccess              uint32  `protobuf:"varint,9,opt,name=TotalNumLeaderSuccess,proto3" json:"totalNumLeaderSuccess"`
	TotalNumLeaderFailure              uint32  `protobuf:"varint,10,opt,name=TotalNumLeaderFailure,proto3" json:"totalNumLeaderFailure"`
	TotalNumValidatorSuccess           uint32  `protobuf:"varint,11,opt,name=TotalNumValidatorSuccess,proto3" json:"totalNumValidatorSuccess"`
	TotalNumValidatorFailure           uint32  `protobuf:"varint,12,opt,name=TotalNumValidatorFailure,proto3" json:"totalNumValidatorFailure"`
	TotalNumValidatorIgnoredSignatures uint32  `protobuf:"varint,13,opt,name=TotalNumValidatorIgnoredSignatures,proto3" json:"totalNumValidatorIgnoredSignatures"`
	ShardId                            uint32  `protobuf:"varint,14,opt,name=ShardId,proto3" json:"shardId"`
	ValidatorStatus                    string  `protobuf:"bytes,15,opt,name=ValidatorStatus,proto3" json:"validatorStatus,omitempty"`
}

ValidatorApiResponse represents the data which is fetched from each validator for returning it in API call

func (*ValidatorApiResponse) Descriptor

func (*ValidatorApiResponse) Descriptor() ([]byte, []int)

func (*ValidatorApiResponse) Equal

func (this *ValidatorApiResponse) Equal(that interface{}) bool

func (*ValidatorApiResponse) GetNumLeaderFailure

func (m *ValidatorApiResponse) GetNumLeaderFailure() uint32

func (*ValidatorApiResponse) GetNumLeaderSuccess

func (m *ValidatorApiResponse) GetNumLeaderSuccess() uint32

func (*ValidatorApiResponse) GetNumValidatorFailure

func (m *ValidatorApiResponse) GetNumValidatorFailure() uint32

func (*ValidatorApiResponse) GetNumValidatorIgnoredSignatures

func (m *ValidatorApiResponse) GetNumValidatorIgnoredSignatures() uint32

func (*ValidatorApiResponse) GetNumValidatorSuccess

func (m *ValidatorApiResponse) GetNumValidatorSuccess() uint32

func (*ValidatorApiResponse) GetRating

func (m *ValidatorApiResponse) GetRating() float32

func (*ValidatorApiResponse) GetRatingModifier

func (m *ValidatorApiResponse) GetRatingModifier() float32

func (*ValidatorApiResponse) GetShardId

func (m *ValidatorApiResponse) GetShardId() uint32

func (*ValidatorApiResponse) GetTempRating

func (m *ValidatorApiResponse) GetTempRating() float32

func (*ValidatorApiResponse) GetTotalNumLeaderFailure

func (m *ValidatorApiResponse) GetTotalNumLeaderFailure() uint32

func (*ValidatorApiResponse) GetTotalNumLeaderSuccess

func (m *ValidatorApiResponse) GetTotalNumLeaderSuccess() uint32

func (*ValidatorApiResponse) GetTotalNumValidatorFailure

func (m *ValidatorApiResponse) GetTotalNumValidatorFailure() uint32

func (*ValidatorApiResponse) GetTotalNumValidatorIgnoredSignatures

func (m *ValidatorApiResponse) GetTotalNumValidatorIgnoredSignatures() uint32

func (*ValidatorApiResponse) GetTotalNumValidatorSuccess

func (m *ValidatorApiResponse) GetTotalNumValidatorSuccess() uint32

func (*ValidatorApiResponse) GetValidatorStatus

func (m *ValidatorApiResponse) GetValidatorStatus() string

func (*ValidatorApiResponse) GoString

func (this *ValidatorApiResponse) GoString() string

func (*ValidatorApiResponse) Marshal

func (m *ValidatorApiResponse) Marshal() (dAtA []byte, err error)

func (*ValidatorApiResponse) MarshalTo

func (m *ValidatorApiResponse) MarshalTo(dAtA []byte) (int, error)

func (*ValidatorApiResponse) MarshalToSizedBuffer

func (m *ValidatorApiResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidatorApiResponse) ProtoMessage

func (*ValidatorApiResponse) ProtoMessage()

func (*ValidatorApiResponse) Reset

func (m *ValidatorApiResponse) Reset()

func (*ValidatorApiResponse) Size

func (m *ValidatorApiResponse) Size() (n int)

func (*ValidatorApiResponse) String

func (this *ValidatorApiResponse) String() string

func (*ValidatorApiResponse) Unmarshal

func (m *ValidatorApiResponse) Unmarshal(dAtA []byte) error

func (*ValidatorApiResponse) XXX_DiscardUnknown

func (m *ValidatorApiResponse) XXX_DiscardUnknown()

func (*ValidatorApiResponse) XXX_Marshal

func (m *ValidatorApiResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidatorApiResponse) XXX_Merge

func (m *ValidatorApiResponse) XXX_Merge(src proto.Message)

func (*ValidatorApiResponse) XXX_Size

func (m *ValidatorApiResponse) XXX_Size() int

func (*ValidatorApiResponse) XXX_Unmarshal

func (m *ValidatorApiResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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