MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / NewValidator

Function NewValidator

types/validator.go:27–34  ·  view source on GitHub ↗

NewValidator returns a new validator with the given pubkey and voting power.

(pubKey crypto.PubKey, votingPower int64)

Source from the content-addressed store, hash-verified

25
26// NewValidator returns a new validator with the given pubkey and voting power.
27func NewValidator(pubKey crypto.PubKey, votingPower int64) *Validator {
28 return &Validator{
29 Address: pubKey.Address(),
30 PubKey: pubKey,
31 VotingPower: votingPower,
32 ProposerPriority: 0,
33 }
34}
35
36// ValidateBasic performs basic validation.
37func (v *Validator) ValidateBasic() error {

Callers 15

genValSetFunction · 0.92
TestUpdateValidatorsFunction · 0.92
MakeGenesisStateFunction · 0.92
TestProposerFrequencyFunction · 0.92
genValSetWithPowersFunction · 0.92
ReplayBlocksMethod · 0.92
makeValsFunction · 0.92
ToValidatorsMethod · 0.92
newEvidenceFunction · 0.92
TestMsgToProtoFunction · 0.92
ReplayBlocksMethod · 0.92

Calls 1

AddressMethod · 0.65

Tested by 15

genValSetFunction · 0.74
TestUpdateValidatorsFunction · 0.74
TestProposerFrequencyFunction · 0.74
genValSetWithPowersFunction · 0.74
makeValsFunction · 0.74
ToValidatorsMethod · 0.74
newEvidenceFunction · 0.74
TestMsgToProtoFunction · 0.74
randValidatorFunction · 0.68